nmh-1.5/000777 007761 000765 00000000000 11765271326 012110 5ustar00kenhkenh000000 000000 nmh-1.5/aclocal.m4000644 007761 000765 00000100631 11765270214 013740 0ustar00kenhkenh000000 000000 # generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # This file 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. m4_if(m4_PACKAGE_VERSION, [2.61],, [m4_fatal([this file was generated for autoconf 2.61. You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) # Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file 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. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file 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. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # # This file 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. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ndbm.m4]) m4_include([m4/netlibs.m4]) m4_include([m4/readline.m4]) nmh-1.5/ChangeLog000644 007761 000765 00001012277 11765271326 013670 0ustar00kenhkenh000000 000000 Author: Ken Hornstein Date: Mon Jun 11 00:07:54 2012 -0400 Updated for 1.5 final release. Author: David Levine Date: Sun Jun 10 09:24:39 2012 -0500 Synched test/format/test-mymbox from master to 1.5-release branch. I don't know why it had not been kept up to date. Author: Alexander Zangerl Date: Sun Jun 10 09:20:08 2012 -0500 Corrected install-mh man page to show that it is installed in section 1, not 8. (cherry picked from commit 34ae8b856a0adbbdd68a49e2e97cd0124b8b32dd) Author: Alexander Zangerl Date: Sun Jun 10 09:19:20 2012 -0500 Ensure that writes to /dev/tty succeed to determine if it is writeable. (cherry picked from commit 859a5fe8f243d356882cd3447cc7fba5a5a7a330) Author: Alexander Zangerl Date: Sun Jun 10 09:18:22 2012 -0500 Use cat for moreproc in testsuite in case it is run without tty. (cherry picked from commit 3c73a92285ce86f9103d55a93d7ba14ec46f4ff8) Author: David Levine Date: Fri Jun 8 20:59:32 2012 -0500 Added INSTALL, NEWS, and README to dist_doc_DATA so that they get installed. (cherry picked from commit f0db69237b7e6c18d185ab6f62da62538ebe72b7) Author: Ken Hornstein Date: Sun Jun 3 15:38:39 2012 -0400 Fix incorrect documentation about the install process for files in 'etc'. Noted by Norm Shapiro. Author: Ken Hornstein Date: Sun Jun 3 15:29:27 2012 -0400 One more lowercase for the content-transfer-encoding. (cherry picked from commit f4a3744dd23595be0442c4c035916adfcb0e496f) Author: Ken Hornstein Date: Thu May 31 14:56:47 2012 -0400 Convert the content-transfer-encoding to lower-case always. (cherry picked from commit d0aa081697fcdc51fc24fa268f13a8d130366b36) Author: Ken Hornstein Date: Thu May 31 11:14:41 2012 -0400 Updated for new release candidate. Author: Ken Hornstein Date: Sat May 26 19:58:50 2012 -0400 Use isascii() with isspace() so we don't interpret characters with the high bit set as spaces. Author: David Levine Date: Mon May 21 20:05:19 2012 -0500 comp and dist cannot take multiple message arguments. mhbuild does not set context. (cherry picked from commit ba48f99120f794a4b265069a95d8d8b84b1e84f4) Author: David Levine Date: Mon May 21 20:03:57 2012 -0500 Changed wording to say that the last message selected (not necessarily shown) will become the current message. That's consistent with the mhlist and mhstore man pages. (cherry picked from commit 784305f81e00918613c621cf4fa59e967a3c1b75) Author: Ken Hornstein Date: Thu May 17 08:34:29 2012 -0400 Minor changes to replyfilter to make it compatible with older versions of Perl. (cherry picked from commit 51ef379850faa13b0ffd1df808dc14733b8fd99f) Author: David Levine Date: Sat May 12 09:32:32 2012 -0500 Fixed a few minor things. Author: David Levine Date: Sat May 12 07:44:16 2012 -0500 SIGNATURE/Local-Mailbox are not used by post, but just by front ends (comp, forw, repl, etc.) that read the profile. (cherry picked from commit 809e4cb1458859eac403bf2e23d717c23a9cc892) Author: David Levine Date: Thu May 10 21:23:09 2012 -0500 Don't test with sendmail because it would really send the mail. If configured to use sendmail, change the mts.conf used by the test suite to use smtp instead. (cherry picked from commit e7129bf90a1b361e07365002379d8d2874c0f771) Author: David Levine Date: Tue May 8 20:29:57 2012 -0500 Added test script constructs to avoid. (cherry picked from commit 3af82657e2b0bf04758f149cdeed07e4143a151d) Author: David Levine Date: Tue May 8 10:16:17 2012 -0500 Added MACHINES to EXTRA_DIST so that it gets put in the distribution. (cherry picked from commit 6a83547f2f35bc049dbcb552d6f3bc9979980817) Author: David Levine Date: Mon May 7 16:45:32 2012 -0500 Added $(TESTS_SHELL) at end of TESTS_ENVIRONMENT. This lets the user run the tests using a shell other than the default /bin/sh by using, e.g., make check TESTS_SHELL=/bin/bash. Thanks to Tom Lane for suggesting this. (cherry picked from commit 025bb212470ef2945c9b7f57cb7fbfceb3e04e2c) Author: David Levine Date: Mon May 7 16:35:16 2012 -0500 Fixed some more problems caught by gcc -ansi -pedantic. (cherry picked from commit c4d932d08940f689b39b654a714f9ef3657690a9) Author: Tom Lane Date: Mon May 7 16:14:37 2012 -0500 Fixed places in the code relying the C99-ism of declarations in the midst of a code block. (cherry picked from commit 5ccbd49adba7e6d48f4094fa6eade7a7fb8ec4cf) Author: David Levine Date: Mon May 7 08:57:38 2012 -0500 Removed --enable-pop and SETGID_MAIL= from nmh.spec. (cherry picked from commit 731107f0ab2f3878743fea49910478c6b21bde1b) Author: Ken Hornstein Date: Mon May 7 09:45:38 2012 -0400 Fix test so it will work on terminal widths other than 80. (cherry picked from commit 28b8c0de6bf580a9a07bbc15c407eecfb561667d) Author: David Levine Date: Sun May 6 21:52:22 2012 -0500 Added note about test/inc/test-deb359167 failing because valgrind detects use of an uninitialized variable on older Linux distributions. (cherry picked from commit 2200848a2290adee2ca80bddde72000152d6f088) Author: Ken Hornstein Date: Sun May 6 13:35:09 2012 -0400 Updated for 1.5-RC2 release. Author: David Levine Date: Mon Apr 30 21:56:26 2012 -0500 Removed documentation of obsolete WHATNOW configuration option and built-in FTP client. Removed some completed and obsolete tasks from TODO. Author: David Levine Date: Sat Apr 28 15:56:36 2012 -0500 Allow a user to enable setgid of inc when running distcheck with: make distcheck DISTCHECK_CONFIGURE_FLAGS=DISABLE_SETGID_MAIL=0 though that's probably never going to be used. Author: David Levine Date: Sat Apr 28 07:55:16 2012 -0500 Disable setgid of inc (SETGID_MAIL=1) when running distcheck. Author: Ken Hornstein Date: Fri Apr 27 20:25:20 2012 -0400 Updates OS specific notes. (cherry picked from commit 816e17172cdbc108242a824d377ebba04b8d63ca) Author: David Levine Date: Thu Apr 26 20:37:59 2012 -0500 Moved the set +e up to capture one more test in test-pick. That test heirloom-sh to exit. Author: David Levine Date: Wed Apr 25 20:32:10 2012 -0500 Use case statement to check for proper result from "mhparam sbackup". Also replaced a couple of other uses of grep with case statements. Author: David Levine Date: Wed Apr 25 20:08:55 2012 -0500 Removed the mv of the file after running sed on it. Author: David Levine Date: Wed Apr 25 20:08:03 2012 -0500 Unset all MH environment variables that aren't set below. Author: David Levine Date: Wed Apr 25 14:21:42 2012 -0500 1) With SETGID_MAIL enabled (only with dot locking), if the chgrp of inc fails during install, don't attempt to chmod it. This will cause make install to fail, which is good in this case. 2) Added SETGID_MAIL= to the install by the test suite so that it does not attempt the chgrp+chmod. The test suite didn't need them. 3) Removed the SETGID_MAIL= from the test suite invocation in build_nmh. Author: Oliver Kiddle Date: Wed Apr 25 17:40:09 2012 +0200 futher test suite fixes to work on Solaris (cherry picked from commit a3bf69c3a988b0de2126fbfe6804c61ef24a8896) Author: Ken Hornstein Date: Wed Apr 25 13:02:33 2012 -0500 Disable utmpx support for systems that lack getutxent. Author: David Levine Date: Tue Apr 24 21:04:54 2012 -0500 Fixed test suite to work with Solaris Bourne shell: 1) Removed ! (negation) of statuses. 2) Removed initializations from export statements. 3) Replaced $() with ``. 4) Replaced $(()) (and expr) with new function arith_eval (). Author: Ken Hornstein Date: Tue Apr 24 17:02:38 2012 -0500 Update info for mh-profile documenting comment format and the restriction on blank lines. Author: David Levine Date: Tue Apr 24 14:23:44 2012 -0500 Fixed to work with Solaris Bourne shell. Author: David Levine Date: Tue Apr 24 14:22:06 2012 -0500 Added build_nmh to dist_contrib_DATA. Author: Ken Hornstein Date: Sun Apr 22 13:30:33 2012 -0500 Got the hostname for the savannah upload area wrong. Author: Ken Hornstein Date: Sun Apr 22 10:01:33 2012 -0500 Updated for 1.5-RC1 release. Author: Ken Hornstein Date: Sun Apr 22 09:37:36 2012 -0400 Clean up help messages a bit. Author: Ken Hornstein Date: Sun Apr 22 09:37:24 2012 -0400 Clean up install documentation a bit. Author: Ken Hornstein Date: Fri Apr 20 14:43:16 2012 -0400 Implment -noatfile in a different way; it turns out my previous change broke dist with -noatfile. Author: Ken Hornstein Date: Mon Apr 16 10:33:13 2012 -0400 Change the cscope target slightly so the source code from the historical tree isn't found. Author: David Levine Date: Sun Apr 15 10:02:23 2012 -0500 Added declaration of __srget() on Cygwin. Used point solution because this shouldn't be needed for much longer. Author: David Levine Date: Sun Apr 15 10:00:22 2012 -0500 Added -Wno-sign-compare, if supported, to compile of sbr/dtimep.c. It's code generated by flex and some versions produce a signed/unsigned mismatch. Author: Ken Hornstein Date: Fri Apr 13 11:23:20 2012 -0400 Sigh. More changes for newer versions of perl. Author: Ken Hornstein Date: Thu Apr 12 21:07:57 2012 -0400 Support -fmtproc -nofmtproc in show. Author: Ken Hornstein Date: Thu Apr 12 20:42:52 2012 -0400 More updates to replyfilter Author: Ken Hornstein Date: Thu Apr 12 11:40:42 2012 -0400 Clean up fakesmtp and the post tests a bit to hopefully reduce race conditions that make the tests fail sometimes. Author: David Levine Date: Wed Apr 11 20:59:57 2012 -0500 Undid wrapping of setjmp() and sigsetjmp() of 4548981fb45fbc917cc2c26b7c96b31cf a14bc9b. What a bad idea. Author: David Levine Date: Wed Apr 11 20:42:22 2012 -0500 Tweaked build_nmh to work with Cygwin. Author: David Levine Date: Tue Apr 10 20:47:46 2012 -0500 Removed unused Hesiod relic. Author: David Levine Date: Tue Apr 10 20:47:16 2012 -0500 Added docs/contrib/build_nmh script. Author: Ken Hornstein Date: Fri Apr 6 15:55:14 2012 -0400 Add support for -fmtproc and -nofmtproc switches to repl. Author: David Levine Date: Fri Apr 6 13:27:30 2012 -0500 Changed test-mhparam to allow # sbackup. Author: Ken Hornstein Date: Fri Apr 6 13:57:20 2012 -0400 Fix forw so it respects the -form switch again for non-digests. Author: Ken Hornstein Date: Fri Apr 6 13:56:03 2012 -0400 Refere to VERSION via srcdir so this works when doing objdir builds. Author: David Levine Date: Fri Apr 6 12:27:22 2012 -0500 Reworked mhparam tests of components in procs array to depend on values set in common.sh, notably $pagerpath. Author: David Levine Date: Thu Apr 5 20:15:06 2012 -0500 Added mhparam test of each component in procs array in uip/mhparam.c. Author: David Levine Date: Thu Apr 5 17:14:57 2012 -0500 Fixed install-mh -auto test by specifying HOME. Author: Ken Hornstein Date: Wed Apr 4 23:33:40 2012 -0400 Sigh. More corner cases to deal with! Author: David Levine Date: Wed Apr 4 21:41:39 2012 -0500 Changed rmm, send, and whatnow man pages to be consistent with the refile man page with mention of site-dependent prefix (usually a comma). Author: Ken Hornstein Date: Wed Apr 4 15:55:36 2012 -0400 Fixed some more charset/encoding stuff. Author: Lyndon Nerenberg Date: Tue Apr 3 19:07:52 2012 -0700 This is a test commit to se if the savannah git hub will stop spewing source diffs in commit email messages. In this case, there should be a half-dozen lines of my bable, and no context diffs from the one line change I made in this commit. Author: David Levine Date: Tue Apr 3 20:47:17 2012 -0500 Moved nmh.spec and docs/replyfilter to new docs/contrib/ directory. Author: Ken Hornstein Date: Tue Apr 3 15:56:41 2012 -0400 A few more bugs I didn't catch earlier. Author: Ken Hornstein Date: Tue Apr 3 13:04:47 2012 -0400 Fix some bugs in replyfilter. Author: Ken Hornstein Date: Mon Apr 2 15:58:12 2012 -0400 Whoops, fix a typo in my last commit. Author: Ken Hornstein Date: Mon Apr 2 15:39:00 2012 -0400 Bring in replyfilter to the docs directory. Author: Ken Hornstein Date: Mon Apr 2 15:38:40 2012 -0400 Implement fix in 59b086daa57105e8fbd8b1e6ba60be6a845faf95 here as well. Author: David Levine Date: Sat Mar 31 11:52:10 2012 -0500 Added const qualifier to a couple of local pointers to get rid of compile warnings with --with-tls. Author: David Levine Date: Mon Mar 26 21:28:54 2012 -0500 Removed hostable relics from h/mts.h and sbr/mts.c. Author: David Levine Date: Mon Mar 26 20:32:03 2012 -0500 Removed the hostable option from mts.conf because it's no longer used. This allowed removal of mts/smtp/hosts.c. Author: David Levine Date: Sun Mar 25 22:42:36 2012 -0500 Added test-install-mh. Author: David Levine Date: Sat Mar 24 21:47:31 2012 -0500 Note that %(myname) truncates the GECOS field at the first comma, if it contains one. Author: Ken Hornstein Date: Sat Mar 24 22:32:13 2012 -0400 Add support for %(size). Author: David Levine Date: Sat Mar 24 21:09:20 2012 -0500 Removed -realsize from man page because mhshow doesn't support it. Author: David Levine Date: Sat Mar 24 09:22:41 2012 -0500 Fixed Cygwin notes. Author: David Levine Date: Sat Mar 24 09:13:47 2012 -0500 Ensure that escape_display_name() can't overrun a buffer. Author: David Levine Date: Sat Mar 24 09:04:34 2012 -0500 Cleaned up compile warnings. Author: Ken Hornstein Date: Sat Mar 24 02:15:49 2012 -0400 Add this support for setting the CT_ADDR flag. Author: Ken Hornstein Date: Sat Mar 24 02:08:03 2012 -0400 Sigh. Turns out last change broke a few tests, because it trimmed the newline on the "body" component. Ignore that and the text component as well for trimming. Also create some tests for the repl changes. Author: Ken Hornstein Date: Sat Mar 24 01:16:42 2012 -0400 Revert commit 255d4c646c0d7aa6b049052fef47fa083b1b1506 and solve the problem another way. The component parser needs to save the newlines so it can combine multiple headers properly. So for us, strip out any trailing newlines when we call fmt_scan(). Author: Ken Hornstein Date: Fri Mar 23 23:21:35 2012 -0400 Modify the whatnow tests to deal with different versions of readline; some echo the input, some do not. Author: Ken Hornstein Date: Thu Mar 22 23:34:08 2012 -0400 If the number of messages in a folder is zero, then don't try to clear out the sequence list; this can cause you to run off the beginning of the malloc'd buffer. This can happen when you use "comp" with a draft folder, the draft folder is empty, and you have a previous sequence set in your .mh_profile. As far as I can tell this has been a problem for nearly forever, but I only ran into it recently when adding the readline support. Go figure. Author: David Levine Date: Thu Mar 22 21:06:47 2012 -0500 Added function escape_display_name() to double quote, if not already, a fullname that contains any of the special characters listed in RFC 5322, and escape unescaped, embedded double quotes. With this change, nmh should work with no special configuration on Cygwin, even if the user's fullname is of the form server\name. Author: David Levine Date: Thu Mar 22 19:40:17 2012 -0500 Moved NMH_READLINE to after our setting of CFLAGS, because AC_SEARCH_LIBS messes with them. Author: David Levine Date: Wed Mar 21 20:01:06 2012 -0500 If a pager isn't specified with configure --with-pager, look in order for more, less, and most. Fall back to cat, to avoid catastrophic failure of mhshow, et al., if pagerpath is set to "no". Updated Cygwin section of MACHINES. Author: Ken Hornstein Date: Wed Mar 21 15:27:15 2012 -0400 Support for readline command history, editing, and completion at the WhatNow? prompt. Based on work by Steve Rader. Author: Ken Hornstein Date: Wed Mar 21 12:22:16 2012 -0400 Revert previous change to get rid of MULTIBYTE_SUPPORT ifdef. It turns out this breaks the Plan 9 build. But include a check for the multibyte functions so we get MULTIBYTE_SUPPORT on systems that have it. This reverts commit bd4fca3a8a15b35a04bdc333503c901d677c12eb. Author: David Levine Date: Tue Mar 20 23:49:17 2012 -0500 Fixed harmless compile warnings. Author: Ken Hornstein Date: Tue Mar 20 21:36:37 2012 -0400 It turns out that as part of POSIXification we got rid of checks for wcwidth and mbtowc (because they're part of POSIX) but we didn't turn on MULTIBYTE_SUPPORT because configure was testing to see if those functions were supported ... and because the tests never ran, it always came back as not being supported. Time to bite the bullet and turn MULTIBYTE_SUPPORT on by default. Author: Ken Hornstein Date: Tue Mar 20 20:22:19 2012 -0400 Document formatarg. Author: Ken Hornstein Date: Tue Mar 20 19:52:29 2012 -0400 Use _exit() instead of exit() so our writer process doesn't flush out the stdio buffers on exit. Author: Ken Hornstein Date: Tue Mar 20 19:15:18 2012 -0400 Basic work to add arguments to formatproc calls. Author: Ken Hornstein Date: Mon Mar 19 21:37:14 2012 -0400 Just for sanity's sake, double check the "inc" results also with "scan". Merge: e8ed3af 740e258 Author: David Levine Date: Sun Mar 18 20:59:06 2012 -0500 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Author: Steve Rader Date: Sun Mar 18 20:57:08 2012 -0500 Added list of hand picked types initially genereted by... cat /etc/mime.types \ | perl -ane 'if ($F[1] ne "") {print "mhshow-suffix-$F[0]:.$F[1]\n"}' Author: Ken Hornstein Date: Sun Mar 18 21:29:39 2012 -0400 Fix a bug where a message header ending right on the stdio boundary would cause the body output in scan to be truncated. Also include a test for the aforementioned bug. Author: Ken Hornstein Date: Sat Mar 17 23:42:26 2012 -0400 Fix typo in man page Author: David Levine Date: Sun Mar 18 10:27:05 2012 -0500 Added release note that ./@ is obsolete/deprecated. Author: David Levine Date: Sun Mar 18 09:53:31 2012 -0500 Added test-whom. Author: David Levine Date: Sun Mar 18 09:17:56 2012 -0500 Added documentation of -sever, -port, -sasl, -saslmech, -snoop, -user, -tls, and -notls to whom man page. Author: David Levine Date: Sun Mar 18 09:15:30 2012 -0500 Added whom, it's the fifth program referred to in mh-draft man page. Author: David Levine Date: Sat Mar 17 14:33:43 2012 -0500 In gcov target, added warning if configured with --enable-debug. While gcov will work with it, it won't reflect optimizations that are disabled with that option. Merge: 7cc0e99 67c56ba Author: David Levine Date: Fri Mar 16 22:11:09 2012 -0500 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Conflicts: Makefile.am Author: David Levine Date: Fri Mar 16 21:07:52 2012 -0500 Automated generation of mh-chart.man. Author: David Levine Date: Fri Mar 16 21:07:52 2012 -0500 Automated generation of mh-chart.man. Author: David Levine Date: Fri Mar 16 21:05:21 2012 -0500 Commmiting last manual update of mh-chart.man before removing it. Author: David Levine Date: Fri Mar 16 21:02:57 2012 -0500 Removed some unused code having to do with permissions of symlinks. Author: David Levine Date: Fri Mar 16 21:01:30 2012 -0500 Added mhshow-suffix-text/calendar. Author: Ken Hornstein Date: Fri Mar 16 13:21:38 2012 -0400 Improve the documentation for "send" a bit in terms of how it maps file suffixes to MIME types. Author: Ken Hornstein Date: Fri Mar 16 13:02:43 2012 -0400 Make -attach Nmh-Attachment & -attachformat 1 the default. Author: Ken Hornstein Date: Fri Mar 16 11:37:31 2012 -0400 Update for changes to post. Author: Ken Hornstein Date: Fri Mar 16 11:32:35 2012 -0400 Create new switches -atfile and -noatfile to control the creation of the @ file when repl'ing or dist'ing a message. Author: Ken Hornstein Date: Fri Mar 16 00:21:35 2012 -0400 Update post(8) regarding the New World Order. Author: Ken Hornstein Date: Thu Mar 15 23:14:48 2012 -0400 Whoops, forgot to put "." before some of the suffixes. Author: Ken Hornstein Date: Thu Mar 15 23:09:41 2012 -0400 Add some more default MIME content suffixes. Author: Ken Hornstein Date: Thu Mar 15 23:00:06 2012 -0400 Call readconfig() on mhn.defaults so we get default entries in for use with attach. Author: Ken Hornstein Date: Thu Mar 15 22:23:20 2012 -0400 A test for the group addressing functionality handled by "post". Author: Ken Hornstein Date: Thu Mar 15 15:54:02 2012 -0400 Remove all masquerade support (draft_from is now the default, and the other two can be accomplished via the components file). Author: Ken Hornstein Date: Thu Mar 15 13:55:15 2012 -0400 Clean up prototypes. Author: Ken Hornstein Date: Thu Mar 15 13:04:38 2012 -0400 Fix some warnings. Author: Ken Hornstein Date: Thu Mar 15 11:55:34 2012 -0400 I guess the -i option to sed works differently on Linux and MacOS X; deal with it. Author: David Levine Date: Wed Mar 14 21:05:16 2012 -0500 Initialized local format_len. gcc on 64-bit Linux warned about it. Author: Ken Hornstein Date: Wed Mar 14 21:15:54 2012 -0400 New test suite for "post"; uses fakesmtp to trap the SMTP protocol. Author: Ken Hornstein Date: Wed Mar 14 21:15:17 2012 -0400 Make sure we don't send Envelope-From if we're using spost. Author: Ken Hornstein Date: Wed Mar 14 15:51:22 2012 -0400 A new test program, fakesmtp, to help us test post. Author: Ken Hornstein Date: Wed Mar 14 15:47:01 2012 -0400 Fix the SMTP code so it doesn't end up in a hard loop during a DATA command. Author: David Levine Date: Tue Mar 13 22:28:03 2012 -0500 Disabled the optimization to stop stat'ing directory entries in BuildFolderListRecurse() of flist.c under conditions where st_nlink is set to 1. That happens on Cygwin, for example: http://cygwin.com/ml/cygwin-apps/2008-08/msg00264.html Author: David Levine Date: Tue Mar 13 22:01:52 2012 -0500 Changed output_md5() to output just the checksum. If the filename needs to appear on the same line, the caller needs to add it. This avoids differences due to a leading '*' binary file indicator, even for text files, on Cygwin. Author: David Levine Date: Tue Mar 13 21:20:47 2012 -0500 Added test/getfqnd.c, a replacement for "hostname" that always tries to provide the fully qualified domainname of the host, even on Cygwin. It uses the code that LocalName in sbr/mts.c uses. Author: David Levine Date: Tue Mar 13 19:58:33 2012 -0500 On some platforms, need to be out of $SPDIR in order to remove it. So do that in test/whatnow/test-ls. Author: David Levine Date: Tue Mar 13 19:56:06 2012 -0500 Promote uid_t value to long and print with %ld to prevent compile warning on platforms, such as Cygwin, where it is a long. Author: Ken Hornstein Date: Tue Mar 13 15:25:41 2012 -0400 Modify getfullname so it performs the same processing that mts.c:getuserinfo() does. Author: Ken Hornstein Date: Tue Mar 13 15:15:42 2012 -0400 Create proper prototypes for formataddr() and concataddr(). Author: Ken Hornstein Date: Mon Mar 12 22:52:21 2012 -0400 New changes: Sender: cannot be blank, Sender: always overrides From: for SMTP envelope, and Envelope-From: will cause a Sender: header to be output if multiple From: addresses are used. Author: Ken Hornstein Date: Sun Mar 11 21:47:04 2012 -0400 Require From: header in all outgoing messages. Allow Sender: header (require if multiple addresses are in From:). Support new Envelope-From: header for overriding post's choice of SMTP envelope-from address. Author: Ken Hornstein Date: Sun Mar 11 18:08:03 2012 -0400 Add support for a -notls switch, for consistency's sake. Author: Ken Hornstein Date: Sat Mar 10 22:55:16 2012 -0500 Clean up a bunch of unused code and options. Specifically: - Remove support for SMTP SEND, SAML, and SOML commands - Remove -deliver, -fill-in and -fill-up switch for post (and related code) - Document -server and -port switches better in post man page. Author: Ken Hornstein Date: Tue Mar 6 09:25:00 2012 -0500 SMTPMTS has been the default for over a decade, so it's time to get rid of the #ifdefs to clean up the code a bit. Author: David Levine Date: Sun Mar 11 19:52:38 2012 -0500 Fixed mhstore to honor nmh-storage profile entry even with -auto [Bug #35303]. Author: David Levine Date: Sat Mar 10 20:33:24 2012 -0600 There were two fd leaks in mhparse.c: 1) In openQuoted(), the decoded contents file was opened twice in succession. The second open was added by a patch in March 2000. 2) openBase64(), openQuoted(), and open7Bit() could open the contents file, but it never would be closed. Added code to each to close the file if the function opened it. [Bug #24004: (debbug 344182)] Author: David Levine Date: Sat Mar 10 10:45:01 2012 -0600 Replaced UTC-8 with UTF-8. Author: David Levine Date: Sat Mar 10 10:44:30 2012 -0600 Removed bash-ism from test-pick. Author: David Levine Date: Thu Mar 8 21:29:28 2012 -0600 Enabled all groff warnings, with -ww, in manpages test. Fixed a bunch of minor problems that it revealed. Author: David Levine Date: Thu Mar 8 21:09:59 2012 -0600 Fixed mhlist -verbose to work with all content types [Bug #35219]. Author: David Levine Date: Thu Mar 8 20:19:53 2012 -0600 1) Removed -noverbose from defaults of mhshow man page. While it accepts -verbose/-noverbose, it ignores them. 2) Added -verbose/-noverbose to mhlist synopsis. Author: David Levine Date: Wed Mar 7 22:08:03 2012 -0600 Added test-refile. Author: David Levine Date: Wed Mar 7 20:20:13 2012 -0600 Replaced us-ascii with iso-8859-1 in examples, just because. Author: David Levine Date: Tue Mar 6 21:57:16 2012 -0600 Added test-mhparam and test-mhstore. Author: David Levine Date: Tue Mar 6 19:57:22 2012 -0600 Removed all traces of rmfproc. It had been used by bbl but was no longer used. Author: David Levine Date: Tue Mar 6 19:08:21 2012 -0600 Some of the man pages had mentioned that arguments should be double-quoted to protect them from the shell. Removed "double-" because single quoting is fine, too. Author: David Levine Date: Tue Mar 6 18:52:41 2012 -0600 Escape spaces in DEFAULTS sections of man pages so they no longer are lost. Author: David Levine Date: Tue Mar 6 18:51:12 2012 -0600 Removed ignored -verbose (and -noverbose) options to mhstore, just in the man pages. The code remains unchanged. Author: David Levine Date: Tue Mar 6 18:49:27 2012 -0600 Fixed example to show that mhparam preserves case of component name. Author: David Levine Date: Tue Mar 6 18:48:21 2012 -0600 Initialized local wasdlm to prevent uninitialized use. Author: Ken Hornstein Date: Mon Mar 5 13:55:04 2012 -0500 Finally got a reasonable burst test working. Author: Ken Hornstein Date: Mon Mar 5 13:24:41 2012 -0500 Update with recent fix. Author: Ken Hornstein Date: Mon Mar 5 13:21:04 2012 -0500 Change this to use "uint32_t" for a 32-bit type, otherwise we can get wrong MD5 checksums on 64-bit systems. Score another one for the test suite! Author: Ken Hornstein Date: Mon Mar 5 12:23:15 2012 -0500 Fix burst so it actually complies with RFC 934. This means discarding any extra stuff leftover at the end of an encapsulated message. Author: Ken Hornstein Date: Thu Mar 1 15:17:43 2012 -0500 A test for burst; still needs work. Author: David Levine Date: Sat Mar 3 12:23:58 2012 -0600 Added test-mhlist. Author: David Levine Date: Sat Mar 3 12:21:00 2012 -0600 mhbuild -check would always fail because it tried to build the digest for the decoded contents file (cefile), which can be null. If it is, use the contents file itself. Author: David Levine Date: Thu Mar 1 18:01:52 2012 -0600 Brought mh-chart man page up to date. Author: David Levine Date: Thu Mar 1 12:33:19 2012 -0600 Added documentation of -snoop. Author: David Levine Date: Thu Mar 1 12:32:23 2012 -0600 Removed RCS sparc object file. Author: David Levine Date: Thu Mar 1 12:29:33 2012 -0600 Under docs/historical/mh-6.8.5, mh.rf and mh.me were renamed to mh-intro.rf and mh-intro.me, respectively, to avoid name clashes with other files on case-insensitive file systems. Author: David Levine Date: Thu Mar 1 12:13:14 2012 -0600 Removed entire docs/historical/mh-6.8.5/local/ tree. It had a pair of files, Distfile and distfile, with clashing case-insensitive names. The rest of it was specific to UCI and LBL. Author: Ken Hornstein Date: Thu Mar 1 12:33:42 2012 -0500 %G isn't actually part of POSIX, so change to %Y. Author: Ken Hornstein Date: Thu Mar 1 12:02:29 2012 -0500 Fixed a problem that caused the test to fail if you ran it on the first nine days of the month. Author: David Levine Date: Wed Feb 29 20:33:24 2012 -0600 Initialized local msgnum to 0. Author: David Levine Date: Wed Feb 29 18:41:14 2012 -0600 Added all of the MH sources, including RCS files, in docs/historical/mh-6.8.5. Sources for the papers are below papers/. Sources for the MH User's Manual are in conf/doc/. Merge: c7f326f 7565efe Author: David Levine Date: Wed Feb 29 16:36:59 2012 -0600 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Conflicts: docs/historical/README Author: David Levine Date: Wed Feb 29 13:49:28 2012 -0600 Removed the sources to the historical documents just added, they're in the mh-6.8.5 tarball. Author: David Levine Date: Wed Feb 29 13:49:28 2012 -0600 Added sources to historical documents downloaded from http://stuff.mit.edu/afs/sipb/project/sipb-athena/src/mh/papers/ Author: Ken Hornstein Date: Wed Feb 29 08:52:26 2012 -0500 Fix a segfault that happens when using the -file option. Author: Ken Hornstein Date: Wed Feb 29 08:51:27 2012 -0500 Argh, I didn't mean to commit the distcomps I was using for testing! Author: Ken Hornstein Date: Tue Feb 28 15:38:56 2012 -0500 dist(1) now processes drafts using mh-format! The last of the programs to do so! Author: Ken Hornstein Date: Tue Feb 28 15:38:37 2012 -0500 Fix this man page for the New World Order. Author: Ken Hornstein Date: Tue Feb 28 15:29:56 2012 -0500 Improve these man pages a bit. Author: Ken Hornstein Date: Tue Feb 28 14:45:03 2012 -0500 Add support for %(msg) function working when not using -digest. I can't imagine what someone would use it for but it's cheap to do, so why not? Author: Ken Hornstein Date: Tue Feb 28 10:32:41 2012 -0500 Part of the patch from bug #4301; clean up our prototypes, a lot. Still plenty of work to do! Author: David Levine Date: Tue Feb 28 22:05:55 2012 -0600 Added docs/historical/. See README for where they were found. Merge: 56f140c e22a2c8 Author: David Levine Date: Mon Feb 27 21:12:22 2012 -0600 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Author: David Levine Date: Mon Feb 27 21:10:47 2012 -0600 Removed blank line after "End of Forwarded Message" lines. It's always bothered me. Author: Ken Hornstein Date: Mon Feb 27 22:11:34 2012 -0500 Add the note about the burst(1) change to pending-release-notes. Author: Ken Hornstein Date: Mon Feb 27 22:05:41 2012 -0500 Fix bug #1466. It turns out that RFC 934 specifies that any line starting with a "-" but NOT followed by a space is a valid message delimiter. We only supported one type of message delimiter. Adapt the code so any valid delimiter is supported. Author: David Levine Date: Mon Feb 27 20:56:58 2012 -0600 Added cast in conditional to prevent signed/unsigned comparison, and wrapped argument to prevent warning about unused argument when built without SASL support. Author: David Levine Date: Mon Feb 27 20:50:29 2012 -0600 Changed domains in man page and test examples to use example.com Author: David Levine Date: Mon Feb 27 20:42:19 2012 -0600 Fixed to report failure if getfulname hadn't been built yet. Author: David Levine Date: Mon Feb 27 20:40:15 2012 -0600 They test with output to a tty didn't work under make distcheck. Tried to work around it by writing directly to /dev/tty, if that's available. Author: Ken Hornstein Date: Mon Feb 27 20:50:49 2012 -0500 Add support for -nosasl and -saslmaxssf switches. Author: Ken Hornstein Date: Mon Feb 27 14:13:02 2012 -0500 Document changes to forw(1). Author: Ken Hornstein Date: Mon Feb 27 14:12:34 2012 -0500 Clean up some typos in here. Author: Ken Hornstein Date: Mon Feb 27 13:45:37 2012 -0500 Got the forw -digest test working. Author: Ken Hornstein Date: Mon Feb 27 13:37:09 2012 -0500 Update digestcomps and forwcomps with comments and better formatting. Author: Ken Hornstein Date: Mon Feb 27 12:56:00 2012 -0500 Make -volume switch actually work (it always got overridden). As far as I can tell, this never worked. Found by the test suite! Author: Ken Hornstein Date: Sun Feb 26 21:29:44 2012 -0500 Remove the forw-digest test until we have it working. Author: Ken Hornstein Date: Sun Feb 26 21:29:01 2012 -0500 A test for forw -digest. It doesn't quite work yet. Author: Ken Hornstein Date: Sun Feb 26 21:14:04 2012 -0500 Fix up some of the pick tests: - Change sed invocation around to get rid of GNU sed extensions - Put explicit times in the pick tests (if you don't, it uses the current hour/minutes as the timestamp, which means it could work or not work depending on what time of day you run the tests). Author: Ken Hornstein Date: Sun Feb 26 13:02:41 2012 -0500 Update the pending release notes with new features. Author: Ken Hornstein Date: Sun Feb 26 12:45:48 2012 -0500 Add a new README documenting the changes to the components files. Author: Ken Hornstein Date: Sun Feb 26 12:12:28 2012 -0500 Beginnings of a test suite for the mh-format support in forw. Author: David Levine Date: Sun Feb 26 10:55:46 2012 -0600 Added test-pick. Author: David Levine Date: Sun Feb 26 10:32:29 2012 -0600 Suppress echoing of man page build lines. One of them says "warning", and it's handy to check that build output doesn't say that. Author: David Levine Date: Sun Feb 26 10:10:35 2012 -0600 Changed type of a local to unsigned and removed local ncomps to suppress compile warnings. Author: David Levine Date: Sun Feb 26 10:09:35 2012 -0600 Added gcov and gcov-clean targets. Author: Ken Hornstein Date: Sun Feb 26 00:09:52 2012 -0500 Finally, some support for mh-format when using forw(1). Still needs some tests. Author: Ken Hornstein Date: Thu Feb 23 12:03:09 2012 -0500 Create a test for the new mh-format processing available in comp(1). Author: David Levine Date: Wed Feb 22 22:23:05 2012 -0600 Added test-flist and test-mark sequences tests. Author: David Levine Date: Wed Feb 22 22:21:56 2012 -0600 Don't list _sysconfdir/ directory in RPM spec. We don't list any other directories, so now it will be created with the same permissions as all of the others. Author: David Levine Date: Tue Feb 21 19:35:05 2012 -0600 Removed reference to mhost.com. Author: David Levine Date: Tue Feb 21 19:34:33 2012 -0600 Updated to reflect that all of the lists are on nongnu.org. Author: David Levine Date: Tue Feb 21 19:31:08 2012 -0600 With "make rpm", configure all modified files in sysconfdir (etc) to be saved when erasing or upgrading the package. Also, leave the doc directory whereever "make install" puts it. Author: Ken Hornstein Date: Tue Feb 21 15:56:06 2012 -0500 Add support for a -subject switch to comp. Author: Ken Hornstein Date: Tue Feb 21 12:58:50 2012 -0500 Switch from (me) to (localmbox) to make -cc me work correctly. Author: David Levine Date: Mon Feb 20 22:02:26 2012 -0600 Migrated a couple more tests to use run_test() in common.sh. Author: Ken Hornstein Date: Mon Feb 20 00:31:14 2012 -0500 Put default From: headers in these component files, and document the components file now that we can have comments. Author: Ken Hornstein Date: Mon Feb 20 00:31:01 2012 -0500 Clean up documentation formatting Author: David Levine Date: Sun Feb 19 22:29:14 2012 -0600 Removed unused local ncomps because gcc complained about it. Author: Ken Hornstein Date: Sun Feb 19 19:59:06 2012 -0500 Add support for "to", "cc", "from", and "fcc" components via command-line switches. Author: Ken Hornstein Date: Sun Feb 19 18:03:26 2012 -0500 Fix a bug leftover from the Automake conversion; the AC_SUBST'd variable names are really editorpath and pagerpath, use those instead. Author: David Levine Date: Sat Feb 18 22:36:50 2012 -0600 Ken noted that "make check" can be run before installation because the only program in lib that the tests currently use is mhlproc, and we have an mhlproc entry in the test .mh_profile for that. Added showproc and postproc entries in case they're ever needed. Author: David Levine Date: Sat Feb 18 17:32:15 2012 -0600 Moved "make check" to after "make install". Author: David Levine Date: Sat Feb 18 17:31:37 2012 -0600 gcc was warning about unused arguments to main, so added use of them in a usage check. Author: David Levine Date: Sat Feb 18 17:30:47 2012 -0600 Consolidated runtest and check_string test functions. Author: David Levine Date: Sat Feb 18 11:21:28 2012 -0600 Have each test clean up after itself if it completes successfully. Author: David Levine Date: Sat Feb 18 09:42:04 2012 -0600 Added mhpath test. Updated mhpath man page to reflect actual behavior for a message number greater than that of the highest existing message in a folder. Author: David Levine Date: Sat Feb 18 08:03:21 2012 -0600 The test check() function now removes the expected and actual output files if they're the same, by default. Added check-string() function. Author: David Levine Date: Fri Feb 17 19:10:08 2012 -0600 Initialized local "in" to suppress gcc warning about possible uninitialized use. Author: David Levine Date: Fri Feb 17 19:08:42 2012 -0600 Enclosed program name and directory in double quotes so that they can contain whitespace. Author: David Levine Date: Fri Feb 17 18:44:35 2012 -0600 Here's the proper fix instead of the hack of d28ce569fe233141f86fe516878361da01c9f9cb. Use ${srcdir} in to refer to extra files in tests, as before. Author: Ken Hornstein Date: Fri Feb 17 15:56:08 2012 -0500 Beginning support for mh-format support in comp(1). Includes changes to default component file. Author: Ken Hornstein Date: Fri Feb 17 15:10:06 2012 -0500 Sigh. Looks like we need a function after all; create a new function called %(localmbox). Author: Ken Hornstein Date: Fri Feb 17 14:02:44 2012 -0500 Switch to including h/mts.h for getusername() prototype. Author: David Levine Date: Thu Feb 16 22:56:02 2012 -0600 Added a couple of NMH_UNUSED's to suppress warnings when building without Cyrus SASL. Author: David Levine Date: Thu Feb 16 22:49:03 2012 -0600 Hacked to work with make distcheck. Maybe not the best way but it works for now. Author: David Levine Date: Thu Feb 16 22:02:21 2012 -0600 Moved check() function from individual tests to common.sh. Author: David Levine Date: Thu Feb 16 21:30:43 2012 -0600 Rearranged test suite environment variables so that individual tests can now be run standalone (outside of make). But see WARNING in test/README about how it's better to use "make check" because that ensures that the current code in your workspace is tested. Also, the clean script no longer needs to call setup_test. Author: Ken Hornstein Date: Thu Feb 16 11:46:16 2012 -0500 Report an error when the width used by putaddr is less than the label width. Author: Ken Hornstein Date: Thu Feb 16 00:17:49 2012 -0500 Hopefully made the format documentation a little bit clearer. Author: Ken Hornstein Date: Wed Feb 15 21:45:13 2012 -0500 Fix typo in repl man page. Author: Ken Hornstein Date: Wed Feb 15 15:54:47 2012 -0500 Create test cases for the new format functions for local address writing. Author: Ken Hornstein Date: Wed Feb 15 15:53:26 2012 -0500 Make it so we do NOT check our address against the "local" userid and hostname if Local-Mailbox is set. Author: Ken Hornstein Date: Wed Feb 15 15:46:28 2012 -0500 Sigh. Turns out the first entry in the list isn't actually checked, so we need to make sure that our Local-Mailbox entry starts second. Author: Ken Hornstein Date: Wed Feb 15 14:55:25 2012 -0500 Hm, it turns out we need to make sure we call getname() until we get a NULL, otherwise the next set of calls to it will be working from the "old" search string. Author: Ken Hornstein Date: Wed Feb 15 11:36:36 2012 -0500 Beginning of support for the Local-Mailbox profile entry. Author: Ken Hornstein Date: Wed Feb 15 10:48:52 2012 -0500 Support getting the "fullname" out of the Signature profile setting. Author: David Levine Date: Tue Feb 14 20:47:06 2012 -0600 Updated documentation of environment variables in mh-profile man page. Author: Ken Hornstein Date: Tue Feb 14 20:24:43 2012 -0500 Add two new format functions: %(myhost) and %(myname). Author: David Levine Date: Mon Feb 13 19:55:53 2012 -0600 Changed "make test" to "make check". Author: David Levine Date: Mon Feb 13 19:54:41 2012 -0600 Fixed progress indicator. Author: Ken Hornstein Date: Sat Feb 11 23:28:10 2012 -0500 Another problem discovered by the test suite. With multiple sequence arguments on the command line you might end up with garbage in the sequence[] array (it needs the last argument to be a NULL. So do two things: make the first two arguments NULL, and as we add arguments to sequence[] make sure the list has a NULL on the end. Author: Paul Fox Date: Sat Feb 11 13:06:47 2012 -0500 correct the maximum number of sequences in the mark(1) man page also add a note explaining the somewhat low limit. Author: Paul Fox Date: Sat Feb 11 12:41:30 2012 -0500 mhshow: suppress pause actions if stdout isn't a tty previously, "mhshow | cat" would both print a "Press return" prompt to, and attempt to read from, its piped output fd. Author: Ken Hornstein Date: Fri Feb 10 23:38:40 2012 -0500 Fix this so it works when valgrind is installed. Author: Ken Hornstein Date: Fri Feb 10 23:27:36 2012 -0500 Switch over to using the template files out of our inst directory. Author: Ken Hornstein Date: Fri Feb 10 23:22:12 2012 -0500 Switch to using the "inst" version of mhl for tests. Author: Ken Hornstein Date: Fri Feb 10 23:09:03 2012 -0500 Re-work the test suite so it now works with Automake (via "make check"). Author: Ken Hornstein Date: Fri Feb 10 20:59:21 2012 -0500 Fix typo in alternate mts.conf location support. Author: Ken Hornstein Date: Fri Feb 10 15:11:05 2012 -0500 Make the test suite work on systems other than Linux. Still needs work. Author: Ken Hornstein Date: Fri Feb 10 09:50:48 2012 -0500 With the fixing of the bug that caused CPPFLAGS to get tromped on, remove support for OURDEFS and direct people to use CPPFLAGS instead. Author: Ken Hornstein Date: Thu Feb 9 23:43:30 2012 -0500 Fix typo in variable test. Author: David Levine Date: Thu Feb 9 20:38:22 2012 -0600 Show assignment of configure variables using VAR=VALUE instead of in the shell environment. Author: David Levine Date: Wed Feb 8 22:29:59 2012 -0600 Updated INSTALL and MACHINES documentation a bit. Author: David Levine Date: Wed Feb 8 21:42:46 2012 -0600 Added mhshow subpart test. Author: David Levine Date: Wed Feb 8 21:41:48 2012 -0600 Always run setup-test from make test/runalltests, just in case the test build directory (test/testbuild) isn't up to date. It might be nice to replace all the copies in the test build directory with symlinks, then make could keep the test build up to date. Author: David Levine Date: Tue Feb 7 21:43:26 2012 -0600 Added OURDEFS to DEFS in Makefile.am, to restore it in the Makefile. Updated documentation in INSTALL. Author: David Levine Date: Tue Feb 7 21:23:37 2012 -0600 Removed use of tzset()/tzname in dtimezone(). They caused the returned timezone string to be for the user's current timezone, but the function is supposed to return the string representation of the timezone of its argument. That will be numeric, e.g., +0100, now because we no longer have timezone name support. Author: David Levine Date: Tue Feb 7 21:17:00 2012 -0600 Reverted TZ hack to tests, 9ea2daf5e74e3ff03043cfa6fb68033aea0da52a. A code fix is on its way Author: David Levine Date: Mon Feb 6 22:35:21 2012 -0600 Another one caught by the test suite: an indented line was too long in the slocal man page. Center it instead. Author: David Levine Date: Mon Feb 6 22:25:25 2012 -0600 Some tests failed because they displayed the user's local time zone but expected GMT. So, set TZ in runtest to fool them. Though I wonder if we're failing to correct for local time zone. Author: David Levine Date: Mon Feb 6 21:47:52 2012 -0600 Caught by the test suite: sequences[0] needs to be initialized to NULL at the beginning of the program. That explains why it seg faulted when invoked with a sequence argument. Author: David Levine Date: Mon Feb 6 21:19:57 2012 -0600 Reworked test suite to copy the configuration used in the main nmh directory. Added test target to Makefile. Not all the tests pass at this point. Author: Ken Hornstein Date: Mon Feb 6 14:12:00 2012 -0500 Still more autoconf cleanup (quoting & more use of M4sh). Author: Ken Hornstein Date: Mon Feb 6 11:31:18 2012 -0500 Patch from Harvey Eneman: fixes problem on some systems where a free() would be called on non-malloc'd memory (only would happen if you had more than one entry in the server: line in mts.conf). Author: Ken Hornstein Date: Mon Feb 6 10:27:43 2012 -0500 Update the developer documentation with the changes to the release process. Author: Ken Hornstein Date: Mon Feb 6 09:08:19 2012 -0500 More configure cleanup to modern constructs. Author: Ken Hornstein Date: Sun Feb 5 17:17:41 2012 -0500 Autoconf cleanup to suggested practice (AS_IF & AC_MSG_FAILURE). More to do. Author: David Levine Date: Sun Feb 5 15:26:16 2012 -0600 Added error message if the file is source directly, rather than through bash-completion. Author: David Levine Date: Sun Feb 5 14:13:07 2012 -0600 Exit with error message if no library could be found with tgetent. Author: Ken Hornstein Date: Sat Feb 4 00:11:27 2012 -0500 Whoops, used "buffer" when I meant "buf". Author: Ken Hornstein Date: Fri Feb 3 23:43:53 2012 -0500 Change LocalName() to take an argument (about whether or not to use local hostname versus entry in mts.conf). Merge: 24ccfac 196f981 Author: David Levine Date: Fri Feb 3 17:10:49 2012 -0600 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Author: David Levine Date: Fri Feb 3 17:10:44 2012 -0600 Use more up-to-date web page links of Jerry Peek's book sections at rand-mh.sourceforge.net instead of oreilly.com. Author: Ken Hornstein Date: Fri Feb 3 15:38:49 2012 -0500 Convert from the poorly-named and confusing adrsprintf() to getlocaladdr(). Author: Ken Hornstein Date: Fri Feb 3 15:03:00 2012 -0500 Make the upload target phony. Author: Ken Hornstein Date: Fri Feb 3 15:01:50 2012 -0500 Beginnings of an upload Makefile target. Author: Ken Hornstein Date: Fri Feb 3 13:50:19 2012 -0500 Update with new features. Author: Ken Hornstein Date: Fri Feb 3 13:49:46 2012 -0500 Document the formatproc entry. Author: Ken Hornstein Date: Thu Feb 2 22:13:57 2012 -0500 Move the eval statements inside of AC_CONFIG_COMMANDS_POST macro, otherwise the stuff we output might not be correct. Author: David Levine Date: Tue Jan 31 23:17:33 2012 -0600 Added #includes to pick up declaration of waitpid() Author: Ken Hornstein Date: Tue Jan 31 13:20:40 2012 -0500 Whoops, I need to make sure the buffer I pass to putcomp() is NULL-terminated. Author: Ken Hornstein Date: Tue Jan 31 12:58:04 2012 -0500 Add support for calling an external format program inside of mhl. Merge: abf5b4f c8206d4 Author: David Levine Date: Sat Jan 28 14:12:05 2012 -0600 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Author: David Levine Date: Sat Jan 28 13:52:59 2012 -0600 Made ChangeLog target phony so it will always get regenerated. But don't try to regenerate if git repository is not present. Author: David Levine Date: Sat Jan 28 13:52:59 2012 -0600 Made ChangeLog phony so it will always get regenerated. But don't try to regenerated if git repository is not present. Author: David Levine Date: Sat Jan 28 12:45:15 2012 -0600 The www.ics.uci.edu/~mh/ links are dead, so replaced them with corresponding oreilly.com links. Author: David Levine Date: Sat Jan 28 12:33:27 2012 -0600 Replaced static ChangeLog with one generated by git log. Author: Ken Hornstein Date: Sat Jan 28 00:29:13 2012 -0500 Create "nowrap" flag to turn off all line wrapping. Author: David Levine Date: Fri Jan 27 20:30:58 2012 -0600 Organized .gitignore to show which objects are deleted by the various Makefile clean targets. Author: David Levine Date: Fri Jan 27 19:56:50 2012 -0600 Added superclean Makefile target. Added a.out.DSYM's to clean target. Added .PHONY indication of rpm target. Author: David Levine Date: Fri Jan 27 19:40:48 2012 -0600 Removed config.guess and config.sub because they're generated by autoreconf -i. Author: David Levine Date: Fri Jan 27 19:39:47 2012 -0600 Updated to latest config.guess and config.sub before removing them from the repo, just in case someone needs them and can't generate them. Author: David Levine Date: Fri Jan 27 19:36:14 2012 -0600 Changed a variable to unsigned and noted an argument as unused to silence compile warnings in uip/popsbr.c Author: Ken Hornstein Date: Fri Jan 27 13:47:14 2012 -0500 Fix long-standing problem with getans(); handle the case if we get an interrupted by a signal during a character read and return an EINTR. Author: Ken Hornstein Date: Fri Jan 27 13:34:17 2012 -0500 Convert to the use of siglongjmp() Author: Ken Hornstein Date: Fri Jan 27 12:30:52 2012 -0500 Make POP support always be turned on. Merge: da6bfd3 d5c47f7 Author: Lyndon Nerenberg Date: Fri Jan 27 08:16:57 2012 -0800 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/nmh Author: Lyndon Nerenberg Date: Fri Jan 27 08:16:36 2012 -0800 Typo fix. Author: David Levine Date: Thu Jan 26 22:36:17 2012 -0600 Added clean-local target to remove RPM directory. Author: David Levine Date: Thu Jan 26 20:05:30 2012 -0600 Added uip/*.exe, for Cygwin. Author: David Levine Date: Thu Jan 26 20:04:33 2012 -0600 Removed slash in front of $(man5dir) of install-data-hook rule so that it now works on Cygwin. Author: David Levine Date: Wed Jan 25 22:22:02 2012 -0600 Fixed rpm target now that nmhdist is gone. Author: David Levine Date: Wed Jan 25 20:48:55 2012 -0600 Updated config test to add -Wextra to be consistent with others. So, it's back! Author: David Levine Date: Wed Jan 25 19:44:30 2012 -0600 If using gcc, use -Wno-unused-macros when compiling sbr/dtime.o. Author: David Levine Date: Wed Jan 25 19:38:49 2012 -0600 Removed unused local bp. Author: David Levine Date: Wed Jan 25 19:33:17 2012 -0600 Undid most of 3ef341abe440ece07f8deed59fb026ab020e805 because FreeBSD needs the HAVE_STRUCT_TM_TM_GMTOFF test. It has a timezone() function, not a timezone global variable (that's visible with our default configuration. Author: lyndon Date: Wed Jan 25 20:10:52 2012 -0800 Remove hardlink target before attempting new link. Author: lyndon Date: Wed Jan 25 18:15:47 2012 -0800 uip/termsbr.c: remove references to PC and ospeed(). These are no longer referenced by the code base now that vmh has been removed. Author: Ken Hornstein Date: Tue Jan 24 12:56:45 2012 -0500 Create a "cscope" target that creates the necessary files to use cscope. Author: lyndon Date: Mon Jan 23 22:48:24 2012 -0800 cscope.files was missing mts/smtp/*. Author: lyndon Date: Sun Jan 22 23:21:03 2012 -0800 Ignore cscope.out. Author: lyndon Date: Sun Jan 22 23:08:02 2012 -0800 Add a default configuration file for cscope(1). I generated the file list by hand. While it might be possible to generate it from the Makefile, it was much simpler to just ls */*.[cl]|grep -v sbr/dtimep.c If source files are added or removed down the road, cscope.files will need a hand edit to keep it in sync. Author: Ken Hornstein Date: Sun Jan 22 01:15:40 2012 -0500 Make sigmsg.h NOT depend on the Makefile. Author: Ken Hornstein Date: Sun Jan 22 01:14:34 2012 -0500 Clean up DESTDIR usage. Author: Ken Hornstein Date: Sun Jan 22 01:12:18 2012 -0500 Add the rule to install inc setgid if requested. Author: Ken Hornstein Date: Fri Jan 20 23:39:14 2012 -0500 Fix some problems that the Automake migration caused. Author: Ken Hornstein Date: Fri Jan 20 14:05:26 2012 -0500 Convert the build system over to the use of Automake. Author: David Levine Date: Tue Jan 17 17:33:29 2012 -0600 Well the wrap of vfork() calls didn't work: its semantics don't allow that. So removed the wrapper and added -Wno-clobbered to gcc -Wextra. Author: Ken Hornstein Date: Tue Jan 17 14:27:06 2012 -0500 Convert from our use of aclocal.m4 to a subdirectory with autoconf macros in it. Author: Ken Hornstein Date: Tue Jan 17 14:15:32 2012 -0500 Change the name of AC_CHECK_NETLIBS, since it's not a macro distributed by Autoconf. Author: Ken Hornstein Date: Tue Jan 17 10:58:40 2012 -0500 Update .gitignore with .DS_Store (seen occasionally on MacOS X systems). Author: Ken Hornstein Date: Tue Jan 17 10:57:54 2012 -0500 Convert from utmp functions to utmpx functions (which are in POSIX). Author: David Levine Date: Mon Jan 16 20:58:15 2012 -0600 Wrapped setjmp(), sigsetjmp(), and vfork() calls to silence gcc -Wclobbered for good. Undid ca34fbd0a5204d47ad019f64ef03d21ebd3397fd, which added volatile qualifiers but was not general. Author: David Levine Date: Mon Jan 16 18:35:21 2012 -0600 Removed HAVE_STRUCT_TM_TM_GMTOFF support because it didn't work on Cygwin and isn't needed: timezone, tzname, and tzset() are all POSIX. Author: David Levine Date: Mon Jan 16 18:33:57 2012 -0600 Pass int instead of char to iscntrl() and isspace() because that's what they require, and gcc on Cygwin warns about it. Author: David Levine Date: Mon Jan 16 18:30:40 2012 -0600 Added EXEEXT support, for Cygwin. Author: David Levine Date: Mon Jan 16 09:50:10 2012 -0600 Fixed build on Cygwin by adding configure check for ncurses/termcap.h. Author: David Levine Date: Sat Jan 14 15:33:39 2012 -0600 Argument to alrmser is unused. Author: David Levine Date: Sat Jan 14 15:28:25 2012 -0600 Fixed warnings from gcc -Wclobbered by adding volatile qualifiers. Author: David Levine Date: Sat Jan 14 15:04:54 2012 -0600 Cleaned up gcc warnings when CYRUS_SASL is not enabled. Author: David Levine Date: Sat Jan 14 14:56:16 2012 -0600 Added -Wextra with gcc, if supported. Author: David Levine Date: Sat Jan 14 14:49:57 2012 -0600 Changed types and added casts so that build is clean with gcc -Wsign-compare. Author: David Levine Date: Sat Jan 14 09:21:32 2012 -0600 gcc -Wmissing-field-initializers noticed several struct initializations that didn't explicitly list all fields. Most were of no consequence because they were for static data, so they were all initialized properly. However, the two in mhlsbr.c were missing an initialization of other than their last field, and they contained some subsequent values other than zero. So, those later fields were initialized incorrectly. Also, changed the initialization of global.c_ovtxt from "" to NULL because free_queue () freed it if non-NULL, though I think the "" was always overwritten. Author: David Levine Date: Sat Jan 14 09:19:49 2012 -0600 configure.ac and aclocal.m4 instead of configure.in and acconfig.h. Author: David Levine Date: Sat Jan 14 09:16:16 2012 -0600 Documented support of OURDEFS to pass compile flags to configure. Merge: c3ed95b 3a84d81 Author: Ken Hornstein Date: Fri Jan 13 12:05:13 2012 -0500 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Author: Ken Hornstein Date: Fri Jan 13 12:04:13 2012 -0500 Add some comments to the format compiler and engine. Author: Ken Hornstein Date: Fri Jan 13 09:30:03 2012 -0500 Update README.developers with the correct version of autoconf we need. Author: David Levine Date: Thu Jan 12 22:19:24 2012 -0600 Added NMH_UNUSED macro for suppressing warnings about unused parameters with gcc -Wunused-parameter Merge: b70215d 162f2a7 Author: David Levine Date: Thu Jan 12 22:17:54 2012 -0600 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Author: David Levine Date: Thu Jan 12 22:14:59 2012 -0600 Added -Wunused-macros with gcc, if supported. Added -Wno-unused-macros, if supported, to compile of sbr/dtimep.o with gcc because it uses generated code that would be too much trouble to clean up. Author: Ken Hornstein Date: Thu Jan 12 21:07:33 2012 -0500 Create two new mh-format functions: %(putlit) and %(concataddr). %(putlit) outputs a string without any space compression or control character conversion %(concataddr) is just like %(formataddr), except that inside of repl there will not be any duplicate address supression. Author: David Levine Date: Wed Jan 11 22:38:35 2012 -0600 Enabled support for tls switch. Author: David Levine Date: Wed Jan 11 22:36:20 2012 -0600 Removed unsupported format and check switches, and commented out unused macro HMNG. Author: David Levine Date: Wed Jan 11 22:33:45 2012 -0600 Removed, or added use of, unused macros to prevent warnings from gcc -Wunused-macros. Author: David Levine Date: Wed Jan 11 17:06:44 2012 -0600 Removed or protected some unused macros. Author: David Levine Date: Wed Jan 11 16:52:17 2012 -0600 Removed unused global zones and local z form dtimezone (). Author: David Levine Date: Wed Jan 11 16:45:53 2012 -0600 Added #include . It's needed on Linux, should be harmless on others. Author: Ken Hornstein Date: Wed Jan 11 15:04:39 2012 -0500 Completely remove the use of TIME_WITH_SYS_TIME (I removed the autoconf test but never removed the code, and this caused some problems on systems that needed some prototypes in ). Author: Ken Hornstein Date: Wed Jan 11 14:52:23 2012 -0500 Ignore a.out.DSYM (this file sometims shows up when using the debugger) Author: Ken Hornstein Date: Wed Jan 11 14:48:45 2012 -0500 Fix two errors in the conversion to m_mktemp2(): - There was an off-by-one error that prevented the temporary file from being created in the same directory as the message it was being linked to. - When using "dist", the assumption was that the temporary file would not exist when m_scratch was called (it wanted to link() to the name). This was solved by simply unlink()ing the temporary file after it was created. Merge: c2191f6 a2469f5 Author: Ken Hornstein Date: Mon Jan 9 15:52:34 2012 -0500 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Author: Ken Hornstein Date: Mon Jan 9 15:51:57 2012 -0500 Remove OS-specific defines. As part of it, remove scary longjmp() inside signal handlers that was part of the code under #ifdef BSD42. Author: David Levine Date: Mon Jan 9 14:08:38 2012 -0600 Removed a remaining RETSIGTYPE. Also change a few locals from int to unsigned to prevent signed-unsigned comparison mismatch. Author: Ken Hornstein Date: Mon Jan 9 14:43:35 2012 -0500 Clean up time handling; always assume we have tzset() and that the right prototypes are in time.h (both are valid in POSIX). Author: Ken Hornstein Date: Mon Jan 9 14:07:37 2012 -0500 Garbage collect autoconf support for checking for the header file for initgroups and snprintf() prototypes. Author: Ken Hornstein Date: Mon Jan 9 13:56:30 2012 -0500 We are making POSIX signal support a requirement; remove all support for other signal interfaces. Author: Ken Hornstein Date: Mon Jan 9 13:38:02 2012 -0500 Finally able to get rid of acconfig.h! Since we're doing slightly better in the autoconf universe, rename configure.in to configure.ac, the "more correct" name for the configure script template. Author: Ken Hornstein Date: Mon Jan 9 13:26:59 2012 -0500 Switch from using RETSIGTYPE via autoconf to void, since POSIX says that's type to use for a signal handler. Author: David Levine Date: Sun Jan 8 17:58:11 2012 -0600 Removed unused bcmp, bcopy, bcpy, and bzero #defines. Author: David Levine Date: Sun Jan 8 13:46:47 2012 -0600 gcc -Wempty-body warned that the check of the result from the call to parse_mime() was ignored. It has been that way since the beginning of history and was probably of no consequence, but fixed anyway. Author: David Levine Date: Sun Jan 8 10:51:05 2012 -0600 Removed traces of bboards and bbc from mh-profile and msh man pages. Added see also of msh to packf man page. Author: David Levine Date: Sun Jan 8 10:34:31 2012 -0600 Wrapped #include of config.h with #ifdef HAVE_CONFIG_H, just in case someone ever wants to build without using configure. Author: David Levine Date: Sun Jan 8 10:27:15 2012 -0600 Removed hard-coded -I.. and -I../.. from INCLUDES, it was redundant given -I$(top_srcdir). Author: David Levine Date: Sat Jan 7 10:03:35 2012 -0600 Added Content-Description header with the filename of the attachment, with attachformats 1 and 2. This seems to be common practice now and gives mhlist something useful to display. Author: David Levine Date: Sat Jan 7 09:53:36 2012 -0600 Added note about fileproc and mhlproc mh-profile entries. Author: David Levine Date: Sat Jan 7 09:19:59 2012 -0600 Added removal of autom4te.cache directory to mostlyclean-local. Author: David Levine Date: Sat Jan 7 09:17:34 2012 -0600 Quoted argument to AC_LINK_IFELSE to silence authoheader warnings. Merge: d2e40bd 0d56141 Author: David Levine Date: Sat Jan 7 08:22:24 2012 -0600 Merge branch 'fileproc_mhlproc_to_post' Author: Ken Hornstein Date: Fri Jan 6 14:40:31 2012 -0500 Move definition of LINK to mh header file, and garbage collect ATTVIBUG code. Author: Ken Hornstein Date: Fri Jan 6 14:18:46 2012 -0500 Hardcode the defaults for Msg-Protect and Folder-Protect. Also fix the documentation (had the wrong value for the default for Msg-Protect). Author: Ken Hornstein Date: Fri Jan 6 14:12:13 2012 -0500 Huh, apparantly I got rid of any support for POPSERVICE over a year ago! Good riddance, I say. Author: Ken Hornstein Date: Fri Jan 6 10:48:03 2012 -0500 Garbage collect all of the builtin ftp client support. Author: Ken Hornstein Date: Fri Jan 6 10:37:38 2012 -0500 Garbage-collect MHRC (and make it the default). Author: Ken Hornstein Date: Fri Jan 6 10:36:21 2012 -0500 Garbage-collect SLOCAL_MBOX (and make it the default). Author: Ken Hornstein Date: Fri Jan 6 10:35:16 2012 -0500 Garbage-collect RPATHS support. Author: Ken Hornstein Date: Fri Jan 6 10:29:35 2012 -0500 Huh, turns out this define hasn't worked in forever ... the original changes were made to the lexer output, and silently vanished a decade ago when code was reorganized from zotnet to sbr! Author: Ken Hornstein Date: Fri Jan 6 10:22:44 2012 -0500 Remove last vestiges of #ifdef BANG Author: Ken Hornstein Date: Fri Jan 6 10:21:17 2012 -0500 Remove DBMPWD, make it the default. Author: David Levine Date: Fri Jan 6 08:55:39 2012 -0600 Added datarootdir definitions to silence warnings from configure. Author: David Levine Date: Thu Jan 5 21:36:51 2012 -0600 Fixed trivial compile warnings. Author: Ken Hornstein Date: Thu Jan 5 22:13:08 2012 -0500 Not sure why we're checking for st_blksize; it's required by POSIX and we're not even using the define! Author: Ken Hornstein Date: Thu Jan 5 22:08:23 2012 -0500 Switch the use of LOCKDIR in acconfig.h to --enable-lockdir. Author: David Levine Date: Thu Jan 5 21:00:58 2012 -0600 Merge branch 'master', remote-tracking branch 'origin' Author: Ken Hornstein Date: Thu Jan 5 13:39:47 2012 -0500 Garbage collect all of the old UCI #ifdef'd code. Author: Ken Hornstein Date: Thu Jan 5 12:26:48 2012 -0500 Update this with mh-e changes. Merge: 220dcd2 edc8d46 Author: David Levine Date: Thu Jan 5 11:14:56 2012 -0600 Feed fileproc and mhlproc from rcvdist, send, and whatnow to post. Author: David Levine Date: Wed Jan 4 21:05:45 2012 -0600 Feed fileproc and mhlproc from rcvdist, send, and whatnow to post. Author: Ken Hornstein Date: Thu Jan 5 12:05:43 2012 -0500 Bring in all of the mh-e support that is actually used to be compiled by default, and garbage collect the stuff that is not used. Author: David Levine Date: Wed Jan 4 21:05:45 2012 -0600 Feed fileproc and mhlproc from rcvdist, send, whatnow, and whom to post. Author: Ken Hornstein Date: Tue Jan 3 22:28:44 2012 -0500 Whoops, for right now we do need those signal function checks. Author: Ken Hornstein Date: Tue Jan 3 22:21:07 2012 -0500 Switch to standard autoconf macro for checking d_type field in struct dirent. Author: Lyndon Nerenberg Date: Mon Dec 26 09:19:35 2011 -0800 Remove #ifdef around use of sigsetjmp(). Author: Lyndon Nerenberg Date: Sun Dec 25 19:17:58 2011 -0800 Remove overrides for 'broken' stat macros. Remove redundant SEEK_* macro definitions. Author: Lyndon Nerenberg Date: Sun Dec 25 17:20:26 2011 -0800 Include for snprintf() prototype. Author: Lyndon Nerenberg Date: Sun Dec 25 12:23:41 2011 -0800 Nuke directory processing conditionals; use dirent.h. Author: Lyndon Nerenberg Date: Sun Dec 25 12:16:08 2011 -0800 Add back missing include of Author: Lyndon Nerenberg Date: Sun Dec 25 12:09:21 2011 -0800 Clean up process wait to use POSIX waitpid() interface. Author: Ken Hornstein Date: Tue Jan 3 22:01:07 2012 -0500 No longer check for the mkstemp() function in the mkstemp library. Author: Lyndon Nerenberg Date: Sun Dec 25 11:58:38 2011 -0800 Make use of mkstemp() unconditional (vs. mktemp(). This patch also removes the m_scratch() and m_tmpfil() functions. They have been deprecated for a while, and are no longer used in any of the code base. Author: Lyndon Nerenberg Date: Sun Dec 25 11:28:07 2011 -0800 Remove compatibility functions that are always provided by the POSIX host environment. Author: Ken Hornstein Date: Tue Jan 3 21:54:07 2012 -0500 Get rid of checking for vfork(), since we no longer use. Author: Lyndon Nerenberg Date: Sat Dec 24 18:18:22 2011 -0800 Replace with "h/arpa_ftp.h". Author: Lyndon Nerenberg Date: Sat Dec 24 18:17:10 2011 -0800 Import non-Posix for uip/ftpsbr.c. Author: Lyndon Nerenberg Date: Sat Dec 24 18:15:06 2011 -0800 Remove HAVE_ARPA_FTP_H and arpa/ftp.h references. Author: Ken Hornstein Date: Tue Jan 3 21:38:07 2012 -0500 Remove autoconf ospeed checks Author: Lyndon Nerenberg Date: Sat Dec 24 16:38:47 2011 -0800 Ignore OSPEED/ospeed in termcap. Nothing current should need this. Author: Ken Hornstein Date: Tue Jan 3 21:12:11 2012 -0500 No longer check for termio.h or termios.h Author: Lyndon Nerenberg Date: Sat Dec 24 16:15:22 2011 -0800 Collapse termio/termios/sgtty terminal interface code down to the Posix termios interface. Author: Ken Hornstein Date: Tue Jan 3 21:06:45 2012 -0500 Update configure file for removal of POSIX-mandated header files. Author: Lyndon Nerenberg Date: Sat Dec 24 15:40:48 2011 -0800 Eliminate '#ifdef HAVE_FOO' for Posix-mandated FOOs. Author: Ken Hornstein Date: Tue Jan 3 20:27:45 2012 -0500 No longer need to check for the existance of sys/utsname.h Author: Lyndon Nerenberg Date: Sat Dec 24 15:30:53 2011 -0800 Deprecate uname() in favour of (Posix) gethostname(). Author: Ken Hornstein Date: Tue Jan 3 20:20:26 2012 -0500 Sigh. I put the documentation about the -tls switch in the long description, but not in the command summary. Author: Ken Hornstein Date: Tue Jan 3 16:30:50 2012 -0500 Updated pending-release-notes Author: David Levine Date: Tue Jan 3 15:16:29 2012 -0600 Added note about cpio failing to unpack an nmh tarball. Author: Ken Hornstein Date: Tue Jan 3 15:17:54 2012 -0500 Switch to using buffered I/O when doing TLS (but only for output). Author: Ken Hornstein Date: Tue Jan 3 10:36:14 2012 -0500 Updated these files since we've finally got 1.4 out the door. Author: David Levine Date: Tue Dec 27 22:41:24 2011 -0600 Moved #endif so that lockit () is only declared with DOT_LOCKING, to avoid compile warning without it. Author: David Levine Date: Tue Dec 27 22:38:52 2011 -0600 Reworked nmh.spec to support rpmbuild from source RPM. Author: David Levine Date: Sun Dec 25 15:00:49 2011 -0600 Removed unused vmh.c and wmh.c. Author: David Levine Date: Sat Dec 24 20:28:50 2011 -0600 Changed second argument of calls to part_ok() and type_ok() from 0 to 1, to match what store_multi() in mhstoresbr.c does. A test case is below. Without this fix, the following command: mhshow -part 1.1 -form mhl.null produced no output. mhlist showed a part 1.1: msg part type/subtype size description 1231 multipart/mixed 276 1 multipart/related 107 1.1 text/plain 29 and "mhstore -part 1.1" properly stored it. With this fix, mhshow behaves properly and shows the part. Analogous behavior happened with -type text/plain. test case: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="NextPart_001" Content-class: urn:content-classes:message Date: Thu, 19 May 2011 00:00:00 -0000 From: sender@example.com To: recipient@example.com This is a multi-part message in MIME format. --NextPart_001 Content-Type: multipart/related; type="multipart/alternative"; boundary="NextPart_002" --NextPart_002 Content-Type: text/plain; charset="utf-8" This is the text/plain part. --NextPart_002-- --NextPart_001-- Author: David Levine Date: Sat Dec 24 19:36:32 2011 -0600 Replaced cvs with git references. I'm not sure about the cgit URL at the very end. Also removed mention of source directories that were deprecated and removed long ago. Author: David Levine Date: Sat Dec 24 09:59:45 2011 -0600 Added --with-rpmdir configure option so that user can set location of RPM build root. Author: David Levine Date: Tue Dec 13 18:33:07 2011 -0600 Added comments about source of description, etc. Author: David Levine Date: Mon Dec 12 22:50:06 2011 -0600 Replaced use of GNU make shell function with backticks. These were for the rpm target, which would most likely only be build on Linux. So they probably would have been OK, but just in case. Author: David Levine Date: Mon Dec 12 22:25:52 2011 -0600 The docs/Makefile install target didn't do anything before. Added the files that go into doc to it, and removed them from nmh.spec. nmh.spec should now require zero maintenance. Author: David Levine Date: Mon Dec 12 21:45:17 2011 -0600 Added RPM/ so that git status doesn't mention that it's an untracked file. Merge: d7f7173 bc20acd Author: David Levine Date: Mon Dec 12 21:37:47 2011 -0600 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh Author: David Levine Date: Mon Dec 12 21:35:52 2011 -0600 Moved version number from nmh.spec to Makefile.in, to minimize maintenance for nmh.spec. Author: Ken Hornstein Date: Mon Dec 12 12:59:42 2011 -0500 Make sure to not reset hghnum (in the Maildir code) if we are incorporating mail from a POP mailbox. Author: David Levine Date: Sun Dec 11 17:03:56 2011 -0600 Added first cut at nmh.spec, along with rpm: target in Makefile.in. Author: David Levine Date: Sun Dec 11 13:44:50 2011 -0600 Removed netdb.h because we no longer distribute it. Author: David Levine Date: Sun Dec 11 10:24:20 2011 -0600 Removed unused local variables to eliminate warnings from gcc 4.6.2. Author: Ken Hornstein Date: Wed Dec 7 12:00:26 2011 -0500 Make sure to ignore the nmh dist file. Author: Ken Hornstein Date: Wed Dec 7 11:36:53 2011 -0500 Since we're now moving past 1.4, bump this. Author: David Malone Date: Wed Dec 7 10:19:40 2011 -0500 Add support to inc for incorporting email from Maildir dropboxes. Add missing #include for to bring in definitions of PF_UNSPEC. Signed-off-by: Ken Hornstein Author: Ken Hornstein Date: Wed Apr 13 10:50:49 2011 -0400 Whoops, user & port were in the wrong order so msgchk didn't work for POP connections. Author: Ken Hornstein Date: Mon Feb 21 20:44:30 2011 -0500 Updated the developer README with a few notes about the git conversion. Signed-off-by: Ken Hornstein Author: Paul Vixie Date: Mon Feb 7 14:13:54 2011 -0500 Signed-off-by: Ken Hornstein More documentation about the hooks support. Author: Peter Maydell Date: Tue Dec 21 16:50:24 2010 +0000 Clean up code in inc.c Clean up the confusing use of a variable 'i' in inc.c. The case where it was being used as 'an error occurred which means we should not truncate the mailspool' is now called 'incerr' and merged with the equivalent 'p' variable used in the POP-specific code. Cases where it was being used as a random temporary are still called 'i' but now declared with a much more restricted scope. This fixes a compilation warning for some compilers. Signed-off-by: Peter Maydell Author: Peter Maydell Date: Mon Dec 20 21:13:32 2010 +0000 Suppress tsort diagnostic waffle tsort produces waffle to standard error if it detects loops in its input. For our purposes in ordering object files this is harmless, so just send it all to /dev/null. Signed-off-by: Peter Maydell Author: Peter Maydell Date: Mon Dec 20 21:13:32 2010 +0000 Fix unused-function warnings in lex output Fix the unused-function warnings in the output of lex. In particular, we silence a warning about yyunput being static but unused by exposing it as a global function. This costs us a few hundred bytes in the binary but the other available solutions are flex-specific or more complicated. YY_NO_UNPUT used to silence this but no longer works in recent flex. On the other hand YY_NO_INPUT does work to silence warnings about input(). Signed-off-by: Peter Maydell Author: Peter Maydell Date: Mon Dec 20 21:13:32 2010 +0000 Fix used-uninitialised warning in fmt_rfc2047.c Fix a used-uninitialised warning in fmt_rfc2047.c. I don't think it can actually be used uninitialised, but the code is too complicated for the compiler to realise this. Signed-off-by: Peter Maydell Author: Peter Maydell Date: Mon Dec 20 21:13:32 2010 +0000 Fix used-uninitialised warning in new.c Fix a used-uninitialised warning in new.c by having the check_folders() routine return first=last=NULL for empty folder lists. This is a more sensible API anyway. (It would not actually have been possible for the code to try to use last while it was uninitialised, as it happens.) Signed-off-by: Peter Maydell Author: Peter Maydell Date: Mon Dec 20 21:13:32 2010 +0000 Fix crash if fnext/fprev are given an empty folder list Add a check for a NULL pointer, which stops fnext/fprev from segfaulting if given an empty folder list (for example via 'fnext -folders emptyfile'). Signed-off-by: Peter Maydell Author: Peter Maydell Date: Mon Dec 20 19:54:43 2010 +0000 Fix warning in sbr/folder_addmsg.c by code cleanup Clean up some rather oddly written code in folder_addmsg() so it is easier to understand for both humans and for the compiler (and the compiler thus stops complaining about an uninitialised variable). Signed-off-by: Peter Maydell Author: Ken Hornstein Date: Thu Dec 16 13:20:31 2010 -0500 Fix so this compiles without SASL support. Damn you, Oliver Kiddle, for finding all of the bugs I add to nmh! Author: Ken Hornstein Date: Thu Dec 16 13:11:17 2010 -0500 All of the arguments to AC_ARG_ENABLE need to be quoted, otherwise the last action doesn't make it into the configure script. Author: Ken Hornstein Date: Thu Dec 16 13:02:32 2010 -0500 Make sure we ignore config.h.in~ Author: Markus Schnalke Date: Thu Dec 16 01:36:43 2010 +0100 fix typo and clarify two sentences in mhpath man page Author: Markus Schnalke Date: Thu Dec 16 01:25:11 2010 +0100 improve mhparam man page Author: Oliver Kiddle Date: Thu Dec 16 01:23:16 2010 +0100 fix badly formatted code found by Markus Schnalke Author: Scott Snyder Date: Wed Dec 15 22:17:52 2010 +0100 propagate and check return status of close() in slocal Author: Markus Schnalke Date: Wed Dec 15 22:02:30 2010 +0100 document msg parameter to folder Author: Oliver Kiddle Date: Tue Dec 14 18:04:01 2010 +0100 switches need to be renumbered following removal of some switches so, e.g. inc -version was not working Author: Ken Hornstein Date: Thu Dec 9 15:29:29 2010 -0500 Massive garbage collection. Remove functionality for APOP, RPOP, all NNTP support (including bboards) and MPOP. Author: David Levine Date: Wed Dec 8 14:36:36 2010 -0600 * uip/whatnowsbr.c: enforce requirement of at least one file argument to attach command. Author: David Levine Date: Wed Dec 8 10:47:03 2010 -0600 man/send.man: added name= portion to Content-Type headers to reflect 2006-10-24 change to uip/sendsbr.c. That change allowed mhstore to use the (file)name when extracting attachments. Author: Ken Hornstein Date: Fri Dec 3 15:23:11 2010 -0500 Remove RCS keywords, since they no longer work after git migration. Author: Ken Hornstein Date: Thu Dec 2 21:04:30 2010 -0500 Whoops, forgot to bracket the calls for TLS shutdown with a #ifdef TLS_SUPPORT Author: Ken Hornstein Date: Thu Dec 2 20:37:54 2010 -0500 Update for git conversions (and cleanup of autogen.sh to use autoreconf) Author: Ken Hornstein Date: Thu Dec 2 18:03:22 2010 -0500 Change configure.in to emit a warning when an argument is given to --with-cyrus-sasl. Author: Ken Hornstein Date: Sun Nov 21 22:19:51 2010 +0000 Fix the test for sasl.h to look in the correct place. Author: Ken Hornstein Date: Fri Nov 19 20:13:39 2010 +0000 (Minor) cleanup of some of the autoconf code with respect to the handling of compiler flags for SASL, and also rototill (and simplify) the autoconf handling for the same. Add TLS support for the SMTP MTA. Author: Peter Maydell Date: Fri Nov 12 23:28:26 2010 +0000 man/slocal.man: fix formatting error that meant a subsection heading wasn't displayed as such. Followon cleanup: since the new heading is too wide to fit in the margin, tidy the margin to 4 characters wide so we are consistent with how all the headings are displayed. Author: Peter Maydell Date: Wed Nov 10 22:26:07 2010 +0000 configure.in: add a level of expansion for mandir when printing the end-of-configure install path summary. Author: Peter Maydell Date: Tue Nov 9 21:33:22 2010 +0000 man/rmm.man: fix error in synopsis: the option is [no]unlink, not [no]link. Author: Peter Maydell Date: Fri Nov 5 22:06:10 2010 +0000 Silence a (harmless) uninitialized variable warning. Author: David Levine Date: Tue Aug 31 15:00:53 2010 +0000 * uip/.cvsignore: added "new". Author: Earl Hood Date: Sat Feb 6 07:47:38 2010 +0000 #ifdef AI_ADDRCONFIG since older IPv4-only systems may not define this flag, causing files that use to not compile. Author: Earl Hood Date: Sat Feb 6 07:45:47 2010 +0000 Fixed variable declaration so older compilers will not complain. I.e. Older compilers may not support C99, so variables must be declared at the beginning of a block. Author: Earl Hood Date: Thu Feb 4 01:39:21 2010 +0000 * Bug #15213, #18635: The use of the insecure m_scratch() and m_tmpfil() functions have been replaced by m_mktemp() or m_mktemp2() functions (defined in sbr/m_mktemp.c). The new functions use mkstemp() to securely create temporary files to avoid the numerous race conditions that exist with the old functions. This does assume that mkstemp() is available. Unsure if we need to create an alternative implementation if mkstemp() is not available. More information about new temp file functions in m_mktemp.c, including the support for MHTMPDIR, TMPDIR, and TMP envvars. NOTE: The files sbr/m_scratch.c and sbr/m_tmpfil.c should be removed. Until more testing verifies changes to support new functions have not broken functionality, the files are be left in the tree, but comments have been added stating the functions in them should not be called. Author: Earl Hood Date: Wed Feb 3 05:56:56 2010 +0000 * mts/smtp/smtp.c: added SASL support if mts configuration setting is set to "sendmail". This is useful if sendmail conf option is to a custom script that creates a proxy connection to an smtp server. * sbr/mts.c: added support for MHMTSCONF and MHMTSUSERCONF envvars. The former specifies an alternative system mts.conf to use. The later specifies a user-specific mts.conf to use. This one will be read after the system conf, so the user's conf only needs to set options they want to override. The MHMTSUSERCONF allows a user to set personal alternative mail submission methods w/o affecting other users on the system. * uip/whom.c: added SASL-based options so address checking can work against a server that requires SASL. Author: David Levine Date: Wed Dec 30 01:42:45 2009 +0000 * uip/mhlistsbr.c, uip/mhlsbr.c, uip/picksbr.c: cast pointers to unsigned long before casting to unsigned int to avoid warnings on 64-bit about casting from pointer to int of different size. Author: David Levine Date: Wed Dec 30 01:41:47 2009 +0000 * uip/new.c: cast folder_len to int to avoid warning on 64-bit about passing a size_t to an int conversion specifier. Author: David Levine Date: Fri Dec 25 14:47:39 2009 +0000 * uip/inc.c: gcc 4.4.1 noticed that maildir could have been used before initialization. In fact, if that code was ever reached, maildir would never have been initialized. It's in an adios call, so replaced with NULL. Author: David Levine Date: Mon Dec 21 17:18:04 2009 +0000 * mts/smtp/smtp.c: In sm_auth_sasl (), removed zeroing of sasl_inbuffer because it could be used in sm_fget (). Also, removed allocation of sasl_inbuffer because that was done in either smtp_init () or sendmail_init (). Author: Josh Bressers Date: Mon Jan 26 13:38:13 2009 +0000 Remove duplicate sm_fgetc() declaration Author: Ken Hornstein Date: Wed Jan 21 19:38:36 2009 +0000 Fix warning in getaddrinfo() call. Add missing support for -port in whatnow. Make sure the SASL input buffer is allocated when using the sendmail mts. Author: Eric Gillespie Date: Sun Jan 18 04:48:42 2009 +0000 * etc/mhn.defaults.sh: Never try to make mhshow start xterm. Author: Eric Gillespie Date: Sat Jan 17 16:53:07 2009 +0000 Note 'new' commands. Author: Eric Gillespie Date: Sat Jan 17 16:47:29 2009 +0000 * test/runtest, test/tests/inc/test-deb359167, test/tests/inc/test-eom-align, test/tests/manpages/test-manpages: Load common.sh via absolute path, otherwise some /bin/sh (e.g. dash) can't load it. * uip/Makefile.in, uip/new.c, test/tests/new/test-basic: Add new program, and fn/fp/unseen symlinks. * test/{runtest,setup-test}: Move MH profile under Mail directory so each test script will have its own to muck with, if needed. * h/Makefile.in, h/crawl_folders.h, sbr/Makefile.in, sbr/crawl_folders.c, uip/folder.c: Extract the folder crawling code from folder.c into new crawl_folders function, using a callback to assemble the folder info in folder.c. Drop compare function and use strcmp instead. Rename addfold and addir to add_folder and add_children (add dir vs. add folder? confusing names). Author: Ken Hornstein Date: Fri Jan 16 15:48:09 2009 +0000 Move freeaddrinfo() to inside of our loop; this prevents a memory leak and also prevents it from being called with a NULL pointer. Author: Ken Hornstein Date: Fri Jan 16 02:28:54 2009 +0000 Massive overhaul of networking code. Changes: - All networking interfaces now converted to new APIs (getaddrinfo() and the like). All networking now supports IPv6 (with the exception of the built-in FTP client). - SASL security layers are now supported for SMTP. - Command-line and profile-based selection of the SMTP server and port. Author: Peter Maydell Date: Fri Dec 26 21:54:19 2008 +0000 * sbr/m_getfld.c: fix two bugs which could cause us to walk off the beginning of the stdio or prefix-string buffer when checking for presence of the end-of-message delimiter in some situations. This might cause inc to dump core if you were unlucky. (This was Debian bug 359167.) * test/tests/inc/{md5sums,msgheader.txt,test-deb359167, test-eom-align,fromline.txt,filler.txt,deb359167.mbox}: new tests both for the specific problem and to try to check various alignments of the eom string with the stdio buffer ending. * test/common.sh: Added some functions for doing progress indicators. Author: Peter Maydell Date: Fri Dec 26 16:32:07 2008 +0000 test/common.sh: new file for common utility functions for the test scripts. Moved findprog out of manpage test script into this new file. Author: Peter Maydell Date: Thu Dec 25 23:30:33 2008 +0000 test/runtest: automatically run setup-test if it hasn't already been done. Improve error handling in test script with 'set -e'. Author: David Levine Date: Thu Oct 23 18:38:22 2008 +0000 * h/mh.h: raised NAMESZ from 128 to 999. RFC 2822 limits line lengths to 998 characters, so a header name can be at most that long. m_getfld limits header names to 2 less than NAMESZ, which is fine, because header names must be followed by a colon. Add one for terminating NULL. Author: David Levine Date: Thu Oct 23 18:14:52 2008 +0000 * sbr/m_getfld.c: in warning message, use NAMESZ-2 instead of NAMESZ-1 bytes because the message says "exceeds", not "is greater than or equal to". Author: David Levine Date: Thu Oct 23 16:45:36 2008 +0000 * docs/MAIL.FILTERING: added note on removing procmail -f or -r options to try to suppress generation of a "From " line on incoming messages. Author: Eric Gillespie Date: Tue Aug 19 04:36:42 2008 +0000 +mhn.defaults.sh.cfg Author: Eric Gillespie Date: Thu Aug 14 19:47:29 2008 +0000 * test/setup-test: Don't run autogen.sh unless needed. Build in a blddir under the temporary directory so as not to interfere with whatever the developer may be doing in the source directory. If the temporary directory already exists, rebuild and install it. Author: Eric Gillespie Date: Thu Aug 14 06:19:08 2008 +0000 This is what happens with last-minute "safe" improvements: actually point chset to something in the new merged InitText! Author: Eric Gillespie Date: Thu Aug 14 01:50:45 2008 +0000 * sbr/ambigsw.c: Send print_sw output to stderr. This avoids strange problems with scan `pick -bogus`, not to mention being nicer anyway. * sbr/getans.c, sbr/print_help.c, uip/msh.c: Send print_sw output to stdout. * h/prototypes.h, sbr/print_sw.c (print_sw): Add FILE * argument and send output there rather than to stdout. * test/tests/pick/test-stderr: Add test that error messages don't end up going to stdout. Author: Eric Gillespie Date: Thu Aug 14 01:31:11 2008 +0000 * uip/pick.c: Ensure valid sequence name as soon as we parse it from command, instead of searching the messages first. Author: Eric Gillespie Date: Thu Aug 14 01:28:56 2008 +0000 * uip/pick.c: Print matching messages immediately, instead of waiting until the very end to print anything. Author: Eric Gillespie Date: Thu Aug 14 01:11:12 2008 +0000 * uip/Makefile.in, uip/popi.c: Remove popi.c, which has been dead since PatchSet 257 (2000/06/12 11:07:34 UTC). Author: Eric Gillespie Date: Thu Aug 14 00:56:38 2008 +0000 * h/mhparse.h: Move interfaces also used by mhbuildsbr.c here from mhparse.c. * uip/Makefile.in (mhbuild): Build with mhparse.o. * uip/mhbuildsbr.c: Drop the duplication of mhparse.c. * uip/mhbuild.c, uip/mhlist.c, uip/mhn.c, uip/mhshow.c, uip/mhstore.c, uip/mhtest.c: Drop check swdeclaration, which is now in mhparse.h. * uip/mhparse.c: Move some declarations to mhparse.h, and remove 'static' from the definitions here. (get_ctinfo): Take magic mhbuild support from mhbuildsbr.c's copy, and adapt callers. (incl_name_value, extract_name_value): Move from mhbuildsbr.c to support get_ctinfo change). (get_content, open7Bit): Add Content-Disposition support, added to mhbuildsbr.c's copy in mhbuildsbr.c r1.12 (PatchSet 549). (InitText): Default to CHARSET_UNSPECIFIED instead of "US-ASCII", as mhbuildsbr.c's copy did. Explain termproc. (openBase64, openQuoted, open7Bit): Fix comment from r1.5: suffixes, not prefixes. (openMail): Explain showproc. * test/tests/mhshow/test-cte-binary: Add test for Content-Transfer-Encoding: binary (Debian #136976). * test/tests/mhbuild/test-forw: Add an mhbuild test, testing forw with and without RFC-934 mode. More mhbuild tests would be nice. Author: Eric Gillespie Date: Wed Aug 13 23:59:56 2008 +0000 Oops, meant to use $failed (number of failed checks) as the exit code. Author: Eric Gillespie Date: Wed Aug 13 23:32:03 2008 +0000 Add descriptive headers, as other tests have. Author: Eric Gillespie Date: Wed Aug 13 18:27:36 2008 +0000 * test/tests/bad-input/test-header: Add test for it. * sbr/m_getfld.c: If we reach the end of the line without finding a ':' when parsing a header field, treat that line as the beginning of the body rather than blowing up. These messages are usually spam, but it's nice to be able to at least scan them. Author: Eric Gillespie Date: Wed Aug 13 01:01:12 2008 +0000 * test/tests/mhshow/test-qp: Test various valid and invalid escape sequences. * uip/mhparse.c (openQuoted): Simplify the decode-or-show for loop by peeking ahead to the next byte(s) when encountering '=', and just let invalid escape sequences through as literals (fixes bug #15245). Author: Eric Gillespie Date: Wed Aug 13 01:00:20 2008 +0000 Ignore test-temp-dir. Author: Paul Fox Date: Tue Aug 12 21:01:30 2008 +0000 add one more hint for developers, to explicitly point at docs/README.developers Author: Peter Maydell Date: Tue Aug 12 18:04:29 2008 +0000 autogen.sh (new file): add script for running the GNU autotools in the right order. Mention and use new script in the appropriate places. Author: Eric Gillespie Date: Fri Aug 8 23:45:24 2008 +0000 * sbr/discard.c, sbr/m_getfld.c, uip/scansbr.c: Add support for DragonFlyBSD stdio (from NetBSD pkgsrc). Author: Eric Gillespie Date: Fri Aug 8 04:45:05 2008 +0000 s/ls/cd/ in comment (probably pasted from test-ls) Author: Peter Maydell Date: Tue Aug 5 21:06:00 2008 +0000 uip/folder.c: chdir(nmhdir) in main rather than in dodir, which is called many times. Drop the chdir in get_folder_info, which served no purpose at all. If struct stat has d_type (BSD), use that to skip processing (strcmp, stat, and so on) of message files, mostly undoing the slow-down from the last change. Plus autoconf machinery to detect d_type field. Patch from Eric Gillespie. Author: Peter Maydell Date: Tue Aug 5 19:09:03 2008 +0000 Dump hacky overoptimisation in addir -- it doesn't actually get the case of symlinks to directories right. Patch from Eric Gillespie. Author: Peter Maydell Date: Tue Aug 5 19:05:23 2008 +0000 Simplify dodir/addir/addfold (patch from Eric Gillespie) Author: Peter Maydell Date: Sun Aug 3 18:47:56 2008 +0000 bug #23319: rework the way we handle the working directory when invoking the user's shell, so that we don't have issues when the cwd contains a space or shell special character. Author: Peter Maydell Date: Sun Aug 3 18:45:34 2008 +0000 test/setup-test: use 'set -e' so we stop on compile failure. Configure --enable-debug for convenience in debugging. Author: Peter Maydell Date: Sun Aug 3 15:19:53 2008 +0000 Add protective 'do { ... } while (0)' wrappers to multistatement macros Author: Peter Maydell Date: Sun Aug 3 15:14:23 2008 +0000 Bug #23436: fix some minor manpage syntax errors and add a test which runs groff over them and checks that no warnings are emitted. Author: Peter Maydell Date: Sun Aug 3 15:13:34 2008 +0000 Allow tests to indicate that they have been skipped by printing their own message and returning with exit status 120. Author: Peter Maydell Date: Sun Aug 3 13:59:19 2008 +0000 Ignore editor backup files Author: Peter Maydell Date: Sun Aug 3 13:54:37 2008 +0000 etc/replcomps, etc/replgroupcomps: Trim trailing whitespace from Subject field (patch from Eric Gillespie) Author: Peter Maydell Date: Sun Aug 3 13:32:17 2008 +0000 When doing an if-test on the result of a function which returns a string result, check whether the string is non-empty (as the documentation says we do). Previously we were always testing the integer 'value'. Author: Josh Bressers Date: Fri Jul 25 01:07:39 2008 +0000 * test/setup-test: Run 'make clean' before building Author: Josh Bressers Date: Fri Jul 25 00:11:53 2008 +0000 * test/runtest: cat test-temp-dir only once. Destroy and create test Mail hierarchy here, so each test has its own independent test data. * test/setup-test: Drop needless pushd/popd, which don't exist in sh anyway. Don't use aclocal, which is part of automake. Don't create Mail hierarchy here (see test/runtest). * test/tests/folder/test-create, tests/folder/test-total: Drop unused BINDIR. * tests/pick/test-pick: Remove failing no-op test. * test/tests/scan/test-scan: Write expected and actual output to files and diff them. This way, if the output differs, diff provides the FAILing exit code and shows the differences. Author: Josh Bressers Date: Fri Jun 13 00:11:49 2008 +0000 * man/repl.man, etc/mhl.reply: Add an attribution line when replying to messages. Author: Josh Bressers Date: Thu Jun 12 23:29:16 2008 +0000 Remove an accidentally committed file Author: Peter Maydell Date: Mon Jun 2 22:37:01 2008 +0000 When building on gcc, use noreturn attribute on adios and the various done functions. Author: Peter Maydell Date: Mon Jun 2 22:05:11 2008 +0000 Back out previous, completely broken, change (due to a foulup I was compiling a different tree to the one I was committing to CVS). Author: Peter Maydell Date: Mon Jun 2 21:49:07 2008 +0000 If we're compiling with gcc, mark adios() as never returning (better code and fewer spurious 'uninitialized variable) warnings) Author: Peter Maydell Date: Sun Jun 1 16:50:22 2008 +0000 Update bit of docs about release announcements. Author: Peter Maydell Date: Thu May 22 10:37:55 2008 +0000 Don't use MB_CUR_MAX if we aren't compiled with multibyte support. Author: Peter Maydell Date: Thu May 22 10:21:48 2008 +0000 Factor out common code for writing ls shell command. Rework its length checking so it doesn't rely on the return value of sprintf(), for the benefit of SunOS 4. Author: Peter Maydell Date: Wed May 21 18:05:49 2008 +0000 Don't rely on realloc() to follow POSIX in handling a NULL pointer Author: Peter Maydell Date: Wed May 21 17:16:44 2008 +0000 Add some table size declarations for the benefit of elderly lexes with small defaults (eg SunOS 4) Author: Peter Maydell Date: Tue May 20 19:04:57 2008 +0000 Update comment now we don't use lex -o. Author: David Levine Date: Sun May 18 13:56:58 2008 +0000 * sbr/addrsbr.c: removed "err" from conditional, because gcc correctly warned that it would always evaluate as true. It's the address of a static array. Author: Oliver Kiddle Date: Fri May 16 15:31:26 2008 +0000 don't use $< in target rules in makefiles, as POSIX says it's only defined in inference rules Author: David Levine Date: Tue May 13 02:39:04 2008 +0000 * configure.in, INSTALL: if --enable-masquerade is not specified to configure, enable all supported masquerade forms. This allows users to masquerade with the default configuration. That seems to be more worthwhile now than trying to prevent users from using it, especially with single-user installations or those where a user can edit etc/mts.conf. Author: Peter Maydell Date: Sun May 4 20:58:35 2008 +0000 bug #23167: sbr/ruserpass.c (ruserpass): make bad permissions on .netrc be an instantly fatal error. Previously we returned an error value; however, no caller was checking it. So now ruserpass() has a void return type. Author: Peter Maydell Date: Sun May 4 16:09:08 2008 +0000 * bug #23163: various minor fixes for the benefit of older Unixes (specifically SunOS 4): reintroduce strerror() substitute implementation; provide memmove() substitute implementation * bug #23163: fix broken 'build outside source directory' feature * bug #23162: sbr/dtime.c: fix stray HAVE_TM_GMTOFF that wasn't updated to the new macro name. Author: Peter Maydell Date: Wed Apr 30 18:47:02 2008 +0000 Provide SASL_CB_AUTHNAME callback (avoids problem with wrong username being sent in some situations) Author: Peter Maydell Date: Tue Apr 29 21:05:30 2008 +0000 Correct various places in smtp.c where the reply string might not have been correctly NUL-terminated. Includes a fix for a particularly nasty and long standing screwup where the buffer length counting in smhear() was totally broken for continued lines from the server. Author: Peter Maydell Date: Tue Apr 29 20:59:04 2008 +0000 Fix SASL issue properly, by making sm_rrecord() and thus sm_hear() set the length of the reply string correctly (the SASL libraries now care if you pass in the wrong length). Author: Peter Maydell Date: Tue Apr 29 20:53:33 2008 +0000 Revert previous SASL fix (wrong approach) Author: Peter Maydell Date: Tue Apr 29 17:04:38 2008 +0000 Cope with sasl_decode64() returning SASL_CONTINUE as well as SASL_OK. Author: Peter Maydell Date: Mon Apr 28 21:13:53 2008 +0000 Add remark about how to update the homepage. Author: Peter Maydell Date: Sun Apr 27 20:58:50 2008 +0000 Update some of the 'how to do a release' documentation Author: Peter Maydell Date: Sun Apr 27 20:55:28 2008 +0000 Up version string to 1.3-dev for the CVS trunk. Author: Peter Maydell Date: Sun Apr 27 19:54:37 2008 +0000 Use hyphen, not plus (corresponding to previous RCx naming convention) Author: Peter Maydell Date: Sun Apr 27 19:44:58 2008 +0000 Bump version number, date for release of 1.3 RC1 Author: Oliver Kiddle Date: Fri Apr 11 14:12:54 2008 +0000 move most remaining macros out of acconfig.h which is an obsolete feature of autoconf Author: Peter Maydell Date: Sat Apr 5 19:04:41 2008 +0000 * bug #18655: fix use of admonish() for a fatal error (should be adios(); only actual effect would be wrong exit code). Thanks to Craig Leres for spotting this. Author: Peter Maydell Date: Sat Apr 5 18:41:37 2008 +0000 Bug #20028 (Debian bug 399271): fix code assuming that pointer differences were 32 bits -- thanks to Dean Gaudet for the patch. Author: Josh Bressers Date: Fri Jan 25 21:00:42 2008 +0000 * uip/mhshowsbr.c (show_all_messages): Be more generous when parsing multipart messages. Author: Joel Reicher Date: Thu Nov 8 02:28:38 2007 +0000 Insert types for args of some function pointers to improve type checking. Author: Joel Reicher Date: Sun Nov 4 11:54:32 2007 +0000 Return type of (*done)() changed to void. default_done() replaced by exit(). All dead code "return 1" lines removed from *_done()s and replaced by explicit "return 1" following done() calls in main()s (they should never be reached). This should make cleaning up program termination structures easier. Author: Joel Reicher Date: Sun Nov 4 08:52:17 2007 +0000 Refactor cts pointer and free()ing on abnormal exit of associated list into mhfree.c, eliminating duplication. Author: Joel Reicher Date: Sun Nov 4 04:47:17 2007 +0000 Change link-time overriding of done() to run-time reassigning of equivalent (*done)(). This should make changing the return type of done and the rationalisation of exit code easier. Author: Bill Wohler Date: Mon Sep 24 07:02:03 2007 +0000 The MH web site is now http://rand-mh.sourceforge.net/ and the MH book is now at http://rand-mh.sourceforge.net/book/. Changed Questions 1.02 ...current version? mailutils 1.2 1.03 Where can I get MH? Debian 4.0 nmh 1.1-RC4, update links, mu 1.2 1.04 ...references for MH? Refer to SourceForge 1.06 How...print a MH manual? Refer to SourceForge 2.17 How...build MH on a Mac? Use fink 4.05 ...tools to archive MH? Mention swish++, mairix, and namazu Author: Josh Bressers Date: Tue Aug 21 21:19:39 2007 +0000 * Red Hat Bug #253342: inc.c, utils.c, utils.h: When inc is run with the -silent flag, don't exit(1) for no apparent reason. Author: Peter Maydell Date: Sun Apr 29 22:57:36 2007 +0000 Rename functions to avoid clash with C library exp2(). Author: Peter Maydell Date: Sun Apr 29 22:34:04 2007 +0000 Suppress 'uninitialised variable' warning. Author: Peter Maydell Date: Sun Apr 29 22:05:02 2007 +0000 On Linux, define _GNU_SOURCE so that GNU libc exposes the wcwidth() prototype in wchar.h. Author: Peter Maydell Date: Sun Apr 29 22:01:04 2007 +0000 Change name of internal function to avoid potential conflicts with GNU libc's getline() function. Author: Peter Maydell Date: Sun Apr 29 20:49:32 2007 +0000 Minor rearrangement so variables/functions used only if !HAVE_LIBLOCKFILE are also declared only in that case. Author: Peter Maydell Date: Sun Apr 29 19:36:14 2007 +0000 For gcc, make the default CFLAGS include -Wno-pointer-sign if the compiler recognises it. gcc 4 now by default produces a large volume of these warnings, which I believe are probably spurious and definitely a lot of work to go through and fix. So we suppress them for now so that the other warnings are more easily visible. Author: Joel Reicher Date: Tue Apr 17 04:53:54 2007 +0000 buffer is compared with cp, and so needs to be changed to unsigned too. Author: Josh Bressers Date: Tue Apr 17 01:02:08 2007 +0000 Initial checkin of a testsuite Author: Joel Reicher Date: Fri Apr 13 11:53:08 2007 +0000 Change all chars being passed to the ctype macros (isalph(), etc.) to be unsigned chars, following through to change any other types as necessary (e.g. comparison between two pointers). Not all chars have been changed to unsigned chars; just those that were in danger of being sign extended when passed to the int-taking ctype macros. Author: Joel Reicher Date: Tue Apr 10 22:12:26 2007 +0000 We're not using the .Bu macro anymore. Author: Joel Reicher Date: Tue Apr 10 06:13:27 2007 +0000 Fix for bug #11139: mhl -form mhl.reply omits '> ' on some lines. putcomp() was assuming only the first call on the body had the buffer beginning at the start of a line. Author: Joel Reicher Date: Tue Apr 10 03:32:48 2007 +0000 Application of patch #5218: patch for bug #9742. Fixes a typo in the size arg of snprintf(). mhlist output which used to have incorrect lines such as 1.2 multipart/mixed 772 1.21 text/plain 9 1.22 multipart/mixed 162 now have the correct 1.2 multipart/mixed 772 1.2.1 text/plain 9 1.2.2 multipart/mixed 162 Author: Peter Maydell Date: Wed Mar 21 00:21:10 2007 +0000 bug #18630, #18631, #18632, #18634: various patches from Craig Leres fixing error message argument problems. Author: Peter Maydell Date: Wed Mar 21 00:18:19 2007 +0000 bug #15212: remove configure test for broken AT&T vi. This test was broken and unfixable. Support for manually defining ATTVIBUG remains. Author: Josh Bressers Date: Tue Jan 16 02:08:10 2007 +0000 Add a missing header file Author: Joel Reicher Date: Sun Nov 5 13:20:46 2006 +0000 Changed bold "-all" to unbolded "all". It's a reserved msgs word, not a flag. Author: David Levine Date: Tue Oct 24 14:31:40 2006 +0000 * uip/sendsbr.c: with attachformat values of 1 or 2, add name= portion to Content-Type header. This makes them consistent with attachformat value 0. And it allows mhstore to use that (file)name when extracting attachments. Author: Josh Bressers Date: Sun Aug 27 01:19:39 2006 +0000 * configure.in: If we're not using dotlocking, there is no need to set inc sgid. Author: Joel Reicher Date: Sun Jun 4 08:37:24 2006 +0000 Fixed bug introduced when changing from check_folder() to new create_folder() function. The folder name needed to be expanded to an absolute path first. Similar things may have happened with other conversions. Author: Joel Reicher Date: Thu Apr 27 12:00:28 2006 +0000 Created pluspath function to check for '+' prefix and change flag for path() appropriately. This eliminates some duplicate prefix processing, but not all. The path functions need to be restructed; this is the first step. Author: Joel Reicher Date: Mon Apr 24 07:10:03 2006 +0000 ssequal() does not check for a substring, but for a prefix, so added a comment to this effect. If this is sufficient, the function body should remain unchanged but the name and comments should be modified. If not, then the function needs to be corrected. Author: Paul Fox Date: Sat Apr 22 16:33:48 2006 +0000 fixes case where a very long character-class range (128 or more characters) causes negative indexing into pattern string. Author: Joel Reicher Date: Sun Apr 16 06:47:59 2006 +0000 Fixed a typo. Author: Joel Reicher Date: Fri Apr 14 14:10:15 2006 +0000 Created function open_form() to open form file or fallback to default components file, with error handling. Replaced duplicated code with call to this function. Author: Joel Reicher Date: Fri Apr 14 08:42:04 2006 +0000 Fixed a couple of typos. Author: Joel Reicher Date: Fri Apr 14 08:21:35 2006 +0000 Sanitised some dodgy homedir finding code, but it still might not make sense. Author: Joel Reicher Date: Fri Apr 14 07:54:26 2006 +0000 Get rid of some trivial warnings; unused variables, ambiguous if-else, missing headers. Author: Joel Reicher Date: Thu Apr 13 14:24:41 2006 +0000 Make print_aka() and print_usr() static. They're not used outside ali.c. Author: Joel Reicher Date: Tue Apr 11 14:09:11 2006 +0000 Created app_msgarg() (append message arg) and a simple resizable array struct to go with it that do almost exactly what the code they've replaced was doing. Replaced this (duplicated) code in many files with a call to app_msgarg(). Author: Joel Reicher Date: Tue Apr 11 05:48:43 2006 +0000 Completing the .cvsignore list(s). Author: Joel Reicher Date: Sun Apr 9 14:06:31 2006 +0000 Fixed a small typo. Author: Paul Fox Date: Fri Mar 31 15:14:49 2006 +0000 this commit: - adds range support to character classes - fixes out-of-bounds references to the case-folding array when doing case comparisons for 8-bit message text - makes character classes as case tolerant as the rest of the pick regexp machine. (where lowercase chars in patterns should match uppercase in the text.) - fixes an uninitialized pointer warning, which might actually have been a real bug Author: David Levine Date: Thu Mar 30 22:19:50 2006 +0000 * uip/sendsbr.c: with attachformat values of 1 or 2, only generate Content-Disposition headers for MIME attachments, not for the message contents themselves. Microsoft Outlook Build 10.0.6626, at least, doesn't show the message contents if they have Content-Disposition. Author: Bill Wohler Date: Fri Mar 10 09:00:20 2006 +0000 Changed Questions 1.03 Where can I get MH? nmh 1.2 Author: Bill Wohler Date: Fri Mar 10 06:58:28 2006 +0000 Since faqs.org appears to be moribund, I'm now using my site as the official location of the MH FAQ. I added some missing quotes in various places, so now Emacs highlighting works better. New Questions 5.26 How do I fix a bogus In-Reply-To or missing References field? Changed Questions 1.02 current version? nmh 1.2 1.04 references for MH? New FAQ official site. MH-E manual URL 5.15 make sense of replcomps? Use 1.1 version Author: Josh Bressers Date: Thu Mar 9 19:51:13 2006 +0000 * sbr/fmt_rfc2047.c (decode_rfc2047): Don't close the iconv descriptor if it isn't valid. Author: Josh Bressers Date: Wed Mar 8 12:14:15 2006 +0000 * (mh_strcasecmp): Rename the private strcasecmp function to mh_strcasecmp. Author: Oliver Kiddle Date: Sun Mar 5 14:48:05 2006 +0000 and close iconv handle if encoded block empty Author: Oliver Kiddle Date: Sun Mar 5 14:38:23 2006 +0000 don't try to malloc 0 bytes if an RFC2047 encoded block is empty Author: Peter Maydell Date: Sat Mar 4 22:14:18 2006 +0000 Install scripts with INSTALL_SCRIPT so INSTALL_PROGRAM can be set to 'install -s' without it causing the installation of the scripts to fail. Author: David Levine Date: Sat Feb 25 14:14:06 2006 +0000 * uip/sendsbr.c: replaced st_mtim with st_mtime, that's what it should have been. Added #include of h/tws.h to pick up dtime() prototype. Author: David Levine Date: Tue Feb 21 04:13:06 2006 +0000 Replaced second line of Content-Tyhpe of -attachformat 0 example. Author: David Levine Date: Tue Feb 21 03:58:31 2006 +0000 * h/mh.h, h/prototypes.h, uip/mhbuildsbr.c, uip/send.c, uip/sendsbr.c, uip/viamail.c, uip/whatnowsbr.c, man/send.man: added -attachformat switch to send, to support alternate MIME header contents when using -attach. See send man page for description. Author: David Levine Date: Tue Feb 21 03:51:53 2006 +0000 * man/mhbuild.man: wrapped one appearance of "Content-Disposition" with quotes, to be consistent with others. Author: Josh Bressers Date: Tue Feb 21 01:11:51 2006 +0000 * h/utils.h, sbr/utils.c, uip/flist.c, uip/folder.c: Move duplicate function num_digits into utils.c Author: Josh Bressers Date: Tue Feb 21 01:05:24 2006 +0000 Add missing create_folder prototype. Author: Josh Bressers Date: Mon Feb 20 03:09:07 2006 +0000 * sbr/m_draft.c, sbr/utils.c, uip/folder.c, uip/inc.c, uip/mhstoresbr.c, uip/popi.c, uip/refile.c: Add create_folder() function, replacing duplicate code during folder creation. Author: David Levine Date: Sat Feb 18 16:26:37 2006 +0000 Added support for optional Content_Disposition header in mhbuild directive.s Author: David Levine Date: Sun Feb 12 18:06:44 2006 +0000 Added RFC2183 to reference of RFC1806 for Content-Disposition header. Author: David Levine Date: Tue Jan 31 02:50:57 2006 +0000 Added -nocontentid (and -contentid, for symmetry) switch to mhbuild. This allows users to disable generation of the Content-ID: header in MIME messages, in order to placate broken version(s) of Outlook. Author: Oliver Kiddle Date: Sun Jan 29 19:34:42 2006 +0000 remove trailing newlines from components to fix bug with spaces at the end of Subject/References in replies Author: Oliver Kiddle Date: Wed Jan 18 18:08:16 2006 +0000 use AS_HELP_STRING for formatting help messages Author: Oliver Kiddle Date: Wed Jan 18 17:07:28 2006 +0000 add autoconf magic to support old systems that don't support multibyte charsets Author: Oliver Kiddle Date: Wed Jan 18 16:43:27 2006 +0000 fix bug with insertion of newline being wrong if the num function was used at the end of the format buffer Author: David Levine Date: Wed Jan 18 00:09:00 2006 +0000 Fixed make_bcc_file () to use contents of From: in draft, if draft_from masquerade flag is enabled. Author: Oliver Kiddle Date: Tue Jan 17 18:06:58 2006 +0000 more robust multi-byte/column support for field widths restore right justification feature Author: Josh Bressers Date: Mon Jan 16 17:07:14 2006 +0000 * uip/post.c, uip/spost.c: Move the uptolow macro from spost.c to post.c where it is needed. Author: Josh Bressers Date: Mon Jan 16 12:42:11 2006 +0000 * sbr/fmt_scan.c: Add the missing wchar.h include Author: Oliver Kiddle Date: Mon Jan 16 10:40:32 2006 +0000 *** empty log message *** Author: Oliver Kiddle Date: Mon Jan 16 10:00:46 2006 +0000 remove remnants of code for MMDF Author: Oliver Kiddle Date: Mon Jan 16 09:55:24 2006 +0000 multiply buffer size by MB_CUR_MAX so multi-byte chars fit Author: Josh Bressers Date: Sun Jan 15 02:52:12 2006 +0000 * sbr/fmt_scan.c:PUTSF() Fix an off by one formatting issue. Author: Josh Bressers Date: Sun Jan 15 02:29:38 2006 +0000 * sbr/fmt_scan.c: Turn the PUTSF macro into a function capable of handling multi column characters. Author: Josh Bressers Date: Sat Jan 7 15:22:19 2006 +0000 * Remove sbr/strerror.c -- strerror(3) is defined in C89. Author: Josh Bressers Date: Fri Jan 6 21:51:43 2006 +0000 * patch #3968: Move the add() function from its own file (add.c) and into utils.c. There was also a duplicate add() function in mf.c which has been removed. Author: Josh Bressers Date: Wed Jan 4 02:10:25 2006 +0000 * mh_xmalloc(), mh_xrealloc(), pwd(): Add comments describing the purpose of the function. Author: Josh Bressers Date: Tue Jan 3 01:08:33 2006 +0000 Remove sbr/pwd.c file, moving the pwd() function into sbr/utils.c. Author: Josh Bressers Date: Mon Jan 2 03:25:18 2006 +0000 * patch #3967: Create a mh_xrealloc function to prevent mistakes when calling realloc. Author: Josh Bressers Date: Mon Jan 2 03:17:41 2006 +0000 * patch #3966: Create a mh_xmalloc function to prevent mistakes when calling malloc. Author: Peter Maydell Date: Sat Dec 24 17:53:26 2005 +0000 Avoid non-portable use of $< outside an inference rule. Author: Peter Maydell Date: Sat Dec 24 17:17:38 2005 +0000 Rework detection and handling of ndbm: we now check for a working (library,header) combination, and configure defines variables for each which the makefile and C file just use, rather than a bunch of HAVE_foo switches. As a bonus, we no longer unnecessarily link every binary with the ndbm library even though only slocal uses it. Also you can now tell configure where to get the header/library so even if we guess wrong you can overrule us. Author: Peter Maydell Date: Thu Dec 22 10:38:32 2005 +0000 Fix stupid accidental dependence on a bash quirk in previous configure script change. Author: Jon Steinhart Date: Tue Dec 20 04:39:51 2005 +0000 Rolled release. Author: Peter Maydell Date: Thu Dec 15 00:45:36 2005 +0000 Improve the checks for where to find ndbm (dbm_open etc); should now work on systems with new gdbm and libdb4. Author: Peter Maydell Date: Thu Dec 15 00:12:52 2005 +0000 Change some non-standard formatting in a previous log entry so it matches the conventions used in other entries. Author: Josh Bressers Date: Wed Dec 14 01:48:24 2005 +0000 * Fedora Bug #163760: sbr/context_read.c (context_read): Ensure that the context is only read once. Author: Jon Steinhart Date: Mon Dec 12 22:30:44 2005 +0000 Fixed annotate call for new delete argument values. Author: Josh Bressers Date: Mon Dec 12 20:26:53 2005 +0000 * uip/sendsbr.c (annoaux): Fix the call to annotate() Author: Jon Steinhart Date: Thu Dec 8 15:57:34 2005 +0000 *** empty log message *** Author: Jon Steinhart Date: Wed Dec 7 21:25:46 2005 +0000 Fixed a bug where anno -append put the headers in the wrong place if applied to a message that didn't contain any headers. Added a special value of "all" to the -number option that causes anno -delete to delete all matching components instead of just the first one. Added new -preserve and -nopreserve options. Using -preserve retains the original last accessed and last modified times on annotated messages. Author: Josh Bressers Date: Mon Dec 5 13:38:41 2005 +0000 Fix the AC_PATH_PROG default when vi isn't found during build. Author: Jon Steinhart Date: Sat Dec 3 23:41:39 2005 +0000 Rolled version. Should have done it last time! Author: Peter Maydell Date: Sat Nov 19 16:32:34 2005 +0000 Make it clearer that lower-case envariables aren't supposed to be set by the user. Author: Peter Maydell Date: Sat Nov 19 16:04:25 2005 +0000 Special-case an MHCONTEXT of "/dev/null" and don't try to lock it -- some user scripts may use this to suppress modification of context. Author: Peter Maydell Date: Mon Nov 14 00:18:24 2005 +0000 [bug #9813] Don't crash after removing the folder if the context file has no Current-Folder entry. Author: Peter Maydell Date: Sun Nov 13 23:57:49 2005 +0000 Pass some globals into sm_init() so that it uses SASL if necessary. [NB that as I do not have a SASL setup I am relying on (a) the patch being obviously correct and (b) the original submitter having tested!] Author: Peter Maydell Date: Sun Nov 13 23:56:30 2005 +0000 Forgot to quote the bug number in the changelog comment. Author: Peter Maydell Date: Sun Nov 13 23:51:18 2005 +0000 Use context/ctxpath==NULL to indicate that no context file should be read, to avoid inadvertently trying to lock /dev/null (takes 30secs+ with some locking methods). Author: Peter Maydell Date: Sun Nov 13 22:36:07 2005 +0000 Fix buffer overrun in address parsing code (would only show up if scan was run with -width 16536 or similar) Author: Oliver Kiddle Date: Sun Nov 13 19:38:32 2005 +0000 remove link to install-mh that caused problems on some systems Author: Oliver Kiddle Date: Sun Nov 13 19:27:37 2005 +0000 bug #739: install target now depends on all to avoid problem on case-insensitive file systems with the INSTALL file Author: Josh Bressers Date: Thu Nov 10 21:37:10 2005 +0000 Fix the AC_PATH_PROG default when sendmail isn't found during build. Author: Peter Maydell Date: Wed Nov 9 22:56:35 2005 +0000 Fix a non-ANSI prototype. Author: Oliver Kiddle Date: Tue Nov 8 20:22:33 2005 +0000 Simon Burge: fix to handle getutent() on NetBSD Author: Oliver Kiddle Date: Tue Nov 8 17:18:09 2005 +0000 update most references to the web page and mailing list locations Author: Oliver Kiddle Date: Tue Nov 8 16:58:08 2005 +0000 prepend DESTDIR to install locations Author: Oliver Kiddle Date: Tue Nov 8 16:51:34 2005 +0000 replace obsolete autoconf macros Author: Peter Maydell Date: Sun Nov 6 21:54:40 2005 +0000 Fix various buffer overruns in fmt_scan.c; the bulk of this is passing buffer length through to decode_rfc2047() and having that function do sufficient bookkeeping to avoid running off the end of the buffer. Author: Peter Maydell Date: Sun Nov 6 00:34:56 2005 +0000 Fix a compile error if building nmh with --enable-apop. Author: Peter Maydell Date: Sun Nov 6 00:32:20 2005 +0000 Don't fclose() the file twice in error-exit paths from get_content() (was causing crashes on multipart mails with invalid Content-Type headers) Author: Peter Maydell Date: Sun Nov 6 00:28:12 2005 +0000 Remove space between -o and output filename so it works on older versions of flex as well as newer ones. Author: Peter Maydell Date: Sun Nov 6 00:23:48 2005 +0000 Add an AC_PREREQ so we don't just fail with an obscure error message if using old 2.13 era autoconf (or an autoconf-version-guessing wrapper). Author: Josh Bressers Date: Fri Nov 4 22:07:48 2005 +0000 Update the instructions for subscribing to the nmh-workers list Author: Oliver Kiddle Date: Wed Nov 2 17:43:21 2005 +0000 fail when kpop connection attempted without KPOP support compiled in Author: Oliver Kiddle Date: Wed Nov 2 17:29:50 2005 +0000 fix for newer version of flex and remove autogenerated file from cvs Author: Oliver Kiddle Date: Wed Nov 2 17:22:27 2005 +0000 speed up flist by skipping stat on files with numbers as names Author: Oliver Kiddle Date: Wed Nov 2 17:16:39 2005 +0000 include new files in distribution Author: Bill Wohler Date: Tue Oct 11 01:52:45 2005 +0000 A couple of questions from nmh's original FAQ were folded into the MH FAQ which is now a part of nmh. New Questions 1.09 What is the copyright status of nmh? 3.23 Why do folder and flist overlook some of my sub-folders? Changed Questions 1.02 current version? nmh history update, nmh 1.1-RC4, mailutils 0.6 Author: Oliver Kiddle Date: Wed Oct 5 10:05:24 2005 +0000 Harald Geyer: back out fork/vfork workaround and handle the issue directly Author: Oliver Kiddle Date: Wed May 18 13:45:03 2005 +0000 use fork instead of vfork on Linux Author: Oliver Kiddle Date: Wed May 18 13:27:44 2005 +0000 test/report error writing to stdout Author: Oliver Kiddle Date: Wed May 18 13:24:14 2005 +0000 correct SASL include file locations Author: Oliver Kiddle Date: Wed May 18 13:16:21 2005 +0000 add bash completion definitions from Debian Author: Oliver Kiddle Date: Wed May 18 12:57:40 2005 +0000 fix a bug affecting AFS where nmh was setting the READONLY flag for a folder even when you do have write access to the folder Author: Oliver Kiddle Date: Wed May 18 12:50:45 2005 +0000 Carl Mummert: add unquote() function for removing quotes from RFC-2822 headers Author: Oliver Kiddle Date: Tue May 17 16:30:15 2005 +0000 fill in a few of the missing ChangeLog entries Author: Oliver Kiddle Date: Wed Feb 23 16:20:47 2005 +0000 use iconv to convert RFC-2047 encoded headers to the character set used by the current locale Author: Oliver Kiddle Date: Wed Feb 23 14:07:52 2005 +0000 fix Debian bug #202667: crash when a message's filename overflows an int when converted Author: Oliver Kiddle Date: Wed Feb 23 11:55:25 2005 +0000 Updated config.guess and config.sub to the most recent versions (from automake 1.9.5) Author: Oliver Kiddle Date: Mon Feb 21 16:31:58 2005 +0000 fix bug where inc crashed on failing to reopen the terminal Author: Oliver Kiddle Date: Thu Jan 27 16:43:03 2005 +0000 acknowledge that my change was based on an older patch from Michael Richardson Author: Oliver Kiddle Date: Thu Jan 27 16:39:56 2005 +0000 Added -proxy option to inc and msgchk Author: Oliver Kiddle Date: Thu Jan 27 16:34:20 2005 +0000 Added -proxy option to inc and msgchk Author: Oliver Kiddle Date: Thu Jan 27 16:26:24 2005 +0000 On systems where it is available, use nl_langinfo to get the character set if MM_CHARSET is unset Author: Oliver Kiddle Date: Fri Jan 21 19:25:44 2005 +0000 US-ASCII is a subset of UTF-8 so can be handled directly when UTF-8 is being used Author: Oliver Kiddle Date: Fri Dec 17 15:16:04 2004 +0000 Fix -part option to mhshow/mhlist/mhstore to find sub-parts of the specified part Author: Jon Steinhart Date: Fri Nov 19 05:06:16 2004 +0000 Added mail directory argument to folder_addmsg in order to make it possible to provide a path to the ext_hook call that is mailpath-based. A problem existed when a folder was a symbolic link and the pwd call would return the path relative to the filesystem, not to mailpath. A new argument was needed because there was otherwise no reasonable way to get that path. Author: Jon Steinhart Date: Tue Nov 16 18:14:34 2004 +0000 Fixed problem where the refile hook was being called after a message was renamed so that it wasn't around for the hook. The hook is now called before the message file is renamed. Author: Jon Steinhart Date: Tue Nov 16 18:08:07 2004 +0000 Fixed typo in comment. Fixed problem with refile hook when refiling across filesystems. Author: Jon Steinhart Date: Tue Nov 16 17:37:41 2004 +0000 Removed unnecessary code. Author: Jon Steinhart Date: Tue Nov 16 17:28:33 2004 +0000 Fixed wrong directory for hook when refiling with -src option. Author: Jon Steinhart Date: Fri Oct 15 17:10:58 2004 +0000 Fixed calling of external hooks. Author: Jon Steinhart Date: Tue Oct 12 21:14:02 2004 +0000 Fixed another weird bug caused by the static mailpath being overwritten. Author: Jon Steinhart Date: Tue Oct 12 20:41:34 2004 +0000 Fixed bug that caused anno to mangle headers. Author: Jon Steinhart Date: Tue Oct 12 20:40:25 2004 +0000 Fixed strange bug that prevented a lock from ever being obtained if getting it failed the first time. The problem was that the string of XXXXXX that is required by mkstemp() was overwritten the first time through, and so all subsequent times failed because mkstemp() failed. The fix reinitializes the tmp file string. Author: Jon Steinhart Date: Tue Oct 12 20:38:10 2004 +0000 Fixed bug in which the static maildir was overwritted if a format string was read from the profile. Author: Jon Steinhart Date: Tue Oct 12 20:31:14 2004 +0000 Fixed bug that was producing an incorrect path for the external hook. Author: Glenn Burkhardt Date: Mon Oct 6 20:11:39 2003 +0000 db configuration fix for Debian; yet another location for ndbm. Author: Glenn Burkhardt Date: Tue Sep 30 19:55:12 2003 +0000 restored use of PUTDF() macro; was broken in versions 1.10-1.12; replacement implementation filled on right instead of on left. Author: Glenn Burkhardt Date: Tue Sep 30 16:57:26 2003 +0000 [bug #4302] errno is not always an extern int The errno declaration is best left to errno.h; several systems use #define errno (*(___errno())) or similar Author: Glenn Burkhardt Date: Tue Sep 30 16:22:54 2003 +0000 corrected termination condition for fill character introduced in last version Author: Glenn Burkhardt Date: Tue Sep 30 16:19:12 2003 +0000 [bug #4296] PUTD() macro can't hack 10 digit values Once the number exceeded 1000000000, the conversion would fail. An execution of dp -format "%(clock{text})" "Tue, 01 Jul 2003 21:38:05 +0700" would erroneously print 749660476, instead of 1057070285. The macros PUTD() and PUTDF() have been replaced by snprintf() calls; These macros should never have been written in the first place, when system functions exist to do the work. (prev version 1.10 was erroneously comitted). Author: Glenn Burkhardt Date: Tue Sep 30 16:07:49 2003 +0000 [bug #4296] PUTD() macro can't hack 10 digit values Once the number exceeded 1000000000, the conversion would fail. An execution of dp -format "%(clock{text})" "Tue, 01 Jul 2003 21:38:05 +0700" would erroneously print 749660476, instead of 1057070285. The macros PUTD() and PUTDF() have been replaced by snprintf() calls; These macros should never have been written in the first place, when system functions exist to do the work. Author: Glenn Burkhardt Date: Tue Sep 30 14:36:04 2003 +0000 [bug #4297] The strlen mh-format function can crash if 'str' is null. Author: Glenn Burkhardt Date: Tue Sep 30 14:30:36 2003 +0000 note recent changes Author: Glenn Burkhardt Date: Tue Sep 30 14:19:20 2003 +0000 fix handling of "-list" and "-seq" options, so behavior is orthoganal. Previously, "pick -list -seq seqname" meant "pick -nolist -seq seqname". Now "pick -list -seq seqname" and "pick -seq seqname -list" do the same thing. Thanks to Robert Elz. Author: Glenn Burkhardt Date: Sun Sep 28 14:27:34 2003 +0000 update 'mp->lowmsg' from 0 to 1 during regular 'inc' from mail spool; avoids failure of 'folder_realloc()' for case of no messages in folder, and more than 100 messages to incorporate. Initially, 'folder_read()' will initialize 'mp->lowmsg' to 0, and 'mp->lowoff' to 1. So the call would be folder_realloc(mp, 1, 200), and the comparison 'if (mp->nummsg > 0 && lo > mp->lowmsg)' will fail. Author: Glenn Burkhardt Date: Mon Sep 22 16:03:22 2003 +0000 Removed space between command name and man section number (e.g., "show (1)" --> "show(1)", so xemacs can recognize them as links to other man pages. Author: Glenn Burkhardt Date: Mon Sep 22 01:04:04 2003 +0000 make 'spost' handling of "masquerade:" line of mts.conf containing 'draft_from' same as for 'post'. Debian bug report 144098, filed by Terran Melconian. Author: Glenn Burkhardt Date: Mon Sep 22 00:43:09 2003 +0000 status of action wasn't saved for use by 'N' result, so when 'N' was used slocal could perform the action even if the previous action failed. Debian bug report #149745, filed by Daniel Müller. Author: Glenn Burkhardt Date: Sun Sep 21 18:08:35 2003 +0000 Increase timeouts to comply with RFC 1123; Debian bug report #152728 by Ian Jackson Author: Glenn Burkhardt Date: Sun Sep 21 17:34:31 2003 +0000 added cross references Author: Glenn Burkhardt Date: Sun Sep 21 17:09:31 2003 +0000 fixed typo: example for scan.default didn't include proper terminating %> for "%<{date} %|*%>"; reported as Debian bug #143427 by Peter Maydell Author: Glenn Burkhardt Date: Sun Sep 21 15:43:00 2003 +0000 Apply bug fix reported to Debian (#136976) by Peter Maydell; allows messages with "Content-Transfer-Encoding: binary" to be displayed, per RFC 2045 section 6.2 paragraph 4 Author: Glenn Burkhardt Date: Sun Sep 21 02:39:58 2003 +0000 corrected typo for nroff directive Author: Glenn Burkhardt Date: Tue Sep 16 14:27:55 2003 +0000 add command to remove $(libdir)/install-mh prior to creating the link Author: Jeffrey C Honig Date: Sun Sep 14 13:25:55 2003 +0000 The first ``inc'' into an empty folder would not update the unseen sequence. This is because seq_list() will return NULL if mp->nummsg is zero. Insure that mp->nummsg is incremented. Author: Ken Hornstein Date: Mon Sep 8 18:41:10 2003 +0000 Man page fix from Igor Sobrado Author: Glenn Burkhardt Date: Sat Sep 6 17:27:55 2003 +0000 Added documentation of "Dcc", per recent discussion on mailing list (main contributors Jerry Peek and Robert Elz) Author: Ken Hornstein Date: Fri Sep 5 21:07:49 2003 +0000 Merge in changes from the 1.1 branch. Author: Ken Hornstein Date: Fri Sep 5 19:10:21 2003 +0000 Fix from branch. Author: Ken Hornstein Date: Fri Sep 5 18:37:47 2003 +0000 Quiet lock warning. Author: Ken Hornstein Date: Fri Sep 5 18:36:36 2003 +0000 Merge in locking fixes into the main line. Author: Jeffrey C Honig Date: Mon Aug 11 01:20:52 2003 +0000 When compiling format strings, nmh attempts to avoid multiple parsing of address and date fields by only inserting calls to the parse functions (FT_PARSEADDR and FT_PARSEDATE) for a given component once. The problem with this method is that the initial invocation may actually be on a code path that is conditionally executed. This can result cached copies of data from the fields in previous messages to be used. My solution is to move this optimization from compile time to run time. Address and Date parsing calls (FT_PARSEADDR and FT_PARSEDATE) will always be included. Run time flags are used to prevent these functions from being run more than once per component per message. The c_flags field has being converted from a boolean to a bit-field to facilitate maintenance of the new CT_PARSED value. The result value that used to be in this field is now the bit CF_TRUE and the overloaded use of this field by scan() is now the CT_DATEFAB bit. Some unneeded flags (CT_ADDRPARSE, CT_MYMBOX) have also been removed. Author: Glenn Burkhardt Date: Fri Jul 4 16:15:02 2003 +0000 more detail for bugs fixed, so reader doesn't need to go to Bugzilla Author: Glenn Burkhardt Date: Fri Jul 4 15:55:55 2003 +0000 update Author: Glenn Burkhardt Date: Wed Jul 2 02:24:19 2003 +0000 restored use of %manext5% for man section, which was lost in version 1.4 Author: Glenn Burkhardt Date: Wed Jul 2 02:03:19 2003 +0000 Updated description of default template to reflect current change to In-Reply-To, and Fcc: Author: Glenn Burkhardt Date: Wed Jul 2 02:01:50 2003 +0000 Default templates for 'comp', 'forw', 'dist', 'repl' now include Fcc: +outbox Author: Glenn Burkhardt Date: Mon Jun 30 19:43:26 2003 +0000 use symbols for date and version so values are automatically updated during build. Author: Glenn Burkhardt Date: Mon Jun 30 19:40:05 2003 +0000 bump date so everything gets a new timestamp for 1.1 Author: Glenn Burkhardt Date: Mon Jun 30 18:58:07 2003 +0000 fix bug #1393, "sortm core dumps", using patch provided by Robert Elz, kre@munnari.oz.au. The core dump occurred when "Subject:" was immediately followed by an alphanumeric, and "-textfield subject" were used as arguments. Author: Glenn Burkhardt Date: Mon Jun 30 16:48:50 2003 +0000 Re-write for clarity, using major contributions from Bart Massey, and Jerry Peek. Author: Glenn Burkhardt Date: Mon Jun 30 16:40:09 2003 +0000 made RFC 2822 compliant, using an "In-reply-to:" format supplied by Jerry Peek. Author: Glenn Burkhardt Date: Fri Jun 27 17:02:13 2003 +0000 prevent double free of 'ce->cd_file' or later use of invalid data Author: Glenn Burkhardt Date: Thu Jun 26 01:30:36 2003 +0000 fix for bug #578 repl leaks umask; there are several other places in the code where the umask value is not restored, so there might be other similar bugs Author: Glenn Burkhardt Date: Mon Jun 23 00:44:28 2003 +0000 Changed use of GNU "simply expanded variables" for MAN1, MAN5, MAN8, so one makefile will work with SysV make (e.g., Solaris) and GNU make Author: Glenn Burkhardt Date: Sun Jun 22 23:59:16 2003 +0000 allow gdbm/ndbm.h in addition to db1/ndbm.h; needs corresponding change in configure.in Author: Glenn Burkhardt Date: Sun Jun 22 23:58:07 2003 +0000 Allowed gdbm as substitute for Berkeley db1/ndbm.h libdb1 (check for gdbm/ndbm.h, libgdbm now); send only stdout to /dev/null when checking for 'broken vi', this allows 'vim' on Solaris to work, since 'vim' closes stdin and uses stderr for input when running a script. Author: Kimmo Suominen Date: Thu Jan 2 04:07:49 2003 +0000 Fix detection of non-mime messages when the charset is not enclosed in double quotes. (Not perfect yet, but 97% effective.) Author: Jon Steinhart Date: Thu Nov 21 21:22:24 2002 +0000 Fixed a typo in the SRCS definition; had a .o where it should have been a .c Author: Jon Steinhart Date: Wed Nov 20 19:57:19 2002 +0000 Fixed a bug in the waitpid version where it would return incorrectly if a child process was interrupted. Author: Jon Steinhart Date: Tue Nov 19 20:39:21 2002 +0000 Removed the reference to the library directory since this now goes in bin. Author: Jon Steinhart Date: Tue Nov 19 20:37:50 2002 +0000 Changed to move install-mh to the bin directory instead of the lib directory. A link is made from the lib to the bin just in case. Author: Jon Steinhart Date: Mon Nov 18 18:25:00 2002 +0000 The file README-ATTACHMENTS was removed - it has been moved to the docs subdirectory. I thought that this had already been done but I guess not. It's unrelated to the rest of these changes. The remainder of these changes affect the way that nmh is installed. Nmh has historically prompted the user for installation when any nmh command is invoked if it doesn't think that it's installed. This is a problem for programs that want to, for example, interact with nmh programs via pipes. These changes alter this behavior. Now, when an nmh program thinks that nmh isn't installed, it tells the user to run install-mh to install it. A -check option has been added to install-mh that allows the existence of an installation to be silently checked and indicated via the exit status. The bulk of this change is in sbr/read_context.c. In the process of making these changes, I noticed a fair amount of useless code that I removed. In particular: 1. The program started with a test for whether or not defpath had already been set. This could only happen if context_read() was called more than once, which it isn't. This check also existed and was removed from the following places: sbr/context_del.c sbr/context_find.c sbr/context_replace.c sbr/seq_read.c sbr/seq_save.c uip/flist.c uip/folder.c uip/rmf.c 2. A similar test for mypath was removed. No need to test it since it doesn't happen. I'm just not a believer that a = 1; if (a != 1) error(); is a good way to write code! 3. I removed the code makes a copy of the $HOME environment variable as returned by getenv(). It's never changed, so it doesn't need copying. 4. I removed code that copied the pw_dir member of the passwd structure returned by getpwuid() if $HOME isn't set. Yes, the returned structure is static, but since the function is never called again the returned values stay valid and don't need copying. 5. I removed the test for a NULL pw_dir member in the passwd structure returned by getpwuid() since that never happens. 6. I removed code that removed a trailing / from mypath if mypath is more than one character long. Unnecessary as // is interpreted as / anyway. mypath never shows up in an error message, so nobody will ever see it. Besides, this code didn't handle the case of multiple trailing slashes. 7. I removed code that replaced the MH environment variable contents with an absolute path if it was a relative one. I'm a bit nervous about this one, only testing will tell. Any nmh program that's invoked will use the same context_read() code to convert a relative path to an absolute one anyway. And there's no guarantee (or discussion) of this feature in any of the documentation. 8. Althout context_read() tested the MH environment variable, install-mh didn't. This means that the behavior was not consistent between install-mh and all other nmh programs. I changed install-mh to be consistent with context_read(). 9. install-mh has been installed in the lib directory, not bin. So a user would be unlikely to find it when prompted to run it. The installation has been changed to add a link from bin to lib. Author: Anders Eriksson Date: Mon Oct 21 19:32:26 2002 +0000 Changed scan to always pass the folder argument. This is in line with the man page. Author: Jon Steinhart Date: Mon Sep 9 14:30:16 2002 +0000 New routine that provides interface to external programs. Author: Jon Steinhart Date: Fri Aug 23 20:37:01 2002 +0000 Added external program hooks. Author: Jon Steinhart Date: Thu Aug 22 22:06:18 2002 +0000 Moved this file here from the root directory. Author: Jon Steinhart Date: Mon Aug 19 20:50:41 2002 +0000 Added an improved user interface for sending messages with attachments. Author: Ken Hornstein Date: Mon Jul 8 19:29:24 2002 +0000 Remove this file on the head as well. Author: Ken Hornstein Date: Wed Jul 3 14:49:24 2002 +0000 Bring these changes over from the branch. Author: Ken Hornstein Date: Wed Jul 3 14:08:11 2002 +0000 Remove these undefines (why were they in there?) Author: Ken Hornstein Date: Tue Jul 2 22:10:55 2002 +0000 Update for new version. Author: Ken Hornstein Date: Tue Jul 2 22:09:12 2002 +0000 Add/update copyright notice in all source code files. Author: Ken Hornstein Date: Tue Jul 2 21:46:37 2002 +0000 Remove autoconf-generated files (and note such files in .cvsignore) Author: Dan Harkless Date: Sat Mar 17 11:28:27 2001 +0000 Ken Hornstein's configure.in Cyrus SASL checks were doing `x"$with_cyrus_sasl" != "no"' instead of `... != x"no"'. Author: Dan Harkless Date: Wed Mar 7 05:26:50 2001 +0000 Found some historical information about MH in RFC 808. Supplemented it with info from Jerry Peek's MH book and added it to docs/README.about. Author: Shantonu Sen Date: Tue Feb 6 20:47:54 2001 +0000 dtimp timezone fixes Author: Shantonu Sen Date: Tue Feb 6 20:35:40 2001 +0000 Be more picky about symbolic time zones, and accept either a symbolic or numeric time zone, but never both, since a DST offset might be subtracted twice. Also, be uniform about assuming that pre-1970 dates are Y2K problems. Author: Dan Harkless Date: Tue Feb 6 04:28:04 2001 +0000 Say in README.developers to use `\date' in case anyone is like me and has `date' aliased in their shell to use a nonstandard (but subjectively more readable) format. Author: Dan Harkless Date: Tue Feb 6 04:22:09 2001 +0000 Regenerated stamp-h.in using my tcsh alias `date', which uses a nonstandard format. Replacing it with the standard format. I'll update README.developers to say to use `\date'. Author: Dan Harkless Date: Tue Feb 6 03:46:27 2001 +0000 * -L isn't sufficient for specifying the path of the Cyrus SASL shared library. That'll allow us to link successfully, but on many/most OSes that won't allow us to find libsasl at runtime. On Solaris, we need to specify the library path with -R as well (or else the user will have to use the $LD_LIBRARY_PATH kludge, which is considered harmful). This fix should be extended to other OSes as well. * Print whether we have SASL support in the "nmh configuration" summary configure prints out. Author: Shantonu Sen Date: Thu Jan 25 21:28:30 2001 +0000 man/mh-chart Author: Shantonu Sen Date: Thu Jan 25 21:15:52 2001 +0000 use %etcdir% for spacing instead of hardcoding Author: Shantonu Sen Date: Thu Jan 25 21:14:32 2001 +0000 compiled mh-chart with synopses of commands Author: Shantonu Sen Date: Tue Jan 23 20:27:57 2001 +0000 digest Author: Shantonu Sen Date: Tue Jan 23 20:26:15 2001 +0000 Don't try to force year into a 19xx format Author: Shantonu Sen Date: Tue Jan 23 04:14:08 2001 +0000 SYNOPSIS formating to prevent filling Author: Shantonu Sen Date: Fri Jan 19 21:32:13 2001 +0000 manpages finished Author: Shantonu Sen Date: Fri Jan 19 21:22:08 2001 +0000 don't build vmh.1 since vmh isn't distributed, and we no longer need tmac.h Author: Shantonu Sen Date: Fri Jan 19 21:10:09 2001 +0000 show-whom Author: Shantonu Sen Date: Thu Jan 18 20:27:34 2001 +0000 prompter-sendfiles Author: Shantonu Sen Date: Tue Jan 9 06:55:21 2001 +0000 delete old files, manpage progress Author: Shantonu Sen Date: Tue Jan 9 06:45:26 2001 +0000 removed deprecated files. sendmail functionality exists in mts/smtp/ Author: Shantonu Sen Date: Tue Jan 9 06:41:44 2001 +0000 Add an entry for README.manpages Author: Shantonu Sen Date: Tue Jan 9 06:40:12 2001 +0000 Added popi.c to SRCS, even though it's not being built currently Author: Shantonu Sen Date: Tue Jan 9 06:13:55 2001 +0000 removing mts/generic Author: Shantonu Sen Date: Tue Jan 9 06:10:03 2001 +0000 deleting zotnet/ dir -- parts moved to sbr/ Author: Shantonu Sen Date: Tue Jan 9 06:01:19 2001 +0000 mh_profile-prev Author: Shantonu Sen Date: Sat Jan 6 23:38:12 2001 +0000 mh_tailor-mhbuild Author: Shantonu Sen Date: Thu Jan 4 07:07:41 2001 +0000 Updating mh_sequence Author: Shantonu Sen Date: Wed Jan 3 06:29:06 2001 +0000 mh_mail-mh_profile Author: Shantonu Sen Date: Tue Jan 2 08:10:46 2001 +0000 mh-format Author: Shantonu Sen Date: Tue Jan 2 07:12:46 2001 +0000 Modularizing the Makefile caused some variable expansion problems on non-GNU makes Author: Shantonu Sen Date: Tue Jan 2 06:43:07 2001 +0000 mh_chart-mh_draft Author: Shantonu Sen Date: Mon Jan 1 10:19:00 2001 +0000 Updating ali-mh_alias Author: Shantonu Sen Date: Sun Dec 31 20:58:29 2000 +0000 add about pointers to shared pages Author: Shantonu Sen Date: Sun Dec 31 20:55:48 2000 +0000 Add date to files i missed last time Author: Shantonu Sen Date: Sun Dec 31 20:55:06 2000 +0000 docs/README.manpages Author: Shantonu Sen Date: Sun Dec 31 20:48:50 2000 +0000 Add manpage style guide Author: Shantonu Sen Date: Sun Dec 31 09:25:09 2000 +0000 Updating inc Author: Shantonu Sen Date: Sun Dec 31 08:19:20 2000 +0000 Updating comp-forw Author: Shantonu Sen Date: Sun Dec 31 06:31:42 2000 +0000 add flists and folders as pointer pages to flist,folder. Modularize Makefile to allow easier addition of manpages Author: Shantonu Sen Date: Sun Dec 31 02:44:18 2000 +0000 replace %components% and %distcomps% in man pages with corresponding files Author: Shantonu Sen Date: Sun Dec 31 02:43:34 2000 +0000 updated ali-flist, with batch edit of others Author: Shantonu Sen Date: Sat Dec 30 23:18:28 2000 +0000 update ali,anno,ap.burst Author: Shantonu Sen Date: Sat Dec 30 10:01:29 2000 +0000 Updated man pages to remove dependence on tmac.h and have a more modern look Author: Shantonu Sen Date: Sat Dec 30 10:00:42 2000 +0000 DATE an manpage updating Author: Shantonu Sen Date: Sat Dec 30 09:51:55 2000 +0000 Use the DATE file Author: Shantonu Sen Date: Sat Dec 30 09:50:13 2000 +0000 Created DATE that contains a datestamp used in the man pages. It should be updated each release. Author: Shantonu Sen Date: Sun Dec 24 10:13:45 2000 +0000 hesiod and krb5 test changes. add --with-locking to INSTALL Author: Shantonu Sen Date: Sun Dec 24 10:06:30 2000 +0000 Add documentation for --with-locking option Author: Shantonu Sen Date: Sun Dec 24 10:06:00 2000 +0000 hesiod and krb5 test fixes Author: Shantonu Sen Date: Sun Dec 24 10:04:58 2000 +0000 Fixed up the hesiod library test so that the location of res_send actually helps to determine whether -lresolv needs to be passed as a hesiod lib. Also, fixed the krb5 test to look for -lk5crypto if it exists, since that's the new name for -lcrypto. The old -lcrypto remains in case the new version isn't found. Author: Dan Harkless Date: Sat Dec 23 06:11:03 2000 +0000 -apop and -noapop were not documented in msgchk.man. -snoop was documented but didn't appear in the usage SYNOPSIS. Author: Shantonu Sen Date: Fri Dec 22 23:49:08 2000 +0000 add --with-locking option Author: Shantonu Sen Date: Fri Dec 22 23:42:16 2000 +0000 Autoconfing the file locking options Author: Shantonu Sen Date: Fri Dec 22 19:30:41 2000 +0000 put both linux entries on one line Author: Shantonu Sen Date: Fri Dec 22 19:29:40 2000 +0000 dtimep, MACHINES Author: Shantonu Sen Date: Fri Dec 22 19:21:29 2000 +0000 Update to include Mac OS X and Linux 2.4 Author: Shantonu Sen Date: Fri Dec 22 19:18:09 2000 +0000 When building on Mac OS X, don't set LDFLAGS=-s, since the linker doesn't like the flag Author: Shantonu Sen Date: Fri Dec 22 19:15:02 2000 +0000 Take out memory hints, since we are assuming flex over lex, so this shouldn't be a problem Author: Shantonu Sen Date: Wed Dec 20 16:03:36 2000 +0000 doc/README.developers update, and fixed typo in last ChangeLog entry Author: Shantonu Sen Date: Wed Dec 20 16:00:46 2000 +0000 Marked deprecated directories in layout description, and added an entry for docs Author: Dan Harkless Date: Wed Dec 20 03:30:14 2000 +0000 Just changed a "can" to a "could" since I don't know if most POP3 servers are like qpopper in not allowing people with APOP activated to log in via normal POP3. Author: Dan Harkless Date: Wed Dec 20 03:18:33 2000 +0000 -apop and -noapop were not documented in inc.man. -snoop was documented but didn't appear in the usage SYNOPSIS. Author: Shantonu Sen Date: Sun Dec 17 19:52:04 2000 +0000 Fixed a type from 'his' to 'this' Author: Shantonu Sen Date: Thu Dec 14 14:55:17 2000 +0000 config.guess/sub update Author: Shantonu Sen Date: Thu Dec 14 14:35:40 2000 +0000 config update procedure (probably unneccessary) Author: Shantonu Sen Date: Thu Dec 14 14:32:09 2000 +0000 Updated config.guess and config.sub from most recent version from ftp.gnu.org/pub/gnu/config, with timestamp='2000-12-07'. Author: Dan Harkless Date: Thu Dec 14 03:14:08 2000 +0000 Shantonu did his commit in the wrong order earlier today, making configure get re-built due to a "newer" configure.in. Author: Shantonu Sen Date: Thu Dec 14 01:38:41 2000 +0000 Move mts/generic to sbr/ Author: Shantonu Sen Date: Thu Dec 14 01:30:43 2000 +0000 Resolve the circular dependency of libmh on libmts on libmh. The files mts/generic/client.c and mts.c are moved to sbr/, and mts/generic/mts.h is moved to h/mts.h. Thus, libmh is self-contained. All header includes have been appropriately updated, and the Makefiles and configure script no longer build mts/generic. Author: Dan Harkless Date: Tue Dec 12 06:19:25 2000 +0000 When Shantonu made the new libmts.a, he swapped $(MTSLIB) and libmh.a in sbr/Makefile.in so that libmh.a comes first, but this causes the build to fail on Solaris, because libmts.a has to get ruserpass() out of libmh.a. Swapping them back to the way Ken Hornstein's patch (which I applied on Jul 20) put them, with libmh.a correctly coming second. If there are times when libmts.a needs to come second, then it would appear there's a circular dependency and someone (Shantonu?) did an mts merge incorrectly. Author: Dan Harkless Date: Fri Sep 8 23:19:37 2000 +0000 Just fixed a formatting error. Author: Shantonu Sen Date: Fri Sep 8 01:39:10 2000 +0000 Took out bad zones in dtimep Author: Shantonu Sen Date: Fri Sep 8 01:36:23 2000 +0000 Took out incorrect time zones like JST and BST. Author: Shantonu Sen Date: Fri Sep 8 00:49:32 2000 +0000 Included code reorg of zotnet/mts Author: Shantonu Sen Date: Fri Sep 8 00:37:54 2000 +0000 Don't make Makefiles in zotnet or mts/mmdf or mts/sendmail Author: Shantonu Sen Date: Fri Sep 8 00:36:48 2000 +0000 Don't generate Makefiles for zotnet, or mts/mmdf and mts/sendmail, since they are no longer being compiled. Author: Shantonu Sen Date: Fri Sep 8 00:34:41 2000 +0000 Included h/nmh.h, since the MD5 algorithms were missing declarations for memcpy and memset (I think), which are indirectly included from strings.h Author: Shantonu Sen Date: Fri Sep 8 00:34:08 2000 +0000 Updated #include's to point to new location of mts.h on mts/generic Author: Shantonu Sen Date: Fri Sep 8 00:32:47 2000 +0000 No longer descend into zotnet/ Author: Shantonu Sen Date: Fri Sep 8 00:30:58 2000 +0000 Moved code from zotnet/mts to mts/generic. Also, unified generic mts code and smtp/sendmail into libmts.a as an intermediate, instead of having two static libs. Author: Shantonu Sen Date: Wed Sep 6 22:48:43 2000 +0000 Included changes to dtimep.lex to remove military zone parsing. Author: Shantonu Sen Date: Wed Sep 6 22:40:03 2000 +0000 Took out parsing of military time, which was causing issues when it encountered something like (MET), which it doesn't recognize as a timezone, and which was then read as military characters. Author: Dan Harkless Date: Fri Aug 11 20:43:07 2000 +0000 Further clarified Kimmo's etc/Makefile.in comments at his suggestion. Author: Dan Harkless Date: Thu Aug 10 21:32:33 2000 +0000 Changed my mind again on scan.MMDDYY and scan.YYYYMMDD. Put the replied / encrypted column back in, because it's useful to "always" (at least when you aren't using replied / encrypted) have a space in between the message number and date, so you can use awk (with the default field separators) to grab message numbers from scan output. Author: Dan Harkless Date: Thu Aug 10 20:33:25 2000 +0000 Decided that limiting the message number columns to 3 on my scan.MMDDYY and scan.YYYYMMDD (to try to regain space taken by extra date info) was ill-conceived. It's not that tough to get past 999 messages, though I imagine it's rather rare to exceed 9999. Changed these to 4. I had already removed the "replied / encrypted" column in YYYYMMDD, but this time I removed it on MMDDYY as well (I've never seen it used...). Author: Ruud de Rooij Date: Mon Aug 7 18:42:20 2000 +0000 Modify umask set by mhshow to enable user execute bit, so that viewers that create temporary directories (e.g., lynx) will be able to access them. Author: Dan Harkless Date: Sat Aug 5 16:00:49 2000 +0000 Kimmo's etc/Makefile.in change note implied that install was previously completely broken. Not the case. I asked Kimmo about it and he clarified that it failed when building outside the source tree. Fixed the entry to reflect. Author: Dan Harkless Date: Fri Aug 4 00:15:52 2000 +0000 TODO: Allow multiple simultaneous differing contexts, probably each tied to a parent (terminal) process. Author: Kimmo Suominen Date: Tue Aug 1 14:55:53 2000 +0000 Make "make install" work in etc/Makefile.in Author: Dan Harkless Date: Mon Jul 24 23:24:22 2000 +0000 Renamed DSTXXX as ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST and added an explanatory comment by its #definition. Author: Dan Harkless Date: Mon Jul 24 23:06:42 2000 +0000 Updated README.developers with the fact that zotnet/tws is going away. Author: Dan Harkless Date: Mon Jul 24 23:03:38 2000 +0000 When Shantonu wrote the new, more portable dtimep.lex, he left out the #ifdef DSTXXX stuff for some reason. Not a good idea, as that code is required for proper printing of numeric-offset timezones that have daylight saving time. Without that code, -0700 during DST gets printed as MST instead of PDT. Author: Dan Harkless Date: Fri Jul 21 03:31:39 2000 +0000 Fixed warnings from diff on first-time install of nmh. Also added 'echo's clarifying the etc file installation activities. Author: Dan Harkless Date: Fri Jul 21 02:35:43 2000 +0000 Applied Kurt J. Lidl 's $MAILHOST patch: I have a small patch that would be nice to be included -- basically, it allows the usage of the "MAILHOST" environment variable, without having to have HESIOD turned on. I need this functionality for my environment, where we have identical /usr/local on all my machines (so I cannot just hardcode into the mts.conf file), and I have multiple POP mail servers for my users. Modified inc.man to reflect that along with "pophost:" and -host, $MAILHOST can now activate POP mail inclusion as well. Author: Dan Harkless Date: Fri Jul 21 02:25:59 2000 +0000 Last pass at README.developers -- Kimmo's 5-step commit was overkill. You only need 3 steps, since configure.in is the only autoconf file with the RCS $Id keyword. Author: Dan Harkless Date: Fri Jul 21 02:11:59 2000 +0000 Meaningless modification to test autoconf file commit order stuff. Author: Dan Harkless Date: Fri Jul 21 02:04:37 2000 +0000 Meaningless change to test autoconf file commit order stuff. Author: Dan Harkless Date: Fri Jul 21 02:03:23 2000 +0000 Meaningless change for testing autoconf file commit order stuff. Author: Dan Harkless Date: Fri Jul 21 01:56:17 2000 +0000 Meaningless change to test autoconf commit order stuff. Author: Dan Harkless Date: Fri Jul 21 01:43:58 2000 +0000 People did not preserve my alphabetization of the --with options when they added new ones. Re-alphabetized. Author: Dan Harkless Date: Thu Jul 20 20:49:00 2000 +0000 Ken Hornstein's SASL patch was not integrated properly with Ruud's new merged mts/sendmail code. Kimmo has since fixed nmh so it compiles, but according to Ken, the SASL stuff still does not work. Integrating a patch from him for this. Author: Dan Harkless Date: Thu Jul 20 20:32:31 2000 +0000 One more pass at README.developers now that it's clear that my previously-suggested one-line autoconf-file commit can cause unnecessary local makes and an out-of-sync stamp-h.in file, but would not cause problems for other people using the CVS files. Author: Dan Harkless Date: Thu Jul 20 20:14:39 2000 +0000 Moved Kimmo's new "--with-hash-backup" to be output with the rest of the --with options in the configure --help output, rather than being in between two random --enable options. Author: Kimmo Suominen Date: Tue Jul 18 23:39:45 2000 +0000 Added answer. Author: Dan Harkless Date: Tue Jul 18 02:15:03 2000 +0000 Clarified and made some corrections to Kimmo's README.developers changes (BTW, if anyone can explain why the RCS Ids are able to cause problems with the dependencies, please fill in the explanation -- I never encountered a problem with the old single-commit method). Author: Dan Harkless Date: Tue Jul 18 02:07:51 2000 +0000 I don't understand why Kim's split-up of the autoconf-file cvs commits should be necessary, so I left a little note hoping for someone to explain technically why that should be the case. I certainly never ran into any problems with my old single-commit version (which I added back in along with an explanation of why it supposedly won't always work). Also Kim's text implied that the _only_ reason for the given order is the RCS Ids -- not true -- the timestamps are the main reason a particular order is necessary. Made a couple of other clarifications as well. Author: Kimmo Suominen Date: Sun Jul 16 06:18:03 2000 +0000 Iterating the commit a bit, I think this is how it works without extra runs of autoconf, autoheader and make. Author: Kimmo Suominen Date: Sun Jul 16 06:05:26 2000 +0000 Regen. Author: Kimmo Suominen Date: Sun Jul 16 06:01:28 2000 +0000 If $LIBTOOL is empty we should not try to run it. This gets rid of the "--version: not found" error. Author: Kimmo Suominen Date: Sun Jul 16 05:50:33 2000 +0000 Got rid of one mktemp. Author: Kimmo Suominen Date: Sun Jul 16 05:11:46 2000 +0000 Complete HAVE_MKSTEMP. Author: Kimmo Suominen Date: Sun Jul 16 04:23:50 2000 +0000 We ignore the fact that the user requested SASL, since the pipe to the mailer is secure. This allows for easier sharing of the MH profile across hosts. Author: Kimmo Suominen Date: Sun Jul 16 04:03:27 2000 +0000 Note replacement of GNU-makeism in sbr/Makefile.in with a common statement. Author: Kimmo Suominen Date: Sun Jul 16 03:58:57 2000 +0000 So I don't think you can commit these all in a single commit. README.developers recommends that (with precise ordering) but things still get regenerated when I run "make". Author: Kimmo Suominen Date: Sun Jul 16 03:57:47 2000 +0000 Keep this working with other makes than GNU. Author: Kimmo Suominen Date: Sun Jul 16 03:56:45 2000 +0000 Still missed one SASL stuff thing. Author: Kimmo Suominen Date: Sun Jul 16 03:36:42 2000 +0000 Changed "--with-backup-prefix" to "--with-hash-backup" because # is too difficult for config.status to get right. Author: Kimmo Suominen Date: Sun Jul 16 03:15:17 2000 +0000 Note "--with-backup-prefix". Author: Kimmo Suominen Date: Sun Jul 16 03:13:25 2000 +0000 Add "--with-backup-prefix" so it can be set easily. Author: Kimmo Suominen Date: Sun Jul 16 02:08:18 2000 +0000 SASL stuff. Author: Kimmo Suominen Date: Sun Jul 16 01:48:37 2000 +0000 SASL stuff. Author: Kimmo Suominen Date: Sun Jul 16 01:46:50 2000 +0000 SASL mods. Author: Dan Harkless Date: Thu Jul 13 21:49:45 2000 +0000 Deleted the timezone on Kim's SASL patch entry. Ruud has taken to adding the timezone even though all previous entries are missing it, and I don't really agree with that. True, on occasion someone in a different timezone will commit something later in the day than someone else, and even though the second change happens later, the time may be earlier, but that doesn't happen too often and isn't really a big deal, IMHO. Putting textual timezones like "EDT" isn't really the right solution, IMHO, since some of those tags are ambiguous. Either an offset-style timezone should be used or all times should be given as UTC. I'd just as soon stick with local times, though. Oh, one thing I forgot to mention in my last CVS entry was that I removed "IMAP" from the list of protocols supported by Ken's SASL patches -- nmh doesn't have any IMAP support! Author: Dan Harkless Date: Thu Jul 13 21:42:52 2000 +0000 Modified Kimmo's entry for the application of Ken Hornstein's SASL patches to clarify that it wasn't Ken applying them himself, and clarified what SASL support actually means. Author: Dan Harkless Date: Thu Jul 13 21:41:42 2000 +0000 Kimmo neglected to commit the regenerated versions of these after changing configure.in, forcing people using the CVS source to have to have the autoconf tools installed. Author: Dan Harkless Date: Tue Jul 11 21:20:04 2000 +0000 Clarified post.man and send.man for those not completely up on SASL terminology. "SASL encryption layers are not supported for SMTP" means that encryption is supported for the authentication but not for the subsequent data stream. Author: Kimmo Suominen Date: Sat Jul 8 05:36:58 2000 +0000 Note SASL commit. Author: Kimmo Suominen Date: Fri Jul 7 03:48:02 2000 +0000 SASL support from Ken Hornstein . Author: Ruud de Rooij Date: Mon Jun 12 18:07:34 2000 +0000 * Merged mts/sendmail functionality into mts/smtp; switching between smtp and sendmail delivery method is now controlled by mts.conf. * If tsort cannot deal with loops, in addition to defining tsort as cat, also define lorder as echo. * Removed uip/popi.c from list of sources. Author: Dan Harkless Date: Fri Jun 9 02:45:17 2000 +0000 New dtimep.lex didn't parse day names properly. Fixed. Also clarified ambiguous comments preceding day_map[] array (from old dtimep.lex) that probably led to the erroneous cp++ being added. Author: Ruud de Rooij Date: Wed Jun 7 19:06:52 2000 +0000 * Added one more mkstemp invocation to uip/spost.c (which was in a #if 0 block). * Applied patch from Peter Maydell to clean up permissions handling and error handling in uip/inc.c. Author: Ruud de Rooij Date: Mon Jun 5 20:13:54 2000 +0000 Use cat instead of tsort if tsort cannot deal with loops in its input (which is the case for tsort from GNU textutils). Author: Ruud de Rooij Date: Mon Jun 5 19:20:38 2000 +0000 If liblockfile is present, and its dotlockfile program is setgid, inc does not need to be setgid. Author: Ruud de Rooij Date: Sun Jun 4 20:24:39 2000 +0000 * Added autoconf test for Miquel van Smoorenburg's liblockfile library, as found on Debian systems. * Added liblockfile support to sbr/lock_file.c. Author: Shantonu Sen Date: Thu Jun 1 06:57:57 2000 +0000 make clean now removes generated bin files. Author: Shantonu Sen Date: Wed May 31 07:22:43 2000 +0000 Made dtimep.lex more lex-friendly. Author: Shantonu Sen Date: Wed May 31 07:19:30 2000 +0000 Added back memory options for AIX to increase available memory. Took out %option noyywrap, which wasn't understood by AT&T lex, as well as the -i case-insensitivity flag. Author: Doug Morris Date: Wed May 31 05:48:06 2000 +0000 added lint targets for Makefiles and a configure test to find whether lclint or lint is installed on the system. Author: Dan Harkless Date: Wed May 31 02:27:40 2000 +0000 Applied Alec Wolman 's dropsbr.c patch: In the map_write routine, a call is made to map_open and this call is supposed to set the "clear" variable to 0 or 1, depending on whether the map file is empty or not. In mh6.8.3, this worked because map_open would set "clear" by calling the mbx_Xopen routine. In nmh, the code for mbx_Xopen was merged into mbx_open, but the interface for mbx_open doesn't support the clear variable, so that functionality was lost. The map_open interface still contains "int *clear" in the prototype, but never sets it. My patch eliminates "clear" from the map_open interface (I checked to make sure that map_write is the only client of map_open). Furthermore, my patch also sets the "clear" variable properly at the beginning of map_write by calling fstat(). This eliminates the bug in that the value of "clear" being used later in the routine was just stack garbage. Having a bad value of clear causes this next bug to be triggered: The fp file pointer was being opened with fdopen, but in two of the three switch cases it wasn't being closed. In certain cases, this was causing packf to run out of file descriptors if you attempted to pack a large folder. Author: Dan Harkless Date: Wed May 31 02:13:57 2000 +0000 A couple more tweaks to etc/Makefile.in: Generated sendfiles script was not a dependency of the `all' target, and was incorrectly included in the distribution. Author: Dan Harkless Date: Wed May 31 00:53:20 2000 +0000 INSTALL never documented the etc/*.old thing. Documented the new etc/*.prev thing (including a note to watch for diff output). Author: Dan Harkless Date: Wed May 31 00:28:14 2000 +0000 Reworded my last entry a bit. Author: Dan Harkless Date: Wed May 31 00:22:05 2000 +0000 etc/Makefile.in was incorrectly installing mts.conf.in and sendfiles.in -- fixed. Changed the suffix for the backed-up previous versions of the etc files from the ambiguous .old to .prev. Use diff and only keep the .prev file around if different. Author: Dan Harkless Date: Tue May 30 22:52:43 2000 +0000 ChangeLog: I think we should use a uniform style in this file. Reformatted Ruud's recent entries. configure: Weird. There's some timestamp screwup somewhere, perhaps in the way Makefile.in is written, that caused autoconf to get run after I did a `cvs update'. It regenerated configure, and apparently I'm using a different version of autoconf, with a different order of awk alternatives. Author: Shantonu Sen Date: Mon May 29 08:00:33 2000 +0000 Added entry for new lexing function and moving from zotnet/tws to sbr Author: Shantonu Sen Date: Mon May 29 07:48:14 2000 +0000 Updating root-level files so that zotnet/tws/Makefile is not generated. Author: Shantonu Sen Date: Mon May 29 07:44:51 2000 +0000 Synchronizing Makefiles that had gotten out of sync with directory contents. Author: Shantonu Sen Date: Mon May 29 07:43:29 2000 +0000 Updated sbr functions to include instead of . Also, update Makefile to include new functions dtime.c and dtimep.c Author: Shantonu Sen Date: Mon May 29 07:35:32 2000 +0000 Updating user programs to use instead of Author: Shantonu Sen Date: Mon May 29 07:29:08 2000 +0000 Moved date/time functions from zotnet/tws to sbr. More importantly, wrote a new lexing function dparsetime (dtimep.lex) which plays nicely with flex, needs no "sed hackery". It might work with lex, but I haven't tried. Author: Ruud de Rooij Date: Sun May 28 16:17:49 2000 +0000 * Added autoconf check for getutent(). * Changed uip/rcvtty.c and uip/slocal.c to use getutent() and friends. Since I can only check on Linux, please check if this works on other systems. Author: Ruud de Rooij Date: Sun May 28 16:15:58 2000 +0000 Added autoconf check for getutent(). Author: Ruud de Rooij Date: Sun May 28 14:42:01 2000 +0000 * Applied patch from Peter Maydell to uip/scansbr.c for more checks for write failures. * Unlink temporary file properly in uip/rcvtty.c. * Moved viamail from bindir to libdir. * Changed sendfiles into sendfiles.in, so that path to viamail is patched in. * Added gzip support to sendfiles. * Added References header to replcomps and replgroupcomps. Author: Ruud de Rooij Date: Sun May 28 12:45:53 2000 +0000 Fixed m_getfld bug which caused segmentation faults when incorporating messages which ended in multiple linefeeds crossing a buffer boundary. Author: Dan Harkless Date: Fri May 26 20:35:30 2000 +0000 msh has been unable to show MIME messages ever since 1.0. Alec Wolman tracked down the problem to the -show flag being passed to mhshow. mhshow is equivalent to the old mhn -show, so we don't need the -show anymore. Removed it. Author: Shantonu Sen Date: Fri May 12 05:19:14 2000 +0000 Moved zotnet/mf to sbr. Author: Shantonu Sen Date: Fri May 12 04:16:46 2000 +0000 zotnet/bboards no longer built by default. Author: Shantonu Sen Date: Fri May 12 02:55:36 2000 +0000 zotnet/bboards is no longer built by default. Author: Shantonu Sen Date: Fri May 12 02:51:21 2000 +0000 Removed zotnet/bboards from default build. Author: Shantonu Sen Date: Thu May 11 02:55:11 2000 +0000 Change to MACHINES to include what platforms nmh *does* compile on. Author: Shantonu Sen Date: Thu May 11 02:53:07 2000 +0000 Added on whish platforms nmh is known to compile, as polled from recent mailings to nmh-workers. Please add liberally. Author: Shantonu Sen Date: Thu May 11 02:24:59 2000 +0000 Entered minor change to sbr/Makefile.in Author: Shantonu Sen Date: Thu May 11 02:21:34 2000 +0000 Removed explicit definition of both SRCS *and* OBJS, and made OBJS simple a pattern substitution of SRCS, with suffix .c -> .o Author: Shantonu Sen Date: Thu May 11 02:14:21 2000 +0000 Added my getpass() addition to ChangeLog (after the fact, but at least it's in now). Author: Dan Harkless Date: Wed May 10 03:39:46 2000 +0000 Added mts.conf.5 page per Neil W Rickert 's report: This happens on solaris: % man mts.conf windex entry incorrect: mts.conf(5) not found. No manual entry for mts.conf. It is fixed by % echo ".so man5/mh-tailor.5" > mts.conf.5 done in the man5 directory. We need to add 'mts.conf.5' as a reference sourcing mh-tailor.5. Author: Dan Harkless Date: Wed May 10 00:02:53 2000 +0000 Prepended "Portions of this code are" to the copyright message in ruserpass.c also. Author: Dan Harkless Date: Tue May 9 21:44:15 2000 +0000 * Changed configure.in to use gcc -Wall even without --enable-debug, to prevent developers compiling optimized from introducing warnings, and to give end-users a warm, fuzzy feeling as they (hopefully) see no warnings come out (except perhaps on the lex output file) even with -Wall. * Renamed getpass() to nmh_getpass() since the prototype for getpass() varies from OS to OS, and we want to _always_ use our version of the function. Fixed all the callers to use nmh_getpass() and added it to prototypes.h. Semi-arbitrarily upped MAX_PASSWORD_LEN from 128 to 256. buf was being calloc()'d and the memory leaked -- should have just been declared as static char array. Prepended "Portions of this code are" to the copyright message, as this version has been changed significantly from the BSD version. * Added "nmh-local functions to use in preference to OS versions" section to README.developers (currently just says to use nmh_getpass() instead of system getpass()). Author: Dan Harkless Date: Tue May 9 19:56:57 2000 +0000 Oops. Forgot to commit this when I made configure changes yesterday. Author: Dan Harkless Date: Tue May 9 08:16:18 2000 +0000 Added steps to README.developers saying to change the version number to X.Y.Z+dev. Did a little rearranging and changed the FTP dir from /home/ftp to /var/ftp to reflect Doug's new machine. Author: Dan Harkless Date: Tue May 9 07:55:58 2000 +0000 Got rid of four warnings in Shantonu's new getpass.c. Needed to #include for calloc(), for ttyname(), and "h/mh.h" for adios(). Also changed ch from char to int to get rid of "comparison is always 1 due to limited range of data type" on EOF. Author: Dan Harkless Date: Tue May 9 07:13:59 2000 +0000 Alphabetized Shantonu's $pop_kinds output on configure's "pop is enabled" line. If POP3 is the only kind of POP enabled, say so, rather than just saying "yes" (which is ambiguous). Author: Dan Harkless Date: Tue May 9 06:53:21 2000 +0000 Shantonu updated the DIFFERENCES file to no longer say that APOP isn't supported, but in so doing, he removed the note that RPOP isn't supported. Put it back. Author: Dan Harkless Date: Tue May 9 06:47:50 2000 +0000 * I had alphabetized the --configure options in the --help output awhile back, but Shantonu added --enable-apop just under --enable-pop. Put it in alphabetical order and clarified what --enable-apop does vs. --enable-pop and --with-krb4. Also changed --with-mts help line from "mail transport agent" to "mail transport agent/service" so the 's' in "mts" doesn't seem to come out of nowhere. * Added two steps to "releasing nmh" in README.developers. After making the tarball, it's a good idea to diff the tree vs. the CVS tree to make sure no files got left out, and then to chown the files so that they're owned by root, preventing a Trojaning attack by a malicious remote user with a UID matching yours. Author: Shantonu Sen Date: Tue May 9 06:27:38 2000 +0000 Updated POP capability to include APOP. Author: Shantonu Sen Date: Tue May 9 06:16:52 2000 +0000 Removed unnecessary comments, such as "*This warning no longer applies*" Author: Shantonu Sen Date: Tue May 9 06:09:05 2000 +0000 Fix some compile-time warnings. Author: Dan Harkless Date: Tue May 9 04:52:55 2000 +0000 Doug informed me that the way I had restored the "lost" version histories was wrong, because `cvs checkout's of old versions of nmh wouldn't work properly. It occurs to me that this could be fixed by simply deleting those tags in the new-location *,v files, but oh well. I'm putting everything back to the way Doug originally had it. To get the old version history for a file that used to be in the top directory, you'll need to "blindly" do a `cvs log' there (even though you won't have a local copy of the file in that directory). `cvs diff' will no longer be able to diff pre-move versions vs. post-move versions -- you'll have to do a lot of manual gyrations with `cvs checkout' and then use `diff'. Author: Dan Harkless Date: Tue May 9 04:08:55 2000 +0000 Okay, now that the old revisions have been recreated, deleting the file. The new version is in the 'docs' subdirectory. Author: Dan Harkless Date: Tue May 9 04:07:15 2000 +0000 This is the nmh-1.0.4 version from 2000-03-15 (I see that I was the one that originally made this change). Author: Dan Harkless Date: Tue May 9 04:05:46 2000 +0000 This is the nmh-1.0.3 version from 2000-01-18 (1.0.2 had no changes). Author: Dan Harkless Date: Tue May 9 04:03:55 2000 +0000 This is the nmh-1.0.1 version from 1999-05-17. Author: Dan Harkless Date: Tue May 9 03:58:04 2000 +0000 For reasons explained better elsewhere (e.g. Attic/README.developers), the version history for this file got lost. Recreating it. This version is from 1998-05-08 -- it's the original nmh-1.0 version. Author: Dan Harkless Date: Tue May 9 03:29:37 2000 +0000 After nmh 1.0.4, moved from top-level 'nmh' directory to 'nmh/docs'. Author: Dan Harkless Date: Tue May 9 03:27:53 2000 +0000 Okay. Removing it now. New location is in 'docs' subdirectory. Author: Dan Harkless Date: Tue May 9 03:25:24 2000 +0000 In the hullaballoo with moving stuff back and forth out of the docs/ directory, and trying to figure out the right way to preserve the old version history, this file's version history prior to the first move into docs/ got wiped. I introduced this file into the project after 1.0.3 was released, and was the only one to modify it until after the 1.0.4 release. The post-1.0.4 changes have survived in docs/README.developers, so I just need to check in the 1.0.4 version and tag it as such, then remove it again, to make a `cvs checkout' of nmh 1.0.4 work again. Author: Dan Harkless Date: Tue May 9 03:18:50 2000 +0000 Man, I'm a retard. Lemme try that again: Just a silly note 'cause I'm vain -- below where it currently says: Someone ("ssen" -- looks like Doug forgot to update a chroot() passwd file It originally said " u i d 6 0 0 0 4 " (or a different number), but minus the spaces. I guess after Doug added ssen into the chroot() passwd, he did a search-and-replace for the UID, which changed my comment as well, making it look like I had no way of determining who ssen was, which is silly. ;^> Author: Dan Harkless Date: Tue May 9 03:12:59 2000 +0000 Just a silly note 'cause I'm vain -- Author: Dan Harkless Date: Tue May 9 02:43:54 2000 +0000 After nmh 1.0.4, moved from top-level 'nmh' directory to 'nmh/docs'. Author: Dan Harkless Date: Tue May 9 02:36:42 2000 +0000 After nmh 1.0.4, moved from top-level 'nmh' directory to 'nmh/docs'. Author: Shantonu Sen Date: Sun May 7 06:59:15 2000 +0000 Updated pop instructions and indicated use of standard "./configure" instead of "sh configure" Author: Shantonu Sen Date: Sun May 7 06:16:43 2000 +0000 An nmh-specific getpass, to remove dependency on system getpass()es, which may or may not do what we want (including flushing input streams, and taking input from stdin in the absence of a controlling tty). Author: Shantonu Sen Date: Sun May 7 06:14:31 2000 +0000 Added getpass to SRCS and OBJS. Author: Dan Harkless Date: Sat May 6 15:53:40 2000 +0000 Removed "installing nmh" section. Moved its note about the DIFFERENCES file up next to the other MH discussion. Changed out-of-date "README" title (should have been "README.history") to "README.about -- about nmh". After committing, I'll rename the file to README.about inside the CVSROOT. Author: Dan Harkless Date: Sat May 6 15:29:19 2000 +0000 Restored lost version histories for those moved files by doing a manual `mv' in the CVSROOT on mhost. CVS badly needs a `cvs mv' command so that you can move files (without having physical access to the CVSROOT) without losing versioning. Put MACHINES back at the top level as it needs to be read before building. Fixed DIST variable in {.,docs}/Makefile.in to reflect that and to add missing entry for "INSTALL" file. Author: Dan Harkless Date: Sat May 6 15:05:02 2000 +0000 Fixed DIST targets to reflect that INSTALL and MACHINES are back at the top level. Author: Dan Harkless Date: Sat May 6 14:54:25 2000 +0000 Files that must be read before building nmh should not go in the docs directory. Moved this file back to the top level (and made a couple of stylistic and grammar tweaks while I was at it). Author: Dan Harkless Date: Sat May 6 14:19:23 2000 +0000 Deleting the versions Doug moved in with `cvs add', erasing the version history, in preparation for moving the original versions in the cvsroot. Author: Doug Morris Date: Sat May 6 11:34:02 2000 +0000 reorganized documentation to make it bit neater again Author: uid1005 Date: Fri Apr 21 17:36:37 2000 +0000 Corrected status printout when kpop is enabled Author: Dan Harkless Date: Tue Apr 18 00:17:50 2000 +0000 One final tweak to the configure --help output for --enable-masquerade. Author: Shantonu Sen Date: Mon Apr 17 22:49:39 2000 +0000 APOP supprt: Added info to ChangLog. Author: Dan Harkless Date: Mon Apr 17 22:09:00 2000 +0000 The syntax I gave in the --help output for --enable-masquerade incorrectly implied that the earlier options were prerequisites for the later options (pointed out by Scott Blachowicz). No compact, non-confusing way to specify the real syntax that I can see, so I'll just remove the []s and leave the explaining about it being okay to specify a subset to the INSTALL file. Also added a TODO item to put in proper parsing of the masquerade: line and/or --enable-masquerade so if you misspell an option you find out about it, rather than just having it silently fail (this weakness was currently only documented in comments in the mts.conf-handling code). Author: Dan Harkless Date: Mon Apr 17 22:04:33 2000 +0000 Someone (unfortunately original version history has been lost so I don't know who) changed "danh" to "your-id". That makes my introductory comment "we'll use version 1.0.4 and my mhost.com account, danh, as examples here" make no sense, though. If danh is going to be "parameterized", then 1.0.4 should be too. Doesn't make sense to parameterize one of the changing items and not the other one. If it's going to be done, danh should be changed to YOUR-ID or something and 1.0.4 (and 1_0_4) should be changed to X.Y.Z (and X_Y_Z). I just thought it'd be clearer to use real values and disclaim that fact up front. Anyhow, putting danh back until such time as someone wants to parameterize both items (and change the introductory text appropriately). Author: Dan Harkless Date: Mon Apr 17 21:25:23 2000 +0000 I had left out aclocal.m4 on the "use this order" line as I didn't think it'd ever need to be changed. Someone ("ssen" -- looks like Doug forgot to update a chroot() passwd file again) added it, but in a separate sentence. That doesn't really make sense -- added it to the main sentence. Also changed my note that none of the mailing lists require you to be subscribed to post -- not true. As I originally thought, the exmh ones do require that -- the bounce messages were just slow in coming. Author: Dan Harkless Date: Mon Apr 17 19:02:11 2000 +0000 Undeleted all the stuff Doug deleted at the top level for now. I think it's bad to lose the CVS revision history, and I don't agree that all of these files should go in the docs/ directory. Unfortunately Doug made modifications to FAQ and README.developers after moving them, and I didn't want to lose his changes, so I just mv'd the ones in the new directory to the top level. This lost the old version history for those two files -- I know there wasn't much to lose for README.developers (I originated the file and was the only one to make modifications to it until Doug's recent change), but I have no idea what information was lost in the FAQ's version history. The right thing to do on those two files probably would have been to re-make Doug's changes in the undeleted old versions and credit them to him in the CVS log. Author: Dan Harkless Date: Mon Apr 17 18:48:03 2000 +0000 Put a note saying that the paths this file refers to (stuff in docs/) are currently wrong. Author: Dan Harkless Date: Mon Apr 17 18:36:59 2000 +0000 Undeleting everything at the top level for now. Doug's comment: Sat Apr 15 10:33:00 2000 Doug Morris * moved the documentation into a "docs" subdirectory. The top-level directory was becoming messy. I also created another file MAILING-LISTS describing the various nmh lists and the archival system, and updated the FAQ to refer to it. I also created a new README in the top level that is basically a list of pointers to the various documentation. The old README I've moved to docs/README.history, since that seemed like the right thing to call it. will be lost, but he can put back a modified version when we agree on what should really go in docs/. Author: Dan Harkless Date: Mon Apr 17 18:34:40 2000 +0000 Undeleting everything at the top level for now. Author: Dan Harkless Date: Mon Apr 17 16:56:57 2000 +0000 Added note that user questions are acceptable on nmh-workers. Author: Shantonu Sen Date: Mon Apr 17 05:29:49 2000 +0000 Added that you should check in aclocal.m4 after acconfig.h, if you change it. Author: Shantonu Sen Date: Mon Apr 17 05:25:18 2000 +0000 APOP support: Making the apop option appear after pop in ./configure --help and committing in the right order to avoid unnecessary autoconfing. Author: Shantonu Sen Date: Mon Apr 17 05:12:14 2000 +0000 Don't try to figure out ruserpass - just use version from sbr/ Author: Shantonu Sen Date: Mon Apr 17 05:09:46 2000 +0000 APOP support: Use the ruserpass function in this directory for all password prompts, instead of using system functions. Author: Shantonu Sen Date: Mon Apr 17 05:08:32 2000 +0000 APOP support: If APOP is enabled, build it into inc and msgchk using $(APOPLIB). Author: Shantonu Sen Date: Mon Apr 17 05:07:03 2000 +0000 APOP support: Making APOP a ./configure option with --enable-apop, and giving more information about the types of POP support in the configuration summary. Author: Shantonu Sen Date: Mon Apr 17 05:04:05 2000 +0000 Adding APOP #defines Author: Shantonu Sen Date: Sun Apr 16 13:28:12 2000 +0000 Changed some string terminations from NULL to \0. Author: Doug Morris Date: Sat Apr 15 04:28:27 2000 +0000 Moved most of the documentation into a new "docs" subdirectory. Added a MAILING-LISTS file talking about the lists and archives, and updated the FAQ to refer to it. Author: Dan Harkless Date: Sat Apr 15 02:00:43 2000 +0000 Added a "releasing nmh" section to README.developers, while the process was fresh in my mind. Author: Dan Harkless Date: Fri Apr 14 21:38:37 2000 +0000 Okay, got that tag stuff straightened out. Now upping the version to 1.0.4+dev. Author: Dan Harkless Date: Fri Apr 14 21:26:56 2000 +0000 Oops. Had a duplicate entry. Author: Dan Harkless Date: Fri Apr 14 21:05:34 2000 +0000 Oops. Didn't do a `cvs rtag` before changing the version to 1.0.4+dev. Putting it back. Author: Dan Harkless Date: Fri Apr 14 20:47:32 2000 +0000 Upped the version number to 1.0.4+dev. Author: Dan Harkless Date: Fri Apr 14 20:40:31 2000 +0000 * Added new files README.developers, ChangeLog_MH-3_to_MH-6.6, and ChangeLog_MH-6.7.0_to_MH-6.8.4.html to DIST target in Makefile.in. * Released nmh-1.0.4. Author: Dan Harkless Date: Wed Apr 12 00:54:54 2000 +0000 Just reworded the bit about '%s' being safe not to quote (it's only safe not to quote on the -charset- line). Author: Dan Harkless Date: Wed Apr 12 00:25:23 2000 +0000 Applied Brian Campbell 's mhn.defaults.sh patch: It appears that there shouldn't be quotes around the %s in the iso-8859-1 charset entry; xterm passes the remaining arguments to the program, quoting them means that xterm thinks they're part of the program's name. %s doesn't come from MIME headers, so not quoting it is safe. Author: Doug Morris Date: Sun Apr 9 07:04:24 2000 +0000 bug fix - prevents core-dumping on scan -format '1' Author: Dan Harkless Date: Fri Apr 7 00:42:55 2000 +0000 Richard Coleman threw out a lot of old MH-specific files in nmh. Much of the stuff, indeed, is not worth saving, but there are nuggets that are very worthwhile, and should probably be added back in. Most important, IMHO, are the MH change logs, as they can help answer questions like "Why is this code like this?" or "How long has this been broken?" or "What was this ever used for?" I've added a new file to the nmh tree called ChangeLog_MH-3_to_MH-6.6. It's cobbled together from the mh-6.8.4/papers/mh*/MHCHANGES files. I've re-ordered the entries to go from newest at the top to oldest at the bottom to match the ChangeLog convention. Unfortunately there are no change logs for versions of MH prior to 3 in the MH tar files available at . Also, it appears to me that there are MH-6.6 changes that aren't documented in the logs. I've also added ChangeLog_MH-6.7.0_to_MH-6.8.4.html. This is based on mh-6.8.4/papers/changes/mh-changes.ms. The nroff format and its "catman"-type output are a pain to deal with, but I was loath to throw away the formatting, so I converted the file to HTML. The only actual markup in the body are the "" and "" tags, and "<" and ">" instead of '<' and '>', so it's quite doable to view the file in plain ASCII mode as well. Note that some of the changes this file documents as having been made in MH-6.8.4 may not be present in nmh -- Richard started with 6.8.3 and later put in certain 6.8.4 stuff. Author: Dan Harkless Date: Thu Apr 6 19:56:35 2000 +0000 Whoah, this should have been changed a long time ago. For one thing, Richard forgot to update the copyright date when he made modifications in 1999, but more significantly, this COPYRIGHT notice hasn't been changed since Richard ceded control of nmh development and it became an open-source project. Changed the COPYRIGHT notice to a BSD License, with a couple of minor wording tweaks. Copyright is assigned to "the authors of nmh", which is anyone who writes code, whether they have CVS accounts or not. Author: Dan Harkless Date: Thu Apr 6 00:22:06 2000 +0000 * Add some way to configure whether you prefer to see text/plain or text/html parts of multipart/alternative messages. Author: Dan Harkless Date: Thu Apr 6 00:11:50 2000 +0000 Applied Eric Schnoebelen 's mhshowsbr.c patch fixing apparent bugs in Dan Winship's new security quoting code: Since upgrading, I've been getting the following errors while attempting to process some MIME messages: (1) Syntax error: Unterminated quoted string exit 2 and: (2) line 1/10 (END)Segmentation fault (core dumped) (2) appears to be due to the testing of an unset pointer in mhshowsbr.c:show_multi_aux(). (1) appears to be caused by mis-quoting a filename being handed to the shell in mhshowsbr.c:show_content_aux(). Resolving the pointer reference issue in mhshowsbr.c:show_multi_aux() turned up a similar mis-quoting problem in the routine. Author: Dan Harkless Date: Fri Mar 31 04:25:26 2000 +0000 Terran Melconian pointed out that my theory as to why -help was printed as "-(help)" in the -help output was probably not the most likely scenario. Added his. ;^> Author: Doug Morris Date: Tue Mar 28 14:42:36 2000 +0000 added Todd Miller's packf patch Author: Dan Harkless Date: Fri Mar 17 20:19:43 2000 +0000 When I applied Wesley Craig's original KPOP patch, I made a change directly to config.h.in. That's a no-no since that file is automatically generated. Now that I've applied Wesley's second patch that makes things work as I had originally documented, I'm re-making the change here, but this time by properly modifying acconfig.h and then generating config.h.in from that. Author: Dan Harkless Date: Fri Mar 17 20:11:03 2000 +0000 wesley.craig@umich.edu did not document his previous KPOP patch, so I did so, and asked him to check what I wrote. Unfortunately he didn't notice my misunderstanding of his patch. I wrote that if you #define POPSERVICE "kpop", inc and msgchk will use KPOP exclusively, but if you leave it as "pop3", you can use Wesley's new -kpop switch on a given invocation. Instead, however, -kpop turned out to be necessary on every invocation, and a KPOP user complained. Applied Wesley's new patch, which makes things work like I thought his original patch did. After that, did one more clarifying pass to the documentation in inc.man and msgchk.man. Author: Dan Harkless Date: Thu Mar 16 02:40:42 2000 +0000 Added a new README.developers file. From the file: This file is intended to provide a few tips for anyone doing development on nmh. Developers who learn things "the hard way" about the nmh codebase (as opposed to local info best encoded in a comment) are encouraged to share their wisdom here. Currently the topics are "autoconf files" and "directory structure". Author: Dan Harkless Date: Wed Mar 15 23:37:30 2000 +0000 When I added my --enable-masquerade option, you'll note that I didn't make it --enable-nmh-masquerade. I find the --enable-nmh-* options too wordy and I'm not sure why Richard went that route. I've renamed them to just --enable-*, but the old versions will still work as well (they just aren't advertised). Added a line to the "nmh configuration" output saying whether POP is enabled. Author: Dan Harkless Date: Wed Mar 15 22:25:16 2000 +0000 When I fixed the long-standing makedir() bugs in January, I had the code call strtoul(..., 0), which I believed to be safe as all modes specified as ASCII constants in the nmh code started with a leading zero (signifying octal), which I did as it would work if internal constants were ever changed to hex. Unfortunately I was unaware of the "Folder-Protect:" .mh_profile entry, which mh-profile.man documents as an octal-only constant, with no leading zero required. I've changed the strtoul() call to an atooi() call and removed the misleading leading zeroes on the ASCII octal constants in the code and man pages. Also changed the "Folder-Protect:" example in the man page to something more interesting than a duplication of the default. Author: Dan Harkless Date: Tue Mar 14 21:21:28 2000 +0000 Added: I put Simon's patch under the control of a new #define called FIX_NON_Y2K_COMPLIANT_MUA_DATES. There's some commentary in acconfig.h about when you might not want to #define it. Author: Dan Harkless Date: Tue Mar 14 21:15:55 2000 +0000 Added missing dependency in zotnet/tws/Makefile.in for dtimep.c: dtimep.c-lexed. Author: Dan Harkless Date: Tue Mar 14 21:07:56 2000 +0000 Created new dtimep.c-lexed with Simon's change using dtimep.lex lexed on Solaris 2.6. Removed my comment about strdup(). The Solaris 2.6 failure was due to failing to do a make distclean after configuring for Ultrix 4.2A. I'll leave the change, though, since it's still a good one (just not worth reporting in the ChangeLog). Author: Dan Harkless Date: Tue Mar 14 20:50:19 2000 +0000 Changed strdup() in strdup.c to take a _const_ char*. Don't know why this didn't hit anyone before, but I wasn't able to compile on Solaris 2.6 without doing this, due to a "previous declaration" error. Author: Dan Harkless Date: Tue Mar 14 20:40:47 2000 +0000 Applied Simon Burge 's dtimep.lex patch: It seems that some MUA's didn't handle y2k very well - ELM seems to be one of them, and Ultrix's DXmail (based on MH!). I've got a few emails this month that look like: 575 Jan 00 Xxxxxx Xxxx 3603 ... and 22+ Jan 00 Xxx Xxxxx 1771 ... The first has "15 Jan 100" as the date and the second has "19 Jan 00" as the date. The following works around this so that scan, show, sortm, etc work ok. Added scan.MMDDYY and scan.YYYYMMDD format files. Author: Dan Harkless Date: Tue Mar 14 09:20:27 2000 +0000 * Applied, after some finessing, Simon Burge 's --with-smtpservers patch: Here's a patch that allows you to add --with-smtpservers= to the ./configure command line to set the "servers: " line in etc/mts.conf. Around here, we use "mailhost" so that all machines in the current domain just talk to a central machine and nothing else runs an MTA. Now, I can use --with-smtpservers=mailhost instead of having to remember to fix this by hand (and often forgetting to do so!). * Inspired by Simon's patch, added an --enable-masquerade option to configure. It will set the "masquerade:" line of mts.conf. You may specify a subset of the three types of masquerading, like --enable-masquerade="draft_from mmailid", or leave off explicit arguments to enable all three types. * Alphabetized the --enable and --with options in configure.in and INSTALL and added documentation of the two new options to the latter. * Added new dependency for mts.conf: Makefile. If this isn't done, then when you reconfigure nmh with new values for --enable-masquerade or --with-smtpservers, you'll fail to get an updated copy of mts.conf. Author: Dan Harkless Date: Tue Mar 14 05:24:57 2000 +0000 Applied Simon Burge 's dtime.c patch: There's a wrap-around problem that affects the implementation of Zeller's congruence in dtime.c. This causes the day-of-week calculations to fail for dates after Feb 29, 2000 (probably up until some year far in the future). Author: Dan Harkless Date: Tue Mar 14 05:05:49 2000 +0000 Modified username_extension masquerading to only use the extended address on generated [Resent-]From: lines and SMTP envelope From:. With Neil's original implementation, nmh's global idea of the username was changed, which would result in inc lying and saying you had no new mail because it was looking for a mailbox called, for instance, "dan-nmh" (where username was "dan" and $USERNAME_EXTENSION was "-nmh"). While in there (adrsprintf()), added checking of snprintf()'s return code and added calls to adios() when things are not kosher. Also simplfied the really confusing REALLYDUMB #ifdef'ing, which didn't even jibe with the comment explaining REALLYDUMB in acconfig.h. Now adrsprintf() will always return just the username, even if an explicit domain is passed in (which currently doesn't happen anywhere in nmh). Author: Dan Harkless Date: Tue Mar 14 02:39:13 2000 +0000 Just removed the odd space between the "!" and the "/bin/sh". I believe some OSes might choke on that, and certainly no OS requires it. Author: Dan Harkless Date: Tue Mar 14 02:29:26 2000 +0000 Applied Sullivan N. Beck 's mhshow-suffix patch: With the patch below, you can add lines like: mhshow-suffix-application/msword: .doc mhshow-suffix-application/PostScript: .ps to the mhn.defaults file to append the given suffix to a scratch file. This allows applications which require a certain suffix to run properly. Removed -force_html from lynx entry in mhn.defaults.sh (I believe older versions of lynx lack that option) and added "mhshow-suffix-text/html: .html". Author: Dan Harkless Date: Mon Mar 6 20:19:04 2000 +0000 Applied Neil W Rickert 's msh.c patch: I finally tracked down the problem in msh that was causing errors whenever I tried to examine a 'mmdf' style mailbox. It turns out that not enough memory was being allocated with calloc(), causing memory pointers to be overwritten and corrupted. Author: Dan Harkless Date: Sat Mar 4 00:02:46 2000 +0000 Changed the new "plussed_user" option to mts.conf's "masquerade:" to "username_extension" after getting feedback from qmail users, who use '-' as a separator rather than '+'. Removed checking of $USERPLUS variable. Now check $USERNAME_EXTENSION, which needs to include the appropriate separator for your MTA ('-', '+', or whatever) as its first character. Author: Dan Harkless Date: Fri Mar 3 07:30:31 2000 +0000 Oops. I was using an older email address for Neil -- now he uses the $USERPLUS feature that I'm crediting him for. ;^> Author: Dan Harkless Date: Fri Mar 3 07:24:41 2000 +0000 Added a new "boolean" type to mh.h and TRUE and FALSE constants. Added a note to DIFFERENCES stating that it's out-of-date (Richard was the last one to update it) and that we should consider only documenting incompatibilities with MH there. Implemented (and documented) a third kind of username masquerading: "plussed user" masquerading. This one was suggested by Neil Rickert . It's based on sendmail's "plussed user" feature, where mail sent to + will be delivered to . When it's enabled, it's controlled by the $USERPLUS environment variable. How is it enabled? Well, that leads me to: Renamed the "mmailid:" setting in mts.conf to "masquerade:", and changed it so that rather than being a boolean, it can be set to any combination of the three values "draft_from", "mmailid", and "plussed_user". Thus it is now possible to enable the three types of masquerading individually. Fixed a bug with "mmailid" masquerading (dating back to MH?) where if it was turned on, ','s would no longer be considered GECOS field delimiters. Author: Dan Harkless Date: Thu Mar 2 08:20:00 2000 +0000 Oops. You can't just change comments in configure.in, or configure won't be modified (it doesn't contain the comments) and you won't be able to commit it, and then the timestamps'll be messed up for everyone and unnecessary autoconf calls will occur. Added some unnecessary (but frequently used in the file) trailing 'dnl's on some AC_SUBST()s. Author: Dan Harkless Date: Thu Mar 2 07:56:00 2000 +0000 Oops. My last group commit comment failed to mention what I was doing in this file. I was adding: * Change all man pages to group all the commandline options together in one section with each as a separate mini-heading. Having to dig through prose to find what a particular option does is a pain in the nads. This time, moved it out of the [POSSIBILITIES] section and put it in the [TODO] section, as I feel it's very important (and wouldn't be that difficult to do -- somewhat time-consuming, yes, but not difficult). Author: Dan Harkless Date: Thu Mar 2 07:52:47 2000 +0000 Changed the GECOS-field '&' translation behavior to be controlled by the BSD42 #define rather than GCOS_HACK, since it's apparently always appropriate on OSes where BSD42 is #defined, and never appropriate on any other OSes. Thanks to Kimmo Suominen for responding to my "What is this code here for?" comment in mts.c and explaining the feature. Also added ULTRIX 4.2A to the list of OSes that have an initgroups() function but no prototype in the system headers. Author: Dan Harkless Date: Tue Feb 29 06:17:58 2000 +0000 Made a goofy change so that I could produce a new configure because when I checked in the last version I did it with "cvs commit ... configure configure.in ..." and that apparently gives configure.in a newer timestamp than configure, which results in spurious autoconf runs when people download the source. We need to write a little note to developers somewhere saying what in order you need to check in those autoconf files and how long you need to wait in between each one and such... Author: Dan Harkless Date: Tue Feb 29 05:59:16 2000 +0000 Changed "echo > stamp-h.in" in Makefile.in to "date > stamp-h.in" so that stamp-h.in will be different each time configure.in and related files are changed, making it easier to check it in (which is necessary to prevent unnecessary autoconf calls). My declaration of initgroups() in slocal.c to eliminate the "no prototype" warning wasn't portable (FreeBSD 3.[23] choked). Now use AC_EGREP_HEADER to see where initgroups() is declared, if anywhere. Author: Dan Harkless Date: Tue Feb 29 05:16:35 2000 +0000 Upped the version number to 1.0.3+dev (ideally this should be done by whoever makes a release tar file, immediately after doing so). Applied Paul Fox 's scansbr.c patch, posted to comp.mail.mh, which he says prevents loss of mail when inc'ing into a full filesystem. Author: Ruud de Rooij Date: Mon Feb 28 17:09:02 2000 +0000 * Fix security hole in mhshowsbr.c which allowed untrusted shell code to be executed. * Released nmh 1.0.3. Author: Dan Harkless Date: Thu Feb 10 18:50:23 2000 +0000 Oops. %-escapes on mhstore lines in mhn.defaults.sh should not be surrounded by single quotes, as a shell is not spawned when just saving files, and the filenames will end up with literal quotes embedded in them. Author: Dan Harkless Date: Fri Feb 4 20:36:43 2000 +0000 Removed an item that Richard did without removing its TODO, and removed an item that was duplicated in two different priority sections. Author: Dan Harkless Date: Fri Feb 4 20:34:07 2000 +0000 Whoever originally added the -help switch to all the commands got too cute and had the option itself print out as "-(help)" in the -help output. I guess the idea was to make reference to the fact that clearly you know about the -help option since you're currently looking at its output. I think it's a bad idea to overload the meaning of the parentheses, however -- they're supposed to indicate what abbreviated prefix of the switch you're allowed to specify. It doesn't make sense to show that you're allowed to "abbreviate" the switch to its entire length. Author: Dan Harkless Date: Fri Feb 4 20:28:23 2000 +0000 Whoever originally added the -help switch to all the commands got too cute and had the option itself print out as "-(help)" in the -help output. I guess the idea was to make reference to the fact that clearly you know about the -help option since you're currently looking at its output. I think it's a bad idea to overload the meaning of the parentheses, however -- they're supposed to indicate what abbreviated prefix of the switch you're allowed to specify. It doesn't make sense to show that you're allowed to "abbreviate" the switch to its entire length. Author: Dan Harkless Date: Fri Feb 4 01:46:29 2000 +0000 Modified INSTALL and config.h.in to reflect the new -kpop feature. Author: Dan Harkless Date: Fri Feb 4 01:32:12 2000 +0000 * Applied wesley.craig@umich.edu's KPOP patches. According to him: The following patch fixes a problem with requesting a service key for a machine that has multiple 'A' records. It also makes "-kpop" a command line option, for users who would like to use both "kpop" and "pop". Did no testing of the new features, as I don't have access to a KPOP server. One tweak I made to the patch he sent to nmh-workers was to move the declaration of his new hp2 variable into the #ifdef KPOP section so you don't get an "unused variable" warning when compiling without KPOP. * Modified inc.man and msgchk.man to document Wesley's new -kpop. Author: Dan Harkless Date: Sat Jan 29 01:34:20 2000 +0000 Added check for lynx to write mhshow-show-text/html line in mhn.defaults.sh. Author: Dan Harkless Date: Fri Jan 28 23:29:06 2000 +0000 Made a couple of minor whitespace changes to test if the latest beta version of CVS fixes this bug: dilvish-dan> cvs commit ../ChangeLog mhn.defaults.sh danh@mhost.com's password: Warning: Remote host denied X11 forwarding, perhaps xauth program could not be run on the server side. cvs: lock.c:179: lock_name: Assertion `*short_repos++ == '/'' failed. Terminated with fatal signal 6 cvs commit: saving log message in /tmp/cvslIx_yb Author: Dan Harkless Date: Fri Jan 28 22:00:33 2000 +0000 All %-escapes in mhn.defaults that actually expand to something should be surrounded by single quotes. Added quotes to the ones in mhn.defaults.sh that were missing them. Author: Dan Harkless Date: Thu Jan 27 20:20:01 2000 +0000 makedir() had multiple bugs dating back to MH. It passed an octal constant to atoi(), which interpreted it as decimal, resulting in directories with no user read or execute permissions, making nested directory creation fail. Also, when creating a nested directory, correct permissions were only set on the inner one. A second `make install' would always fail because the check for whether mh_profile.5 existed was written incorrectly. Author: Dan Harkless Date: Thu Jan 27 20:14:58 2000 +0000 Doug's check for whether mh_profile.5 exists was bad -- it looked in the local directory rather than the installation directory, so the check would always return false and re-installation when mh_profile.5 did exist would bomb out. Author: Dan Harkless Date: Thu Jan 27 20:12:38 2000 +0000 Fixed multiple bugs in makedir(). First off, when creating nested folders, it only set permissions properly on the innermost one. Secondly, it passwd an octal constant to atoi(), which only works on decimal numbers, resulting in directories with no user read or execute permission, making creation of nested dirs fail. Also added a comment wondering why we do special processing when euid != uid. If no one disagrees with my comments, I'll remove that weird code in the future. Author: Dan Harkless Date: Wed Jan 26 21:35:43 2000 +0000 Dan Winship informed me that the right fix when gcc -Wall complains about char indexes to arrays is to cast to unsigned char, not int. You want to prevent negative indexes into the array. Author: Dan Harkless Date: Wed Jan 26 10:16:32 2000 +0000 Added documentation on both types of masquerading to post's man page. Also clarified some wording and added a note that the new type of masquerading has been implemented only for post, not for the undocumented spost backend. Author: Dan Harkless Date: Wed Jan 26 10:14:14 2000 +0000 Expanded the mention of the $SIGNATURE environment variable to talk about the three different ways to override "From:" header construction. Also added mh-tailor(5) to the "SEE ALSO" section. Author: Dan Harkless Date: Wed Jan 26 09:27:59 2000 +0000 Just added a comment explaining that akvalue() does mh alias substitution. Author: Dan Harkless Date: Wed Jan 26 09:26:23 2000 +0000 I had my envelope-From:-setting in the wrong place in the code, before alias processing was done. Put it in the right place, and properly implemented Resent-From:-handling, which I had neglected before. Author: Dan Harkless Date: Wed Jan 26 09:24:15 2000 +0000 Added a comment bemoaning the lack of aliasing on the From: header and explaining why I wasn't going to bother implementing my new draft-From:-based email address masquerading right now. Author: Dan Harkless Date: Wed Jan 26 06:51:50 2000 +0000 Doug's portability fix of my setgid inc autodetection had a caching bug -- if you re-ran configure, uip/Makefile would be corrupted, and installation would fail on OSes where inc needs to be setgid. Implemented a new kind of email address masquerading. When a user writes a custom "From:" header in a draft, nmh uses it rather than generating one. However, the user's true address is used in the SMTP envelope "From:" and is revealed in the "Sender:" header. Now, when mmailid is set to non-zero, the envelope "From:" uses the address specified in the draft "From:" header, and there is no "Sender:" header. This is useful when sending on behalf of a remote POP3 account or when remote mail robots incorrectly use the envelope "From:" in preference to the body "From:". Author: Dan Harkless Date: Wed Jan 26 06:39:49 2000 +0000 I'm surprised this didn't hit anyone sooner. Doug's portability fix of my setgid inc autodetection didn't do its caching properly. It cached the variable $nmh_cv_ls_mail_grp (previously $nmh_group_mailspool), but did substitution on $MAIL_SPOOL_GRP (previously $MAILGROUP) without setting the latter to the former. That meant that when re-running configure, $MAIL_SPOOL_GRP would be NULL, so the $(MAIL_SPOOL_GRP) Make variable would be NULL, and installation would fail with the error "install: 2755 does not exist" (since the argument to -g was missing). Author: Dan Harkless Date: Wed Jan 26 05:40:30 2000 +0000 Implemented a new type of username masquerading, which is also activated by setting mmailid to non-zero in mts.conf. The new type is based on the From: header in the message draft rather than the GECOS field of the passwd file like the old type. With mmailid turned off, when a user specifies a custom From: header in a draft, it'll be used, but the user's real address will be revealed in the SMTP envelope From: and in the Sender: header. With mmailid on, this revelation is disabled. Also copied to here my new comment from mh.h explaining (if I understand it correctly) the functionality of struct swit's minchars field. Also, changed the minchars for "help" from 4 to 0. It doesn't make sense to use a positive integer that's the exact length of the option. That'll make it print out like "-(help)". The parentheses are supposed to go around the minimum part of the option you need to specify when abbreviating it. Perhaps someone thought it would be cute to put "help" in parentheses to imply that you know about it already as you just specified it be seeing the current output, but I think this "overloading" of the meaning of the parentheses is awkward. I need to go around and change "help" to 0 everywhere, but it's getting too late to do it tonight. Also added some other explanatory comments to existing code. Author: Dan Harkless Date: Wed Jan 26 05:28:33 2000 +0000 Updated to reflect that there are now two types of username masquerading (GECOS-based, the old one, and draft-From:-based, the new one). Also clarified existing wording. Author: Dan Harkless Date: Wed Jan 26 05:03:07 2000 +0000 Documented the minchars field of struct swit to the best of my understanding. Author: Dan Harkless Date: Wed Jan 26 05:01:06 2000 +0000 Modified the mmailid comment to reflect that there are now two types of masquerading (wouldn't want sysadmins to not realize that by allowing one, they're allowing the other). I also prefer my new wording of "allow" vs. the old "turn on" because the latter implied that masquerading would take effect just by setting that variable (not the case unless /etc/passwd had been previously modified to have the s). Author: Dan Harkless Date: Wed Jan 26 04:57:57 2000 +0000 Whoever changed all the references to nmh-workers@math.gatech.edu to nmh-workers@mhost.com missed this file. Author: Dan Harkless Date: Wed Jan 26 04:54:30 2000 +0000 Changed Mmailids to an extern so that we can access it from post.c to see if we should do the new draft-From:-based masquerading. Also clarified some comments now that there are two different types of masquerading. Author: Dan Harkless Date: Tue Jan 25 21:06:09 2000 +0000 Just clarified a couple of points in my last change description. Author: Dan Harkless Date: Tue Jan 25 07:45:10 2000 +0000 The prototype I gave for initgroups() which was documented in the AIX 4.1 info page conflicted with the real one that comes from grp.h on Solaris 2.6. Adjusted it so the local prototype is correct on both (hopefully all) platforms. Also added an include of , which is where initgroups() lives on HP-UX 10.20. Author: Dan Harkless Date: Tue Jan 25 07:10:25 2000 +0000 I kept going back and forth checking in new pointless revisions of configure[.in], but it now looks like the problem was that stamp-h.in was older than configure.in (or maybe there were two problems). Hopefully this'll get rid of the needless auto* calls. Author: Dan Harkless Date: Tue Jan 25 06:56:25 2000 +0000 Shoot. Apparently it gets the timestamp from the check-in time rather than preserving the actual timestamp on the file when you check it in, so the timestamp was the same for configure.in and configure, so the Makefile was doing an autoconf just in case. This time I'm checking in configure.in first and configure at least a second later. What a pain. Author: Dan Harkless Date: Tue Jan 25 06:46:13 2000 +0000 Accidentally checked in configure with older date than configure.in, but I hadn't made changes to configure.in that would result in a different configure, so I can't check one in with the right timestamp. Therefore, I made a meaningless change to configure.in (adding a "dnl" to the end of line that was like others that had "dnl" at the end but didn't have one itself) and regenerated configure. Author: Dan Harkless Date: Tue Jan 25 06:21:38 2000 +0000 The conditional definition of the "np" variable didn't make any sense. It was only defined if HAVE_GETHOSTBYNAME was defined and only used when HAVE_GETHOSTBYNAME wasn't defined. I'm kind of surprised that never blew up anywhere. Changed the definition conditional to match the usage conditional. Author: Dan Harkless Date: Tue Jan 25 06:19:51 2000 +0000 Got rid of the rest of the warnings that I didn't have time for on 1999-07-15 (and, it would seem, some new ones people introduced since then). The primary ones were the warnings that default prototypes were being used for [v]snprintf() and str[n]casecmp(). As of right now, there are _no_ compilation warnings except on the lex output file (at least under AIX 4.1.5 and Solaris 2.6). Author: Dan Harkless Date: Tue Jan 25 06:18:54 2000 +0000 On AIX 4.1, snprintf() is defined in libc.a but there's no prototype in or elsewhere. Apparently it's not officially supported (though it seems to work perfectly and IBM apparently uses it in internal code). Anyhow, if we omit our own snprintf() and vsnprintf() prototypes when we HAVE_SNPRINTF, we get a billion warnings at compile time. Use the C preprocessor to preprocess stdio.h and make sure that there's actually a prototype. Define HAVE_SNPRINTF_PROTOTYPE if so, and use that to control our local prototype definition. Also, define strcasecmp() and strncasecmp() here all the time since we define our own versions and always use them. The only way we could get into trouble doing this would be if the vendor's versions didn't have the same parameters, but I don't see that happening. If we don't define them here, we get warnings all over the place that default prototypes are being used for 'em, and the system header to include varies from OS to OS. Author: Dan Harkless Date: Tue Jan 25 06:13:38 2000 +0000 On AIX 4.1, snprintf() is defined in libc.a but there's no prototype in or elsewhere. Apparently it's not officially supported (though it seems to work perfectly and IBM apparently uses it in internal code). Anyhow, if we omit our own snprintf() and vsnprintf() prototypes when we HAVE_SNPRINTF, we get a billion warnings at compile time. Use the C preprocessor to preprocess stdio.h and make sure that there's actually a prototype. Define HAVE_SNPRINTF_PROTOTYPE if so, and use that to control our local prototype definition. Author: Dan Harkless Date: Tue Jan 25 06:06:18 2000 +0000 Added include of signals.h for SIGNAL() prototype. Author: Dan Harkless Date: Tue Jan 25 06:04:29 2000 +0000 Added include of mh.h for snprintf() prototype. Author: Dan Harkless Date: Tue Jan 25 06:00:22 2000 +0000 Added include of mh.h to get snprintf() prototype and changed all references to getcpy() to our_getcpy() to prevent conflict with the external one. Author: Dan Harkless Date: Tue Jan 25 05:58:26 2000 +0000 Put in a prototype for stdio internal function _filbuf() to get rid of the "default prototype" warning (only do this when we didn't #define it to something specific due to another #define telling us to do so). Author: Dan Harkless Date: Tue Jan 25 05:55:20 2000 +0000 Put in a prototype for client() to get rid of the "default prototype" warning. The prototype should really go in a new client.h file or somewhere, but I don't have time right now for that. Author: Dan Harkless Date: Tue Jan 25 05:53:40 2000 +0000 Typecast to get rid of warnings that index into cc[] is a char. Author: Dan Harkless Date: Tue Jan 25 05:52:31 2000 +0000 Put in prototype for initgroups() to get rid of "default prototype" warning. On AIX 4.1, at least, the function exists in libc.a but doesn't exist in any .h. Author: Dan Harkless Date: Tue Jan 25 05:50:12 2000 +0000 Typecast to get rid of warnings that array index into types[] is a char. Author: Ruud de Rooij Date: Thu Jan 6 21:30:07 2000 +0000 * Move mhtest from bindir to libdir. * Move sendfiles from libdir to bindir. * Updated sendfiles manpage to reflect this change. * Added documentation for -build and -file switches to repl and forw manpages (patch from Peter Maydell). * Fixed interaction between specifying -cc in profile and -group on command-line. Author: Dan Harkless Date: Thu Nov 11 01:01:07 1999 +0000 * Add command to reverse the action of rmm [-nounlink] -- "urmm"? "umm"? "um"? * Allow user customization of which kinds of text parts in multipart/alternative messages are preferred. It would be nice if one selectable behavior would be to be prompted at runtime for which version to show. * Add a new %-escape that makes temp files more permanent than %f, so that you can use gnuclient -q or netscape -remote on message parts. Put netscape -remote in mhn.defaults for text/html once this is done. Author: Dan Harkless Date: Tue Nov 2 21:49:47 1999 +0000 Changed the version number from 1.0.3 to 1.0.2+dev. There was not unanimous support for my proposed even/odd release/developer version number dichotomy. 1.0.2+dev implies release 1.0.2 plus some development. Author: Dan Harkless Date: Fri Oct 29 20:42:13 1999 +0000 Upped the version number to 1.0.3. If we don't do this, then when people report bugs against 1.0.2, we won't know "which" 1.0.2 they're talking about (since the development source is publically available via CVS). I think the Linux kernel version numbers are a good model, so the next time we roll a tarball, it should be version 1.0.4 (or higher -- anyhow, an even-numbered version). Author: Doug Morris Date: Fri Oct 29 05:10:18 1999 +0000 updated INSTALL directions Author: Doug Morris Date: Fri Oct 29 04:49:01 1999 +0000 release nmh-1.0.2 Author: Doug Morris Date: Fri Oct 29 04:32:50 1999 +0000 updated the TODO list and bumped the revision to 1.0.2. Author: Doug Morris Date: Wed Oct 27 05:21:12 1999 +0000 fixed test in Makefiles for LIBTOOL for the case where it doesn't exist Author: Doug Morris Date: Tue Oct 26 21:12:36 1999 +0000 fixed libtool check, sort of... Author: Doug Morris Date: Thu Oct 21 18:59:35 1999 +0000 changes to allow building under Mac OS X/Rhapsody Author: Ruud de Rooij Date: Sun Oct 17 17:39:22 1999 +0000 * Changed repl defaults to partly revert to MH behaviour: "-cc all" is now only implied with -group. * The replcomps template includes cc: header again (as in MH). * Updated repl man page to reflect these changes. Author: Doug Morris Date: Sat Oct 16 00:56:05 1999 +0000 sunos/solaris modifications Author: Doug Morris Date: Fri Oct 15 22:38:55 1999 +0000 replaced the BIND guess (based on BSDishness) with checks for gethostbyname and sethostent Author: Doug Morris Date: Wed Oct 13 14:56:41 1999 +0000 fixed bug in mh-profile/mh_profile manpage link - it did not check first Author: Doug Morris Date: Wed Oct 13 13:58:41 1999 +0000 updated manpage's Makefile and modified the way configure tests to see whether it should define LINUX_STDIO. Author: Dan Harkless Date: Mon Oct 4 22:23:29 1999 +0000 Added '-L' to the calls of 'ls' in configure.in -- I have seen multiple machines in the past where the mail spool was a symlink to a directory on another device with more free space. Author: Dan Harkless Date: Sat Oct 2 06:00:54 1999 +0000 * Fixed a portability problem in Doug's fix of a portability problem in my MAILGROUP autoconf support ('ls -l' vs. 'ls -lg'). Author: Dan Harkless Date: Sat Oct 2 06:00:11 1999 +0000 I didn't like the double use of "MAILGROUP" for two different variables used in different languages, with different values. I renamed Doug's new Makefile "MAILGROUP" to MAIL_SPOOL_GRP. Author: Dan Harkless Date: Sat Oct 2 05:57:23 1999 +0000 Touched because I changed configure.in. Author: Dan Harkless Date: Sat Oct 2 05:55:54 1999 +0000 Doug's fix for my MAILGROUP autoconf support on his platform (yep, I was ignorant about that "wheel" group) broke it on my platforms (AIX 4.1.5.0.01 and Solaris 2.6). `ls -lg` doesn't do what Doug was expecting on these platforms -- it displays _only_ the group rather than the user and the group (thus awk '{print $4}' did the wrong thing). Also did some miscellaneous cleanup, like making variables that were intended to be cached actually be cached (renamed to nmh_cv_*, etc.), and using the $AWK that we've auto-detected rather than relying on the $PATH to find one. Author: Ruud de Rooij Date: Sun Sep 26 17:45:55 1999 +0000 * Added config.sub and config.guess to the list of files to be distributed. * Fixed bug in sbr/fmt_scan.c where an extra newline would be added if a list of addresses was split over several header lines. * In mts/smtp/smtp.c, undefine strlen and strcpy if they are macros, regardless of platform. * Allow q to quit mhshow, and n to skip to next part. Patch from Kimmo Suominen . * Modified mhstore to recognize attachments created by sendfiles with x-conversions=gzip. Author: Doug Morris Date: Mon Sep 13 19:23:29 1999 +0000 moved canonical guesses back into user config section of config.h Author: Doug Morris Date: Mon Sep 13 18:20:28 1999 +0000 updates to post.c and termsbr.c that prevent warnings on OpenBSD Author: Doug Morris Date: Sun Sep 12 13:50:11 1999 +0000 Lots of little code cleanups to prevent warnings - mostly making sure some function prototypes are available at compile time. Also fixed Makefile.in so that make nmhdist will work -- it just blew up after COMPLETION-TCSH was added and ZSH-COMPLETION was changed to COMPLETION-ZSH. Author: Doug Morris Date: Sun Sep 12 07:19:40 1999 +0000 updating changelog, should have been done with last commit Author: Doug Morris Date: Sun Sep 12 06:44:02 1999 +0000 fix for configure to find db1/ndbm.h in new linux systems Author: Doug Morris Date: Fri Sep 10 05:22:40 1999 +0000 configure, configure.in stamp-h.in, and uip/Makefile.in modified to fix MAILGROUP test. m_getfld.c - added the patch submitted by Richard Cohen to fix crashing when mh_profile has no trailing newline. smtp.c, lock_file.c, m_scratch.c, m_tmpfil.c, mhscmds.c, rcvtty.c, and spost.c modified to fix mkstemp bugs. Some I've simply commented out because the repair requries either creating another new tempfile function (there are 3 already) or cleaning up the existing tmpfile functions and all the calls to them. I'm opting for the latter but it will take a while. Author: Dan Harkless Date: Tue Sep 7 23:45:20 1999 +0000 Renamed ZSH.COMPLETION to COMPLETION-ZSH and added COMPLETION-TCSH. Author: Dan Harkless Date: Tue Sep 7 23:41:37 1999 +0000 New file along the lines of the old ZSH.COMPLETION, but for tcsh. Pretty bare right now. Author: Dan Harkless Date: Tue Sep 7 23:34:00 1999 +0000 Renamed to COMPLETION-ZSH so it'll alphabetize next to new COMPLETION-TCSH. Author: Dan Harkless Date: Tue Sep 7 23:29:14 1999 +0000 Renamed from ZSH.COMPLETION so it'll alphabetize next to new COMPLETION-TCSH. Author: Dan Harkless Date: Wed Aug 18 00:05:24 1999 +0000 Crap. That's what I get for using vi instead of xemacs for a change. Inserted missing newline. Author: Dan Harkless Date: Wed Aug 18 00:01:28 1999 +0000 Just adding some text to this file so that cvs will see a difference and let me check it in. Every time acconfig.h or configure.in are changed (which I just did), the timestamp on this file needs to be updated or when people do a make an unnecessary `cd . && autoheader` will be done, and not everybody has the autoconf tools installed. The next person to change those two files (or aclocal.m4) will need to change this text, maybe just to a message saying which dependency files were changed and by whom. Author: Dan Harkless Date: Tue Aug 17 23:31:23 1999 +0000 Automated #define of MAILGROUP and installation of inc as setgid mail when the mail spool directory isn't world-writable. Author: Dan Harkless Date: Tue Aug 17 23:15:31 1999 +0000 Automated #define of MAILGROUP and installation of inc as setgid mail when the mail spool directory isn't world-writable. Author: Dan Harkless Date: Tue Aug 17 23:12:42 1999 +0000 Just removed some useless whitespace that [X]Emacs' Make mode highlights as being semi-bogus. Author: Dan Harkless Date: Tue Aug 17 23:09:46 1999 +0000 Automated #define of MAILGROUP and installation of inc as setgid mail when the mail spool directory isn't world-writable. Author: Dan Harkless Date: Fri Jul 16 01:39:09 1999 +0000 * slocal -debug used to leave a copy of each message processed in /tmp. * Got rid of a ton of compilation warnings output by gcc -Wall. * rcvdistcomps no longer has "Resent-Fcc: outbox"; new rcvdistcomps.outbox does. Author: Dan Harkless Date: Fri Jul 16 01:30:05 1999 +0000 Eliminated compilation warnings. Author: Dan Harkless Date: Fri Jul 16 01:19:29 1999 +0000 Eliminated unsued sigset_t variables set and oset. Author: Dan Harkless Date: Fri Jul 16 01:16:08 1999 +0000 Previously contained the code: if (numburst == 0) if (!quietsw) admonish (NULL, "message %d not in digest format", msgnum); else adios (NULL, "burst() botch -- you lose big"); If the indentation is to be believed, this is a bug. I trusted the indentation and added {}s around the inner if(). Author: Dan Harkless Date: Fri Jul 16 01:13:05 1999 +0000 Eliminated compilation warnings. pop_action() and pop_pack() used to return garbage. They now (arbitrarily) return 0. Dunno if their return values are ever used... Author: Dan Harkless Date: Fri Jul 16 01:11:44 1999 +0000 Eliminated compilation warnings. Author: Dan Harkless Date: Fri Jul 16 01:03:34 1999 +0000 donote() previously was written such that it could return garbage. Author: Dan Harkless Date: Fri Jul 16 01:01:24 1999 +0000 err2peer() previously returned garbage. Now it returns result of callee verr2peer(). Author: Dan Harkless Date: Fri Jul 16 00:59:36 1999 +0000 Eliminated compilation warnings. Author: Dan Harkless Date: Fri Jul 16 00:53:17 1999 +0000 Eliminated compilation warnings. Author: Dan Harkless Date: Fri Jul 16 00:52:20 1999 +0000 Eliminated compilation warnings. slocal -debug left a file in /tmp for every single message it processed! Totally unacceptable since some people like to have slocal -debug in their .forward files to get better logging. Author: Dan Harkless Date: Fri Jul 16 00:50:01 1999 +0000 Changed done() from returning void to returning int so that main()s who call done() at the end can instead return done() at the end to eliminate the compilation warning about falling off the end of a non-void function. Author: Dan Harkless Date: Fri Jul 16 00:48:59 1999 +0000 Changed from returning void to returning int so that main()s who call done() at the end can instead return done() at the end to eliminate the compilation warning about falling off the end of a non-void function. Author: Dan Harkless Date: Fri Jul 16 00:47:33 1999 +0000 Changed call of done() to return of done() to eliminate compilation warning. Author: Dan Harkless Date: Fri Jul 16 00:44:40 1999 +0000 I think it's totally inappropriate for the default rcvdistcomps to save all outgoing messages in an "outbox" folder. I have made a new file called rcvdistcomps.outbox which looks like this file used to. Author: Dan Harkless Date: Fri Jul 16 00:43:04 1999 +0000 New $(DIST_FILES) entry: rcvdistcomps.outbox. Author: Dan Harkless Date: Fri Jul 16 00:40:35 1999 +0000 I renamed the old rcvdistcomps to rcvdistcomps.outbox and removed the "Resent-Fcc: outbox" line from rcvdistcomps. Author: Doug Morris Date: Sat Jun 12 09:29:45 1999 +0000 added my name to the change Author: Doug Morris Date: Sat Jun 12 09:26:50 1999 +0000 added explanation of change made two nights ago. Author: Doug Morris Date: Wed Jun 9 20:51:59 1999 +0000 use mkstemp on systems that have it Author: Doug Morris Date: Thu May 13 14:42:34 1999 +0000 Added notes about the configure change. Author: Doug Morris Date: Thu May 13 14:28:25 1999 +0000 Modified configure to use config.guess and config.sub to auto-detect the system type and correctly set the #defines in config.h. Author: Dan Harkless Date: Thu May 13 03:42:11 1999 +0000 1.0.1 Author: Dan Harkless Date: Thu May 13 01:32:53 1999 +0000 1.0.1 patches Author: Dan Harkless Date: Thu May 13 01:31:47 1999 +0000 Update for the brave new world Author: Dan Harkless Date: Thu May 13 01:31:00 1999 +0000 Use "#include " instead of "extern int errno;". Suggested by Stephen Wilson Bailey Author: Dan Harkless Date: Thu May 13 01:28:40 1999 +0000 add a note about Irix make Author: Dan Harkless Date: Thu May 13 01:28:16 1999 +0000 man page updates from Jerry Peek Author: Dan Harkless Date: Thu May 13 01:26:41 1999 +0000 deal with SIGPIPE so mhl doesn't print "Broken pipe" if you quit out of the moreproc Author: Dan Harkless Date: Thu May 13 01:25:52 1999 +0000 Fixed a signal-handling bug that could cause whatnow to sometimes exit without prompting the user. Based on a patch by Richard Geiger . Author: Dan Harkless Date: Thu May 13 01:24:47 1999 +0000 Changed configure.in's check for sigsetjmp to properly deal with systems like Linux where it is a macro. From . Author: Dan Harkless Date: Thu May 13 01:22:54 1999 +0000 Added -library switch so it can parse user aliases like post does. From Ruud de Rooij . Author: Dan Harkless Date: Thu May 13 01:22:03 1999 +0000 Don't add line breaks in the middle of long addresses when building a draft. Fixes a bug where repl would generate invalid headers. From Ruud de Rooij . Author: Dan Harkless Date: Thu May 13 01:17:23 1999 +0000 Allow display of 8bit encoded messages. From Kimmo Suominen . Author: Dan Harkless Date: Thu May 13 01:16:14 1999 +0000 Change ordering of a conditional to prevent a bad pointer dereference. Fixes a segv in inc (and occasionally other programs). Originally from Ruud de Rooij Author: Dan Harkless Date: Thu May 13 01:13:58 1999 +0000 Fix a buffer overrun that caused packf -mbox to mess up on Return-Path: lines. From Kimmo Suominen Author: Dan Harkless Date: Thu May 13 01:12:12 1999 +0000 Make whatnow "list" work with "lproc: show" again. From Ruud de Rooij Author: Dan Harkless Date: Thu May 13 01:10:45 1999 +0000 add HAVE_LIBM Author: Dan Harkless Date: Thu May 13 01:07:15 1999 +0000 Add check for modf and link with -lm if it's not in libc. Needed for at least Digital UNIX. Problem noted by Kevin Oberman Author: Dan Harkless Date: Thu May 13 01:05:49 1999 +0000 Fix krb4 code to work with the original krb4 libraries as well as the krb5-compat ones. Based on a patch by Assar Westerlund Author: Dan Harkless Date: Thu May 13 01:03:23 1999 +0000 Properly deal with relative folder names. Problem noted by Jerry Peek Author: Doug Morris Date: Fri Apr 30 18:08:34 1999 +0000 Initial revision nmh-1.5/compile000755 007761 000765 00000007173 11765270216 013467 0ustar00kenhkenh000000 000000 #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: nmh-1.5/config/000777 007761 000765 00000000000 11765271326 013355 5ustar00kenhkenh000000 000000 nmh-1.5/config.guess000755 007761 000765 00000126260 11765270216 014430 0ustar00kenhkenh000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: nmh-1.5/config.h.in000644 007761 000765 00000014306 11765270215 014127 0ustar00kenhkenh000000 000000 /* config.h.in. Generated from configure.ac by autoheader. */ /* The prefix that is prepended to the name of message files when they are "removed" by rmm. This should typically be `,' or `#'. */ #undef BACKUP_PREFIX /* Define to use the Cyrus SASL library for authentication of POP and SMTP. */ #undef CYRUS_SASL /* Define to use dot based file locking. */ #undef DOT_LOCKING /* Define to use fnctl() based locking. */ #undef FCNTL_LOCKING /* Define to use flock() based locking. */ #undef FLOCK_LOCKING /* Define to 1 if `TIOCGWINSZ' requires . */ #undef GWINSZ_IN_SYS_IOCTL /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getutxent' function. */ #undef HAVE_GETUTXENT /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_ICONV_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `lockfile' library (-llockfile). */ #undef HAVE_LIBLOCKFILE /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `ssl' library (-lssl). */ #undef HAVE_LIBSSL /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT /* Define to 1 if you have the `mbtowc' function. */ #undef HAVE_MBTOWC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_TERMCAP_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if `d_type' is member of `struct dirent'. */ #undef HAVE_STRUCT_DIRENT_D_TYPE /* Define to 1 if `tm_gmtoff' is member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_GMTOFF /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STREAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMCAP_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if you have the `wcwidth' function. */ #undef HAVE_WCWIDTH /* Define to 1 if you have the `writev' function. */ #undef HAVE_WRITEV /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Use the Linux _IO_*_ptr defines from . */ #undef LINUX_STDIO /* Undefine if you don't want locale features. By default this is defined. */ #undef LOCALE /* Directory to store dot-locking lock files */ #undef LOCKDIR /* Define to use lockf() based locking. */ #undef LOCKF_LOCKING /* Define to 1 if you need to make `inc' set-group-id because your mail spool is not world writable. There are no guarantees as to the safety of doing this, but this #define will add some extra security checks. */ #undef MAILGROUP /* Define to enable support for multibyte character sets. */ #undef MULTIBYTE_SUPPORT /* Define to the header containing the ndbm API prototypes. */ #undef NDBM_HEADER /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Support for using readline() in whatnow */ #undef READLINE_SUPPORT /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if tgetent() accepts NULL as a buffer. */ #undef TGETENT_ACCEPTS_NULL /* Define to what tgetent() returns on success (0 on HP-UX X/Open curses). */ #undef TGETENT_SUCCESS /* Support TLS for session encryption. */ #undef TLS_SUPPORT /* Version number of package */ #undef VERSION /* Define to 1 if `struct winsize' requires . */ #undef WINSIZE_IN_PTEM /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `int' if does not define. */ #undef mode_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t nmh-1.5/config.sub000755 007761 000765 00000077460 11765270216 014102 0ustar00kenhkenh000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-09-20' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: nmh-1.5/configure000755 007761 000765 00001156122 11765270215 014017 0ustar00kenhkenh000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for nmh 1.5. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='nmh' PACKAGE_TARNAME='nmh' PACKAGE_VERSION='1.5' PACKAGE_STRING='nmh 1.5' PACKAGE_BUGREPORT='nmh-workers@nongnu.org' ac_unique_file="h/nmh.h" ac_default_prefix=/usr/local/nmh # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='READLINELIB SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os DATE MTS pagerpath smtpservers CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE DISABLE_UNUSED_MACROS_WARNING DISABLE_SIGN_COMPARE_WARNING RANLIB SED LEX LEX_OUTPUT_ROOT LEXLIB cutpath MD5SUM MD5FMT linttmp1 linttmp2 LINT LINTFLAGS lspath sendmailpath vipath editorpath mailspool CPP GREP EGREP dotlockfilepath SETGID_MAIL MAIL_SPOOL_GRP TERMLIB ICONVLIB NDBM_LIBS rpmdir SASLLIB SIGNAL_H LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures nmh 1.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/nmh] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of nmh 1.5:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug enable nmh code debugging --disable-locale turn off locale features --enable-lockdir=dir Store dot-lock files in "dir" --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-cyrus-sasl Enable SASL support via the Cyrus SASL library --with-tls Enable TLS support --with-editor=EDITOR specify the default editor --with-hash-backup use # as the backup prefix (default: ,) --with-locking=[dot|fcntl|flock|lockf] specify the file locking method --with-mts=[smtp|sendmail] specify the default mail transport agent/service --with-pager=PAGER specify the default pager --with-smtpservers='SMTPSERVER1[ SMTPSERVER2...]' specify the default SMTP server(s) [localhost] --with-readline enable readline editing for whatnow (default=maybe) --with-ndbm=ARG use -lARG to link with ndbm --with-ndbmheader=ARG #include to use ndbm --with-rpmdir=RPMDIR RPM build directory [RPM] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF nmh configure 1.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by nmh $as_me 1.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='nmh' VERSION='1.5' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: configuring for nmh-1.5" >&5 echo "$as_me: configuring for nmh-1.5" >&6;} VERSION=1.5 DATE=`cat ${srcdir}/DATE` { echo "$as_me:$LINENO: configuring for nmh dated $DATE" >&5 echo "$as_me: configuring for nmh dated $DATE" >&6;} # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; fi if test x"$enable_nmh_debug" = x"yes"; then enable_debug=yes fi # Check whether --enable-locale was given. if test "${enable_locale+set}" = set; then enableval=$enable_locale; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define LOCALE 1 _ACEOF fi else cat >>confdefs.h <<\_ACEOF #define LOCALE 1 _ACEOF fi # Check whether --with-cyrus-sasl was given. if test "${with_cyrus_sasl+set}" = set; then withval=$with_cyrus_sasl; fi if test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != x"no"; then cat >>confdefs.h <<\_ACEOF #define CYRUS_SASL 1 _ACEOF if test x"$with_cyrus_sasl" != xyes; then { echo "$as_me:$LINENO: WARNING: Arguments to --with-cyrus-sasl now ignored" >&5 echo "$as_me: WARNING: Arguments to --with-cyrus-sasl now ignored" >&2;} { echo "$as_me:$LINENO: WARNING: Please pass the appropriate arguments to CPPFLAGS/LDFLAGS" >&5 echo "$as_me: WARNING: Please pass the appropriate arguments to CPPFLAGS/LDFLAGS" >&2;} fi sasl_support=yes else sasl_support=no fi # Check whether --with-tls was given. if test "${with_tls+set}" = set; then withval=$with_tls; fi if test x"$with_tls" != x -a x"$with_tls" != x"no"; then cat >>confdefs.h <<\_ACEOF #define TLS_SUPPORT 1 _ACEOF tls_support=yes else tls_support=no fi # Check whether --with-editor was given. if test "${with_editor+set}" = set; then withval=$with_editor; fi if test -n "$with_editor"; then editorpath="$with_editor" fi # Check whether --with-hash-backup was given. if test "${with_hash_backup+set}" = set; then withval=$with_hash_backup; fi if test x"$with_hash_backup" != x -a x"$with_hash_backup" != x"no"; then backup_prefix="#" else backup_prefix="," fi cat >>confdefs.h <<_ACEOF #define BACKUP_PREFIX "$backup_prefix" _ACEOF # Check whether --with-locking was given. if test "${with_locking+set}" = set; then withval=$with_locking; fi if test x"$with_locking" = x"dot"; then LOCKTYPE="dot" cat >>confdefs.h <<\_ACEOF #define DOT_LOCKING 1 _ACEOF elif test x"$with_locking" = x"flock"; then LOCKTYPE="flock" cat >>confdefs.h <<\_ACEOF #define FLOCK_LOCKING 1 _ACEOF elif test x"$with_locking" = x"lockf"; then LOCKTYPE="lockf" cat >>confdefs.h <<\_ACEOF #define LOCKF_LOCKING 1 _ACEOF elif test x"$with_locking" = x"fcntl"; then LOCKTYPE="fcntl" cat >>confdefs.h <<\_ACEOF #define FCNTL_LOCKING 1 _ACEOF else LOCKTYPE="dot" cat >>confdefs.h <<\_ACEOF #define DOT_LOCKING 1 _ACEOF fi # Check whether --enable-lockdir was given. if test "${enable_lockdir+set}" = set; then enableval=$enable_lockdir; if test "x$enableval" = xyes; then { { echo "$as_me:$LINENO: error: --enable-lockdir requires an argument" >&5 echo "$as_me: error: --enable-lockdir requires an argument" >&2;} { (exit 1); exit 1; }; } fi if test "x$LOCKTYPE" != xdot; then { { echo "$as_me:$LINENO: error: Can only use --enable-lockdir with dot locking" >&5 echo "$as_me: error: Can only use --enable-lockdir with dot locking" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define LOCKDIR "$enableval" _ACEOF fi # Check whether --with-mts was given. if test "${with_mts+set}" = set; then withval=$with_mts; fi if test x"$with_mts" = x"smtp"; then MTS="smtp" elif test x"$with_mts" = x"sendmail"; then MTS="sendmail" else MTS="smtp" fi # Check whether --with-pager was given. if test "${with_pager+set}" = set; then withval=$with_pager; fi if test -n "$with_pager"; then pagerpath="$with_pager" fi if test -z "$pagerpath"; then pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin for ac_prog in more less most cat do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_pagerpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $pagerpath in [\\/]* | ?:[\\/]*) ac_cv_path_pagerpath="$pagerpath" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $pathtmp do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_pagerpath="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi pagerpath=$ac_cv_path_pagerpath if test -n "$pagerpath"; then { echo "$as_me:$LINENO: result: $pagerpath" >&5 echo "${ECHO_T}$pagerpath" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$pagerpath" && break done test -n "$pagerpath" || pagerpath="no" fi # Check whether --with-smtpservers was given. if test "${with_smtpservers+set}" = set; then withval=$with_smtpservers; fi if test -n "$with_smtpservers"; then smtpservers="$with_smtpservers" else smtpservers="localhost" fi test -z "$CFLAGS" && CFLAGS= auto_cflags=1 if test x"$enable_debug" = x"yes"; then test -z "$LDFLAGS" && LDFLAGS=-g fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f -r core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi { echo "$as_me:$LINENO: checking whether preprocessor supports -Wunused-macros" >&5 echo $ECHO_N "checking whether preprocessor supports -Wunused-macros... $ECHO_C" >&6; } if test "${nmh_cv_has_unusedmacros+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else nmh_saved_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -Wunused-macros -Wno-unused-macros" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then nmh_cv_has_unusedmacros=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_cv_has_unusedmacros=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$nmh_saved_cppflags" fi { echo "$as_me:$LINENO: result: $nmh_cv_has_unusedmacros" >&5 echo "${ECHO_T}$nmh_cv_has_unusedmacros" >&6; } if test "$nmh_cv_has_unusedmacros" = 'yes'; then test -z "$CPPFLAGS" && CPPFLAGS=-Wunused-macros \ || CPPFLAGS="$CPPFLAGS -Wunused-macros" DISABLE_UNUSED_MACROS_WARNING=-Wno-unused-macros fi { echo "$as_me:$LINENO: checking whether compiler supports -Wno-sign-compare" >&5 echo $ECHO_N "checking whether compiler supports -Wno-sign-compare... $ECHO_C" >&6; } if test "${nmh_cv_has_nosigncompare+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else nmh_saved_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -Wno-sign-compare" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then nmh_cv_has_nosigncompare=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_cv_has_nosigncompare=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$nmh_saved_cppflags" fi { echo "$as_me:$LINENO: result: $nmh_cv_has_nosigncompare" >&5 echo "${ECHO_T}$nmh_cv_has_nosigncompare" >&6; } if test "$nmh_cv_has_nosigncompare" = 'yes'; then DISABLE_SIGN_COMPARE_WARNING=-Wno-sign-compare fi { echo "$as_me:$LINENO: checking whether compiler supports -Wextra" >&5 echo $ECHO_N "checking whether compiler supports -Wextra... $ECHO_C" >&6; } if test "${nmh_cv_has_wextra+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else nmh_saved_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wextra -Wno-clobbered" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then nmh_cv_has_wextra=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_cv_has_wextra=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$nmh_saved_cflags" fi { echo "$as_me:$LINENO: result: $nmh_cv_has_wextra" >&5 echo "${ECHO_T}$nmh_cv_has_wextra" >&6; } { echo "$as_me:$LINENO: checking whether compiler supports -Wno-pointer-sign" >&5 echo $ECHO_N "checking whether compiler supports -Wno-pointer-sign... $ECHO_C" >&6; } if test "${nmh_cv_has_noptrsign+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else nmh_saved_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wno-pointer-sign" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then nmh_cv_has_noptrsign=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_cv_has_noptrsign=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$nmh_saved_cflags" fi { echo "$as_me:$LINENO: result: $nmh_cv_has_noptrsign" >&5 echo "${ECHO_T}$nmh_cv_has_noptrsign" >&6; } if test "$nmh_cv_has_noptrsign" = "yes"; then if test "$nmh_cv_has_wextra" = "yes"; then nmh_gcc_warnflags="-Wall -Wextra -Wno-clobbered -Wno-pointer-sign" else nmh_gcc_warnflags="-Wall -Wno-pointer-sign" fi else if test "$nmh_cv_has_wextra" = "yes"; then nmh_gcc_warnflags="-Wall -Wextra -Wno-clobbered" else nmh_gcc_warnflags="-Wall" fi fi if test -n "$auto_cflags"; then if test x"$enable_debug" = x"yes"; then if test -n "$GCC"; then test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -g" || CFLAGS="$CFLAGS $nmh_gcc_warnflags -g" else test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g" fi else if test -z "$LDFLAGS"; then case "$build_os" in darwin*) LDFLAGS= ;; *) LDFLAGS=-s ;; esac fi if test -n "$GCC"; then test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -O2" || CFLAGS="$CFLAGS $nmh_gcc_warnflags -O2" else test -z "$CFLAGS" && CFLAGS=-O || CFLAGS="$CFLAGS -O" fi fi fi { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" | sed 99q >conftest.sed $as_unset ac_script || ac_script= # Extract the first word of "sed gsed" to use in msg output if test -z "$SED"; then set dummy sed gsed; ac_prog_name=$2 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS fi SED="$ac_cv_path_SED" if test -z "$SED"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 echo "${ECHO_T}$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { yyless (input () != 0); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { (ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; } if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { echo "$as_me:$LINENO: checking lex library" >&5 echo $ECHO_N "checking lex library... $ECHO_C" >&6; } if test "${ac_cv_lib_lex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_lex=$ac_lib else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 echo "${ECHO_T}$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; } if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb # Extract the first word of "cut", so it can be a program name with args. set dummy cut; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_cutpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $cutpath in [\\/]* | ?:[\\/]*) ac_cv_path_cutpath="$cutpath" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $pathtmp do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_cutpath="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_cutpath" && ac_cv_path_cutpath="no" ;; esac fi cutpath=$ac_cv_path_cutpath if test -n "$cutpath"; then { echo "$as_me:$LINENO: result: $cutpath" >&5 echo "${ECHO_T}$cutpath" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi for ac_prog in md5sum md5 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_MD5SUM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MD5SUM"; then ac_cv_prog_MD5SUM="$MD5SUM" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MD5SUM="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MD5SUM=$ac_cv_prog_MD5SUM if test -n "$MD5SUM"; then { echo "$as_me:$LINENO: result: $MD5SUM" >&5 echo "${ECHO_T}$MD5SUM" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$MD5SUM" && break done test -n "$MD5SUM" || MD5SUM="missing" case "${MD5SUM}" in md5sum) MD5FMT="cat" ;; md5) MD5FMT="${SED} -e 's/MD5 *(\(.*\)) *= \([0-9a-f]*\)/\2 \1/'" ;; *) MD5FMT="missing" ;; esac # Extract the first word of "lclint", so it can be a program name with args. set dummy lclint; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_linttmp1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$linttmp1"; then ac_cv_prog_linttmp1="$linttmp1" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_linttmp1="lclint" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_linttmp1" && ac_cv_prog_linttmp1="no" fi fi linttmp1=$ac_cv_prog_linttmp1 if test -n "$linttmp1"; then { echo "$as_me:$LINENO: result: $linttmp1" >&5 echo "${ECHO_T}$linttmp1" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test x$ac_cv_prog_linttmp1 != xno ; then LINT=$ac_cv_prog_linttmp1 LINTFLAGS="-weak +posixlib -macrovarprefixexclude" else # Extract the first word of "lint", so it can be a program name with args. set dummy lint; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_linttmp2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$linttmp2"; then ac_cv_prog_linttmp2="$linttmp2" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_linttmp2="lint" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_linttmp2" && ac_cv_prog_linttmp2="no" fi fi linttmp2=$ac_cv_prog_linttmp2 if test -n "$linttmp2"; then { echo "$as_me:$LINENO: result: $linttmp2" >&5 echo "${ECHO_T}$linttmp2" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test x$ac_cv_prog_linttmp2 != xno ; then LINT=$ac_cv_prog_linttmp2 LINTFLAGS="" else LINT="echo 'No lint program found'" LINTFLAGS="" fi fi pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb # Extract the first word of "ls", so it can be a program name with args. set dummy ls; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_lspath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $lspath in [\\/]* | ?:[\\/]*) ac_cv_path_lspath="$lspath" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $pathtmp do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_lspath="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_lspath" && ac_cv_path_lspath="no" ;; esac fi lspath=$ac_cv_path_lspath if test -n "$lspath"; then { echo "$as_me:$LINENO: result: $lspath" >&5 echo "${ECHO_T}$lspath" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$lspath" != "no"; then { echo "$as_me:$LINENO: checking how to get ls to show us the group ownership of a file" >&5 echo $ECHO_N "checking how to get ls to show us the group ownership of a file... $ECHO_C" >&6; } if test "${nmh_cv_ls_grpopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test x"`$lspath -dl / | $AWK '{print $9}'`" = x"/"; then nmh_cv_ls_grpopt="-l" else nmh_cv_ls_grpopt="-lg" fi fi { echo "$as_me:$LINENO: result: $nmh_cv_ls_grpopt" >&5 echo "${ECHO_T}$nmh_cv_ls_grpopt" >&6; } fi pathtmp=/usr/lib:/usr/sbin:/usr/etc:/usr/ucblib:/usr/bin:/bin # Extract the first word of "sendmail", so it can be a program name with args. set dummy sendmail; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_sendmailpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $sendmailpath in [\\/]* | ?:[\\/]*) ac_cv_path_sendmailpath="$sendmailpath" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $pathtmp do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_sendmailpath="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_sendmailpath" && ac_cv_path_sendmailpath="/usr/sbin/sendmail" ;; esac fi sendmailpath=$ac_cv_path_sendmailpath if test -n "$sendmailpath"; then { echo "$as_me:$LINENO: result: $sendmailpath" >&5 echo "${ECHO_T}$sendmailpath" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin # Extract the first word of "vi", so it can be a program name with args. set dummy vi; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_vipath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $vipath in [\\/]* | ?:[\\/]*) ac_cv_path_vipath="$vipath" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $pathtmp do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_vipath="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_vipath" && ac_cv_path_vipath="/bin/vi" ;; esac fi vipath=$ac_cv_path_vipath if test -n "$vipath"; then { echo "$as_me:$LINENO: result: $vipath" >&5 echo "${ECHO_T}$vipath" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$editorpath"; then editorpath="$vipath" fi { echo "$as_me:$LINENO: checking where mail spool is located" >&5 echo $ECHO_N "checking where mail spool is located... $ECHO_C" >&6; } if test "${nmh_cv_mailspool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for mailspool in /var/mail /var/spool/mail /usr/spool/mail /dev/null; do test -d $mailspool && break done nmh_cv_mailspool=$mailspool fi { echo "$as_me:$LINENO: result: $nmh_cv_mailspool" >&5 echo "${ECHO_T}$nmh_cv_mailspool" >&6; } mailspool=$nmh_cv_mailspool if test "$lspath" != "no" -a "$cutpath" != "no"; then { echo "$as_me:$LINENO: checking whether the mail spool is world-writable" >&5 echo $ECHO_N "checking whether the mail spool is world-writable... $ECHO_C" >&6; } if test "${nmh_cv_mailspool_world_writable+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "`$lspath -dlL $mailspool | $cutpath -c9`" = "-"; then nmh_cv_mailspool_world_writable=no else nmh_cv_mailspool_world_writable=yes fi fi { echo "$as_me:$LINENO: result: $nmh_cv_mailspool_world_writable" >&5 echo "${ECHO_T}$nmh_cv_mailspool_world_writable" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f -r conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f -r conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_lockfile_h+set}" = set; then { echo "$as_me:$LINENO: checking for lockfile.h" >&5 echo $ECHO_N "checking for lockfile.h... $ECHO_C" >&6; } if test "${ac_cv_header_lockfile_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_lockfile_h" >&5 echo "${ECHO_T}$ac_cv_header_lockfile_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking lockfile.h usability" >&5 echo $ECHO_N "checking lockfile.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking lockfile.h presence" >&5 echo $ECHO_N "checking lockfile.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: lockfile.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: lockfile.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: lockfile.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: lockfile.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: lockfile.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: lockfile.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: lockfile.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: lockfile.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: lockfile.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: lockfile.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: lockfile.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: lockfile.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: lockfile.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: lockfile.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: lockfile.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: lockfile.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------- ## ## Report this to nmh-workers@nongnu.org ## ## ------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for lockfile.h" >&5 echo $ECHO_N "checking for lockfile.h... $ECHO_C" >&6; } if test "${ac_cv_header_lockfile_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_lockfile_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_lockfile_h" >&5 echo "${ECHO_T}$ac_cv_header_lockfile_h" >&6; } fi if test $ac_cv_header_lockfile_h = yes; then { echo "$as_me:$LINENO: checking for lockfile_create in -llockfile" >&5 echo $ECHO_N "checking for lockfile_create in -llockfile... $ECHO_C" >&6; } if test "${ac_cv_lib_lockfile_lockfile_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llockfile $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lockfile_create (); int main () { return lockfile_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_lockfile_lockfile_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lockfile_lockfile_create=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_lockfile_lockfile_create" >&5 echo "${ECHO_T}$ac_cv_lib_lockfile_lockfile_create" >&6; } if test $ac_cv_lib_lockfile_lockfile_create = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLOCKFILE 1 _ACEOF LIBS="-llockfile $LIBS" fi fi # Extract the first word of "dotlockfile", so it can be a program name with args. set dummy dotlockfile; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_dotlockfilepath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $dotlockfilepath in [\\/]* | ?:[\\/]*) ac_cv_path_dotlockfilepath="$dotlockfilepath" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_dotlockfilepath="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_dotlockfilepath" && ac_cv_path_dotlockfilepath="no" ;; esac fi dotlockfilepath=$ac_cv_path_dotlockfilepath if test -n "$dotlockfilepath"; then { echo "$as_me:$LINENO: result: $dotlockfilepath" >&5 echo "${ECHO_T}$dotlockfilepath" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_cv_lib_lockfile_lockfile_create" != "no" ; then if test "$ac_cv_path_dotlockfilepath" != "no" ; then { echo "$as_me:$LINENO: checking whether dotlockfile is setgid" >&5 echo $ECHO_N "checking whether dotlockfile is setgid... $ECHO_C" >&6; } if test "${nmh_cv_dotlockfile_setgid+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -g "$ac_cv_path_dotlockfilepath" ; then nmh_cv_dotlockfile_setgid=yes else nmh_cv_dotlockfile_setgid=no fi fi { echo "$as_me:$LINENO: result: $nmh_cv_dotlockfile_setgid" >&5 echo "${ECHO_T}$nmh_cv_dotlockfile_setgid" >&6; } fi fi if test x"$DISABLE_SETGID_MAIL" != x -a x"$DISABLE_SETGID_MAIL" != x0; then nmh_cv_dotlockfile_setgid=yes fi if test x"$LOCKTYPE" = x"dot" -a x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then cat >>confdefs.h <<\_ACEOF #define MAILGROUP 1 _ACEOF SETGID_MAIL=1 fi { echo "$as_me:$LINENO: checking what group owns the mail spool" >&5 echo $ECHO_N "checking what group owns the mail spool... $ECHO_C" >&6; } if test "${nmh_cv_ls_mail_grp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else nmh_cv_ls_mail_grp=`$lspath -dL $nmh_cv_ls_grpopt $mailspool|$AWK '{print $4}'` fi { echo "$as_me:$LINENO: result: $nmh_cv_ls_mail_grp" >&5 echo "${ECHO_T}$nmh_cv_ls_mail_grp" >&6; } MAIL_SPOOL_GRP=$nmh_cv_ls_mail_grp case "$host_os" in linux*) # Like DEFS, but doesn't get stomped on by configure when using config.h: if test -z "$CPPFLAGS"; then CPPFLAGS="-D_GNU_SOURCE" else CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" fi ;; esac { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f -r conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f -r conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether termios.h defines TIOCGWINSZ" >&5 echo $ECHO_N "checking whether termios.h defines TIOCGWINSZ... $ECHO_C" >&6; } if test "${ac_cv_sys_tiocgwinsz_in_termios_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef TIOCGWINSZ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ac_cv_sys_tiocgwinsz_in_termios_h=yes else ac_cv_sys_tiocgwinsz_in_termios_h=no fi rm -f -r conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then { echo "$as_me:$LINENO: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 echo $ECHO_N "checking whether sys/ioctl.h defines TIOCGWINSZ... $ECHO_C" >&6; } if test "${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef TIOCGWINSZ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes else ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no fi rm -f -r conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then cat >>confdefs.h <<\_ACEOF #define GWINSZ_IN_SYS_IOCTL 1 _ACEOF fi fi for ac_header in errno.h fcntl.h crypt.h ncurses/termcap.h termcap.h \ langinfo.h wchar.h wctype.h iconv.h netdb.h \ sys/param.h sys/time.h sys/stream.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------- ## ## Report this to nmh-workers@nongnu.org ## ## ------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_libio_h+set}" = set; then { echo "$as_me:$LINENO: checking for libio.h" >&5 echo $ECHO_N "checking for libio.h... $ECHO_C" >&6; } if test "${ac_cv_header_libio_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libio_h" >&5 echo "${ECHO_T}$ac_cv_header_libio_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libio.h usability" >&5 echo $ECHO_N "checking libio.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking libio.h presence" >&5 echo $ECHO_N "checking libio.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: libio.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libio.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libio.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libio.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libio.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libio.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libio.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libio.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libio.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libio.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libio.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libio.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libio.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libio.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libio.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------- ## ## Report this to nmh-workers@nongnu.org ## ## ------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for libio.h" >&5 echo $ECHO_N "checking for libio.h... $ECHO_C" >&6; } if test "${ac_cv_header_libio_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libio_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libio_h" >&5 echo "${ECHO_T}$ac_cv_header_libio_h" >&6; } fi if test $ac_cv_header_libio_h = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "_IO_write_ptr" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define LINUX_STDIO 1 _ACEOF fi rm -f -r conftest* fi { echo "$as_me:$LINENO: checking for sys/ptem.h" >&5 echo $ECHO_N "checking for sys/ptem.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_ptem_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_SYS_STREAM_H # include #endif #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_sys_ptem_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_ptem_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_ptem_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_ptem_h" >&6; } if test $ac_cv_header_sys_ptem_h = yes; then cat >>confdefs.h <<\_ACEOF #define WINSIZE_IN_PTEM 1 _ACEOF fi for ac_func in wcwidth mbtowc writev lstat nl_langinfo getutxent do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_header_wchar_h" = "xyes" -a "x$ac_cv_header_wctype_h" = "xyes" \ -a "x$ac_cv_func_wcwidth" = "xyes" -a "x$ac_cv_func_mbtowc" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define MULTIBYTE_SUPPORT 1 _ACEOF fi { echo "$as_me:$LINENO: checking for modf" >&5 echo $ECHO_N "checking for modf... $ECHO_C" >&6; } if test "${ac_cv_func_modf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define modf to an innocuous variant, in case declares modf. For example, HP-UX 11i declares gettimeofday. */ #define modf innocuous_modf /* System header to define __stub macros and hopefully few prototypes, which can conflict with char modf (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef modf /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char modf (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_modf || defined __stub___modf choke me #endif int main () { return modf (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_modf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_modf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_modf" >&5 echo "${ECHO_T}$ac_cv_func_modf" >&6; } if test $ac_cv_func_modf = yes; then : else { echo "$as_me:$LINENO: checking for modf in -lm" >&5 echo $ECHO_N "checking for modf in -lm... $ECHO_C" >&6; } if test "${ac_cv_lib_m_modf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char modf (); int main () { return modf (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_m_modf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_modf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5 echo "${ECHO_T}$ac_cv_lib_m_modf" >&6; } if test $ac_cv_lib_m_modf = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi fi { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_search_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_gethostbyname=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_gethostbyname+set}" = set; then break fi done if test "${ac_cv_search_gethostbyname+set}" = set; then : else ac_cv_search_gethostbyname=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; } ac_res=$ac_cv_search_gethostbyname if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else { { echo "$as_me:$LINENO: error: gethostbyname not found" >&5 echo "$as_me: error: gethostbyname not found" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for library containing connect" >&5 echo $ECHO_N "checking for library containing connect... $ECHO_C" >&6; } if test "${ac_cv_search_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_connect=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_connect+set}" = set; then break fi done if test "${ac_cv_search_connect+set}" = set; then : else ac_cv_search_connect=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_connect" >&5 echo "${ECHO_T}$ac_cv_search_connect" >&6; } ac_res=$ac_cv_search_connect if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else { { echo "$as_me:$LINENO: error: connect not found" >&5 echo "$as_me: error: connect not found" >&2;} { (exit 1); exit 1; }; } fi # Check whether --with-readline was given. if test "${with_readline+set}" = set; then withval=$with_readline; else with_readline=maybe fi if test x"$with_readline" = xyes -o x"$with_readline" = xmaybe; then save_LIBS="$LIBS" LIBS= { echo "$as_me:$LINENO: checking for library containing readline" >&5 echo $ECHO_N "checking for library containing readline... $ECHO_C" >&6; } if test "${ac_cv_search_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF for ac_lib in '' readline editline; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_readline=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_readline+set}" = set; then break fi done if test "${ac_cv_search_readline+set}" = set; then : else ac_cv_search_readline=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_readline" >&5 echo "${ECHO_T}$ac_cv_search_readline" >&6; } ac_res=$ac_cv_search_readline if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" READLINELIB="$LIBS" cat >>confdefs.h <<\_ACEOF #define READLINE_SUPPORT 1 _ACEOF else if test x"$with_readline" = xyes; then { { echo "$as_me:$LINENO: error: Unable to find a readline library" >&5 echo "$as_me: error: Unable to find a readline library" >&2;} { (exit 1); exit 1; }; } fi fi LIBS="$save_LIBS" fi termcap_curses_order="termcap curses ncurses" for lib in $termcap_curses_order; do as_ac_Lib=`echo "ac_cv_lib_${lib}''_tgetent" | $as_tr_sh` { echo "$as_me:$LINENO: checking for tgetent in -l${lib}" >&5 echo $ECHO_N "checking for tgetent in -l${lib}... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l${lib} $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tgetent (); int main () { return tgetent (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then TERMLIB="-l$lib"; break fi done if test "x$TERMLIB" = "x"; then { { echo "$as_me:$LINENO: error: Could not find tgetent in any library. Is there a curses or ncurses library or package that you can install? See \`config.log' for more details." >&5 echo "$as_me: error: Could not find tgetent in any library. Is there a curses or ncurses library or package that you can install? See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi if test "x$ac_cv_header_iconv_h" = "xyes"; then { echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${ac_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define iconv to an innocuous variant, in case declares iconv. For example, HP-UX 11i declares gettimeofday. */ #define iconv innocuous_iconv /* System header to define __stub macros and hopefully few prototypes, which can conflict with char iconv (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef iconv /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_iconv || defined __stub___iconv choke me #endif int main () { return iconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_iconv=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5 echo "${ECHO_T}$ac_cv_func_iconv" >&6; } if test $ac_cv_func_iconv = yes; then ac_found_iconv=yes else ac_found_iconv=no fi if test "x$ac_found_iconv" = "xno"; then { echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6; } if test "${ac_cv_lib_iconv_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char iconv (); int main () { return iconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_iconv_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_iconv=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5 echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6; } if test $ac_cv_lib_iconv_iconv = yes; then ac_found_iconv=yes fi if test "x$ac_found_iconv" = "xno"; then { echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6; } if test "${ac_cv_lib_iconv_libiconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libiconv (); int main () { return libiconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_iconv_libiconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_libiconv=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv" >&5 echo "${ECHO_T}$ac_cv_lib_iconv_libiconv" >&6; } if test $ac_cv_lib_iconv_libiconv = yes; then ac_found_iconv=yes fi fi if test "x$ac_found_iconv" != "xno"; then ICONVLIB="-liconv" fi else { echo "$as_me:$LINENO: checking whether _libiconv_version is declared" >&5 echo $ECHO_N "checking whether _libiconv_version is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl__libiconv_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _libiconv_version (void) _libiconv_version; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl__libiconv_version=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl__libiconv_version=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl__libiconv_version" >&5 echo "${ECHO_T}$ac_cv_have_decl__libiconv_version" >&6; } if test $ac_cv_have_decl__libiconv_version = yes; then { echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6; } if test "${ac_cv_lib_iconv_libiconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libiconv (); int main () { return libiconv (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_iconv_libiconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iconv_libiconv=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv" >&5 echo "${ECHO_T}$ac_cv_lib_iconv_libiconv" >&6; } if test $ac_cv_lib_iconv_libiconv = yes; then LIBS="-liconv $LIBS" fi fi fi fi if test "x$ac_found_iconv" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "x$ac_found_iconv" = "xyes"; then { echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6; } if test "${ac_cv_iconv_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_iconv_const= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_iconv_const=const fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_iconv_const" >&5 echo "${ECHO_T}$ac_cv_iconv_const" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $ac_cv_iconv_const _ACEOF fi # Check whether --with-ndbm was given. if test "${with_ndbm+set}" = set; then withval=$with_ndbm; nmh_ndbm=$withval else nmh_ndbm=autodetect fi # Check whether --with-ndbmheader was given. if test "${with_ndbmheader+set}" = set; then withval=$with_ndbmheader; nmh_ndbmheader=$withval else nmh_ndbmheader=autodetect fi if test "$nmh_ndbm" = "autodetect"; then if test "$nmh_ndbmheader" != "autodetect"; then { { echo "$as_me:$LINENO: error: must specify both --with-ndbm and --with-ndbmheader or neither" >&5 echo "$as_me: error: must specify both --with-ndbm and --with-ndbmheader or neither" >&2;} { (exit 1); exit 1; }; } else if test "x" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in ndbm.h" >&5 echo $ECHO_N "checking for dbm in ndbm.h... $ECHO_C" >&6; } else nmh_libs="-l " { echo "$as_me:$LINENO: checking for dbm in ndbm.h and " >&5 echo $ECHO_N "checking for dbm in ndbm.h and ... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="ndbm.h" nmh_ndbm="" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xdb" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in db.h" >&5 echo $ECHO_N "checking for dbm in db.h... $ECHO_C" >&6; } else nmh_libs="-ldb " { echo "$as_me:$LINENO: checking for dbm in db.h and db" >&5 echo $ECHO_N "checking for dbm in db.h and db... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="db.h" nmh_ndbm="db" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xdb" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in ndbm.h" >&5 echo $ECHO_N "checking for dbm in ndbm.h... $ECHO_C" >&6; } else nmh_libs="-ldb " { echo "$as_me:$LINENO: checking for dbm in ndbm.h and db" >&5 echo $ECHO_N "checking for dbm in ndbm.h and db... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="ndbm.h" nmh_ndbm="db" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xdb1" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in ndbm.h" >&5 echo $ECHO_N "checking for dbm in ndbm.h... $ECHO_C" >&6; } else nmh_libs="-ldb1 " { echo "$as_me:$LINENO: checking for dbm in ndbm.h and db1" >&5 echo $ECHO_N "checking for dbm in ndbm.h and db1... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="ndbm.h" nmh_ndbm="db1" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xndbm" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in ndbm.h" >&5 echo $ECHO_N "checking for dbm in ndbm.h... $ECHO_C" >&6; } else nmh_libs="-lndbm " { echo "$as_me:$LINENO: checking for dbm in ndbm.h and ndbm" >&5 echo $ECHO_N "checking for dbm in ndbm.h and ndbm... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="ndbm.h" nmh_ndbm="ndbm" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xdb1" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in db1/ndbm.h" >&5 echo $ECHO_N "checking for dbm in db1/ndbm.h... $ECHO_C" >&6; } else nmh_libs="-ldb1 " { echo "$as_me:$LINENO: checking for dbm in db1/ndbm.h and db1" >&5 echo $ECHO_N "checking for dbm in db1/ndbm.h and db1... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="db1/ndbm.h" nmh_ndbm="db1" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xgdbm" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in gdbm/ndbm.h" >&5 echo $ECHO_N "checking for dbm in gdbm/ndbm.h... $ECHO_C" >&6; } else nmh_libs="-lgdbm " { echo "$as_me:$LINENO: checking for dbm in gdbm/ndbm.h and gdbm" >&5 echo $ECHO_N "checking for dbm in gdbm/ndbm.h and gdbm... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="gdbm/ndbm.h" nmh_ndbm="gdbm" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xgdbm_compat -lgdbm" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in gdbm/ndbm.h" >&5 echo $ECHO_N "checking for dbm in gdbm/ndbm.h... $ECHO_C" >&6; } else nmh_libs="-lgdbm_compat -lgdbm " { echo "$as_me:$LINENO: checking for dbm in gdbm/ndbm.h and gdbm_compat -lgdbm" >&5 echo $ECHO_N "checking for dbm in gdbm/ndbm.h and gdbm_compat -lgdbm... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="gdbm/ndbm.h" nmh_ndbm="gdbm_compat -lgdbm" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xgdbm" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in ndbm.h" >&5 echo $ECHO_N "checking for dbm in ndbm.h... $ECHO_C" >&6; } else nmh_libs="-lgdbm " { echo "$as_me:$LINENO: checking for dbm in ndbm.h and gdbm" >&5 echo $ECHO_N "checking for dbm in ndbm.h and gdbm... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="ndbm.h" nmh_ndbm="gdbm" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } if test "xgdbm_compat -lgdbm" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in ndbm.h" >&5 echo $ECHO_N "checking for dbm in ndbm.h... $ECHO_C" >&6; } else nmh_libs="-lgdbm_compat -lgdbm " { echo "$as_me:$LINENO: checking for dbm in ndbm.h and gdbm_compat -lgdbm" >&5 echo $ECHO_N "checking for dbm in ndbm.h and gdbm_compat -lgdbm... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="ndbm.h" nmh_ndbm="gdbm_compat -lgdbm" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } : fi : fi : fi : fi : fi : fi : fi : fi : fi : fi fi else if test "x$nmh_ndbm" = "x"; then nmh_libs= { echo "$as_me:$LINENO: checking for dbm in $nmh_ndbmheader" >&5 echo $ECHO_N "checking for dbm in $nmh_ndbmheader... $ECHO_C" >&6; } else nmh_libs="-l$nmh_ndbm " { echo "$as_me:$LINENO: checking for dbm in $nmh_ndbmheader and $nmh_ndbm" >&5 echo $ECHO_N "checking for dbm in $nmh_ndbmheader and $nmh_ndbm... $ECHO_C" >&6; } fi nmh_saved_libs="$LIBS" LIBS="$nmh_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define DB_DBM_HSEARCH 1 #include <$nmh_ndbmheader> int main () { dbm_open("",0,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then nmh_ndbm_found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 nmh_ndbm_found=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } nmh_ndbmheader="$nmh_ndbmheader" nmh_ndbm="$nmh_ndbm" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } : fi fi if test "$nmh_ndbm_found" = "no"; then { { echo "$as_me:$LINENO: error: could not find a working ndbm library/header combination" >&5 echo "$as_me: error: could not find a working ndbm library/header combination" >&2;} { (exit 1); exit 1; }; } else if test x"$nmh_ndbmheader" != x; then cat >>confdefs.h <<_ACEOF #define NDBM_HEADER <$nmh_ndbmheader> _ACEOF fi if test x"$nmh_ndbm" != x; then NDBM_LIBS="-l$nmh_ndbm" else NDBM_LIBS= fi fi # Check whether --with-rpmdir was given. if test "${with_rpmdir+set}" = set; then withval=$with_rpmdir; fi if test x"$with_rpmdir" = x; then rpmdir='$(abs_srcdir)/RPM'; nmhrpm=./RPM else rpmdir="$with_rpmdir"; eval "nmhrpm=${rpmdir}" fi if test x"$sasl_support" = x"yes"; then if test "${ac_cv_header_sasl_sasl_h+set}" = set; then { echo "$as_me:$LINENO: checking for sasl/sasl.h" >&5 echo $ECHO_N "checking for sasl/sasl.h... $ECHO_C" >&6; } if test "${ac_cv_header_sasl_sasl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sasl_sasl_h" >&5 echo "${ECHO_T}$ac_cv_header_sasl_sasl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sasl/sasl.h usability" >&5 echo $ECHO_N "checking sasl/sasl.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking sasl/sasl.h presence" >&5 echo $ECHO_N "checking sasl/sasl.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sasl/sasl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sasl/sasl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sasl/sasl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sasl/sasl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sasl/sasl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sasl/sasl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sasl/sasl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------- ## ## Report this to nmh-workers@nongnu.org ## ## ------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for sasl/sasl.h" >&5 echo $ECHO_N "checking for sasl/sasl.h... $ECHO_C" >&6; } if test "${ac_cv_header_sasl_sasl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sasl_sasl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sasl_sasl_h" >&5 echo "${ECHO_T}$ac_cv_header_sasl_sasl_h" >&6; } fi if test $ac_cv_header_sasl_sasl_h = yes; then : else { { echo "$as_me:$LINENO: error: sasl.h not found" >&5 echo "$as_me: error: sasl.h not found" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for sasl_client_new in -lsasl2" >&5 echo $ECHO_N "checking for sasl_client_new in -lsasl2... $ECHO_C" >&6; } if test "${ac_cv_lib_sasl2_sasl_client_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsasl2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sasl_client_new (); int main () { return sasl_client_new (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_sasl2_sasl_client_new=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sasl2_sasl_client_new=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_sasl2_sasl_client_new" >&5 echo "${ECHO_T}$ac_cv_lib_sasl2_sasl_client_new" >&6; } if test $ac_cv_lib_sasl2_sasl_client_new = yes; then SASLLIB="-lsasl2" else { { echo "$as_me:$LINENO: error: Cyrus SASL library not found" >&5 echo "$as_me: error: Cyrus SASL library not found" >&2;} { (exit 1); exit 1; }; } fi else SASLLIB="" fi if test x"$tls_support" = x"yes"; then if test "${ac_cv_header_openssl_ssl_h+set}" = set; then { echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5 echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; } if test "${ac_cv_header_openssl_ssl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5 echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5 echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5 echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------- ## ## Report this to nmh-workers@nongnu.org ## ## ------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5 echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; } if test "${ac_cv_header_openssl_ssl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_openssl_ssl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5 echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; } fi if test $ac_cv_header_openssl_ssl_h = yes; then : else { { echo "$as_me:$LINENO: error: openssl/ssl.h not found" >&5 echo "$as_me: error: openssl/ssl.h not found" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for BIO_write in -lcrypto" >&5 echo $ECHO_N "checking for BIO_write in -lcrypto... $ECHO_C" >&6; } if test "${ac_cv_lib_crypto_BIO_write+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char BIO_write (); int main () { return BIO_write (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_crypto_BIO_write=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypto_BIO_write=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_BIO_write" >&5 echo "${ECHO_T}$ac_cv_lib_crypto_BIO_write" >&6; } if test $ac_cv_lib_crypto_BIO_write = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" else { { echo "$as_me:$LINENO: error: OpenSSL crypto library not found" >&5 echo "$as_me: error: OpenSSL crypto library not found" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for SSL_library_init in -lssl" >&5 echo $ECHO_N "checking for SSL_library_init in -lssl... $ECHO_C" >&6; } if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SSL_library_init (); int main () { return SSL_library_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ssl_SSL_library_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ssl_SSL_library_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_library_init" >&5 echo "${ECHO_T}$ac_cv_lib_ssl_SSL_library_init" >&6; } if test $ac_cv_lib_ssl_SSL_library_init = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" else { { echo "$as_me:$LINENO: error: OpenSSL library not found" >&5 echo "$as_me: error: OpenSSL library not found" >&2;} { (exit 1); exit 1; }; } fi fi nmh_save_LIBS="$LIBS" LIBS="$TERMLIB $LIBS" { echo "$as_me:$LINENO: checking if tgetent accepts NULL" >&5 echo $ECHO_N "checking if tgetent accepts NULL... $ECHO_C" >&6; } if test "${nmh_cv_func_tgetent_accepts_null+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then nmh_cv_func_tgetent_accepts_null=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main() { char buf[4096]; int r1 = tgetent(buf, "vt100"); int r2 = tgetent((char*)0,"vt100"); if (r1 >= 0 && r1 == r2) { char tbuf[1024], *u; u = tbuf; tgetstr("cl", &u); creat("conftest.tgetent", 0640); } exit((r1 != r2) || r2 == -1); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test -f conftest.tgetent; then nmh_cv_func_tgetent_accepts_null=yes else nmh_cv_func_tgetent_accepts_null=no fi else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) nmh_cv_func_tgetent_accepts_null=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $nmh_cv_func_tgetent_accepts_null" >&5 echo "${ECHO_T}$nmh_cv_func_tgetent_accepts_null" >&6; } if test x$nmh_cv_func_tgetent_accepts_null = xyes; then cat >>confdefs.h <<\_ACEOF #define TGETENT_ACCEPTS_NULL 1 _ACEOF fi { echo "$as_me:$LINENO: checking if tgetent returns 0 on success" >&5 echo $ECHO_N "checking if tgetent returns 0 on success... $ECHO_C" >&6; } if test "${nmh_cv_func_tgetent_zero_success+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then nmh_cv_func_tgetent_zero_success=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main() { char buf[4096]; int r1 = tgetent(buf, "!@#$%^&*"); int r2 = tgetent(buf, "vt100"); if (r1 < 0 && r2 == 0) { char tbuf[1024], *u; u = tbuf; tgetstr("cl", &u); creat("conftest.tgetent0", 0640); } exit(r1 == r2); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test -f conftest.tgetent0; then nmh_cv_func_tgetent_zero_success=yes else nmh_cv_func_tgetent_zero_success=no fi else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) nmh_cv_func_tgetent_zero_success=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $nmh_cv_func_tgetent_zero_success" >&5 echo "${ECHO_T}$nmh_cv_func_tgetent_zero_success" >&6; } if test x$nmh_cv_func_tgetent_zero_success = xyes; then cat >>confdefs.h <<\_ACEOF #define TGETENT_SUCCESS 0 _ACEOF else cat >>confdefs.h <<\_ACEOF #define TGETENT_SUCCESS 1 _ACEOF fi LIBS="$nmh_save_LIBS" { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi { echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f -r conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef mode_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5 echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6; } if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (sizeof ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_gmtoff=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6; } if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_GMTOFF 1 _ACEOF fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { echo "$as_me:$LINENO: checking for struct dirent.d_type" >&5 echo $ECHO_N "checking for struct dirent.d_type... $ECHO_C" >&6; } if test "${ac_cv_member_struct_dirent_d_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef HAVE_DIRENT_H # include #else # define dirent direct # ifdef HAVE_SYS_NDIR_H # include # endif # ifdef HAVE_SYS_DIR_H # include # endif # ifdef HAVE_NDIR_H # include # endif #endif int main () { static struct dirent ac_aggr; if (ac_aggr.d_type) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_dirent_d_type=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef HAVE_DIRENT_H # include #else # define dirent direct # ifdef HAVE_SYS_NDIR_H # include # endif # ifdef HAVE_SYS_DIR_H # include # endif # ifdef HAVE_NDIR_H # include # endif #endif int main () { static struct dirent ac_aggr; if (sizeof ac_aggr.d_type) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_dirent_d_type=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_dirent_d_type=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_type" >&5 echo "${ECHO_T}$ac_cv_member_struct_dirent_d_type" >&6; } if test $ac_cv_member_struct_dirent_d_type = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_DIRENT_D_TYPE 1 _ACEOF fi { echo "$as_me:$LINENO: checking where signal.h is located" >&5 echo $ECHO_N "checking where signal.h is located... $ECHO_C" >&6; } if test "${nmh_cv_path_signal_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for SIGNAL_H in /usr/include/bsd/sys/signal.h /usr/include/asm/signal.h /usr/include/asm/signum.h /usr/include/linux/signal.h /usr/include/sys/signal.h /dev/null; do test -f $SIGNAL_H && \ grep '#[ ]*define[ ][ ]*SIG[0-9A-Z]*[ ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \ break done nmh_cv_path_signal_h=$SIGNAL_H fi { echo "$as_me:$LINENO: result: $nmh_cv_path_signal_h" >&5 echo "${ECHO_T}$nmh_cv_path_signal_h" >&6; } SIGNAL_H=$nmh_cv_path_signal_h ac_config_commands="$ac_config_commands build-directories" ac_config_files="$ac_config_files Makefile test/common.sh" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by nmh $as_me 1.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ nmh config.status 1.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "build-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS build-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "test/common.sh") CONFIG_FILES="$CONFIG_FILES test/common.sh" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF READLINELIB!$READLINELIB$ac_delim SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim DATE!$DATE$ac_delim MTS!$MTS$ac_delim pagerpath!$pagerpath$ac_delim smtpservers!$smtpservers$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim DISABLE_UNUSED_MACROS_WARNING!$DISABLE_UNUSED_MACROS_WARNING$ac_delim DISABLE_SIGN_COMPARE_WARNING!$DISABLE_SIGN_COMPARE_WARNING$ac_delim RANLIB!$RANLIB$ac_delim SED!$SED$ac_delim LEX!$LEX$ac_delim LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim LEXLIB!$LEXLIB$ac_delim cutpath!$cutpath$ac_delim MD5SUM!$MD5SUM$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF MD5FMT!$MD5FMT$ac_delim linttmp1!$linttmp1$ac_delim linttmp2!$linttmp2$ac_delim LINT!$LINT$ac_delim LINTFLAGS!$LINTFLAGS$ac_delim lspath!$lspath$ac_delim sendmailpath!$sendmailpath$ac_delim vipath!$vipath$ac_delim editorpath!$editorpath$ac_delim mailspool!$mailspool$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim dotlockfilepath!$dotlockfilepath$ac_delim SETGID_MAIL!$SETGID_MAIL$ac_delim MAIL_SPOOL_GRP!$MAIL_SPOOL_GRP$ac_delim TERMLIB!$TERMLIB$ac_delim ICONVLIB!$ICONVLIB$ac_delim NDBM_LIBS!$NDBM_LIBS$ac_delim rpmdir!$rpmdir$ac_delim SASLLIB!$SASLLIB$ac_delim SIGNAL_H!$SIGNAL_H$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "build-directories":C) test -d etc || ${MKDIR_P} etc test -d man || ${MKDIR_P} man ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save eval "nmhbin=${bindir}"; eval "nmhbin=${nmhbin}" eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf=${nmhsysconf}" eval "nmhlib=${libdir}"; eval "nmhlib=${nmhlib}" eval "nmhman=${mandir}"; eval "nmhman=${nmhman}" eval "nmhrpm=${nmhrpm}"; { echo "$as_me:$LINENO: nmh configuration ----------------- nmh version : 1.5 host os : ${host} compiler : ${CC} compiler flags : ${CFLAGS} linker flags : ${LDFLAGS} preprocessor flags : ${CPPFLAGS} source code location : ${srcdir} binary install path : ${nmhbin} library install path : ${nmhlib} config files install path : ${nmhsysconf} man page install path : ${nmhman} RPM build root : ${nmhrpm} backup prefix : ${backup_prefix} transport system : ${MTS} file locking type : ${LOCKTYPE} default smtp servers : ${smtpservers} default editor : ${editorpath} default pager : ${pagerpath} SASL support : ${sasl_support} TLS support : ${tls_support} " >&5 echo "$as_me: nmh configuration ----------------- nmh version : 1.5 host os : ${host} compiler : ${CC} compiler flags : ${CFLAGS} linker flags : ${LDFLAGS} preprocessor flags : ${CPPFLAGS} source code location : ${srcdir} binary install path : ${nmhbin} library install path : ${nmhlib} config files install path : ${nmhsysconf} man page install path : ${nmhman} RPM build root : ${nmhrpm} backup prefix : ${backup_prefix} transport system : ${MTS} file locking type : ${LOCKTYPE} default smtp servers : ${smtpservers} default editor : ${editorpath} default pager : ${pagerpath} SASL support : ${sasl_support} TLS support : ${tls_support} " >&6;} # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi nmh-1.5/configure.ac000644 007761 000765 00000065460 11765267273 014413 0ustar00kenhkenh000000 000000 dnl dnl configure.ac -- autoconf template for nmh dnl dnl Move this up a bit AC_PREREQ([2.61]) AC_INIT([nmh], m4_normalize(m4_include([VERSION])), [nmh-workers@nongnu.org]) AC_CONFIG_SRCDIR([h/nmh.h]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) AC_CANONICAL_HOST AC_MSG_NOTICE([configuring for AC_PACKAGE_NAME-AC_PACKAGE_VERSION]) AC_SUBST(VERSION,AC_PACKAGE_VERSION)dnl dnl What date of nmh are we building? DATE=`cat ${srcdir}/DATE` AC_MSG_NOTICE([configuring for nmh dated $DATE]) AC_SUBST([DATE])dnl dnl -------------------------- dnl CHECK COMMAND LINE OPTIONS dnl -------------------------- dnl Do you want to debug nmh? AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug],[enable nmh code debugging])) dnl The old redundant --enable-nmh-debug is deprecated and undocumented. AS_IF([test x"$enable_nmh_debug" = x"yes"], [enable_debug=yes]) dnl Do you want to disable use of locale functions AH_TEMPLATE([LOCALE], [Undefine if you don't want locale features. By default this is defined.]) AC_ARG_ENABLE([locale], [AS_HELP_STRING([--disable-locale], [turn off locale features])], [AS_IF([test x$enableval = xyes], [AC_DEFINE(LOCALE)])], [AC_DEFINE(LOCALE)]) dnl Do you want client-side support for using SASL for authentication? dnl Note that this code will be enabled for both POP and SMTP AC_ARG_WITH([cyrus-sasl], AS_HELP_STRING([--with-cyrus-sasl], [Enable SASL support via the Cyrus SASL library])) AS_IF([test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != x"no"],[ AC_DEFINE([CYRUS_SASL], [1], [Define to use the Cyrus SASL library for authentication of POP and SMTP.])dnl AS_IF([test x"$with_cyrus_sasl" != xyes],[ AC_MSG_WARN([Arguments to --with-cyrus-sasl now ignored]) AC_MSG_WARN([Please pass the appropriate arguments to CPPFLAGS/LDFLAGS])]) sasl_support=yes], [sasl_support=no]) dnl Do you want client-side support for encryption with TLS? AC_ARG_WITH([tls], AS_HELP_STRING([--with-tls], [Enable TLS support])) AS_IF([test x"$with_tls" != x -a x"$with_tls" != x"no"],[ AC_DEFINE([TLS_SUPPORT], [1], [Support TLS for session encryption.])dnl tls_support=yes],[tls_support=no]) dnl What should be the default editor? AC_ARG_WITH([editor], AS_HELP_STRING([--with-editor=EDITOR],[specify the default editor])) AS_IF([test -n "$with_editor"], [editorpath="$with_editor"]) dnl Set the backup prefix AC_ARG_WITH([hash-backup], AS_HELP_STRING([--with-hash-backup],[use # as the backup prefix (default: ,)])) AS_IF([test x"$with_hash_backup" != x -a x"$with_hash_backup" != x"no"], [backup_prefix="#"], [backup_prefix=","]) AC_DEFINE_UNQUOTED([BACKUP_PREFIX], "$backup_prefix", [The prefix that is prepended to the name of message files when they are "removed" by rmm. This should typically be `,' or `#'.])dnl dnl What method of locking to use? AC_ARG_WITH(locking, AS_HELP_STRING([--with-locking=@<:@dot|fcntl|flock|lockf@:>@], [specify the file locking method])) if test x"$with_locking" = x"dot"; then LOCKTYPE="dot" AC_DEFINE(DOT_LOCKING, 1, [Define to use dot based file locking.])dnl elif test x"$with_locking" = x"flock"; then LOCKTYPE="flock" AC_DEFINE(FLOCK_LOCKING, 1, [Define to use flock() based locking.])dnl elif test x"$with_locking" = x"lockf"; then LOCKTYPE="lockf" AC_DEFINE(LOCKF_LOCKING, 1, [Define to use lockf() based locking.])dnl elif test x"$with_locking" = x"fcntl"; then LOCKTYPE="fcntl" AC_DEFINE(FCNTL_LOCKING, 1, [Define to use fnctl() based locking.])dnl else LOCKTYPE="dot" AC_DEFINE(DOT_LOCKING)dnl fi dnl Should we use a locking directory? AC_ARG_ENABLE([lockdir], [AS_HELP_STRING([--enable-lockdir=dir], [Store dot-lock files in "dir"])], [ AS_IF([test "x$enableval" = xyes],[ AC_MSG_ERROR([--enable-lockdir requires an argument])]) AS_IF([test "x$LOCKTYPE" != xdot],[ AC_MSG_ERROR([Can only use --enable-lockdir with dot locking])]) AC_DEFINE_UNQUOTED([LOCKDIR], ["$enableval"], [Directory to store dot-locking lock files]) ]) dnl What method of posting should post use? AC_ARG_WITH([mts], AS_HELP_STRING([--with-mts=@<:@smtp|sendmail@:>@], [specify the default mail transport agent/service])) AS_IF([test x"$with_mts" = x"smtp"], [MTS="smtp"], [test x"$with_mts" = x"sendmail"], [MTS="sendmail"], [MTS="smtp"]) AC_SUBST([MTS])dnl dnl What should be the default pager? AC_ARG_WITH([pager], AS_HELP_STRING([--with-pager=PAGER],[specify the default pager])) AS_IF([test -n "$with_pager"], [pagerpath="$with_pager"]) dnl If a pager is not explicitly specified, then look for one. dnl Fall back to `cat', to avoid catastrophic failure of dnl `mhshow', et al., if pagerpath is set to `no'. if test -z "$pagerpath"; then pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin AC_PATH_PROGS([pagerpath], [more less most cat], [no], [$pathtmp]) fi AC_SUBST(pagerpath)dnl dnl What should be the default mail server(s)? AC_ARG_WITH(smtpservers, AS_HELP_STRING([--with-smtpservers='SMTPSERVER1@<:@ SMTPSERVER2...@:>@'], [specify the default SMTP server(s) @<:@localhost@:>@])) AS_IF([test -n "$with_smtpservers"], [smtpservers="$with_smtpservers"], [smtpservers="localhost"]) AC_SUBST([smtpservers])dnl dnl ---------------------------------------------------- dnl Default location is /usr/local/nmh/{bin,etc,lib,man} dnl ---------------------------------------------------- AC_PREFIX_DEFAULT([/usr/local/nmh]) dnl ------------------ dnl CHECK THE COMPILER dnl ------------------ dnl We want these before the checks, dnl so the checks can modify their values. test -z "$CFLAGS" && CFLAGS= auto_cflags=1 if test x"$enable_debug" = x"yes"; then test -z "$LDFLAGS" && LDFLAGS=-g fi AC_PROG_CC AM_PROG_CC_C_O AC_CACHE_CHECK([whether preprocessor supports -Wunused-macros], [nmh_cv_has_unusedmacros], [nmh_saved_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -Wunused-macros -Wno-unused-macros" AC_TRY_COMPILE([],[],nmh_cv_has_unusedmacros=yes,nmh_cv_has_unusedmacros=no) CPPFLAGS="$nmh_saved_cppflags"]) if test "$nmh_cv_has_unusedmacros" = 'yes'; then test -z "$CPPFLAGS" && CPPFLAGS=-Wunused-macros \ || CPPFLAGS="$CPPFLAGS -Wunused-macros" DISABLE_UNUSED_MACROS_WARNING=-Wno-unused-macros fi AC_SUBST(DISABLE_UNUSED_MACROS_WARNING)dnl AC_CACHE_CHECK([whether compiler supports -Wno-sign-compare], [nmh_cv_has_nosigncompare], [nmh_saved_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -Wno-sign-compare" AC_TRY_COMPILE([],[],nmh_cv_has_nosigncompare=yes, nmh_cv_has_nosigncompare=no) CPPFLAGS="$nmh_saved_cppflags"]) if test "$nmh_cv_has_nosigncompare" = 'yes'; then DISABLE_SIGN_COMPARE_WARNING=-Wno-sign-compare fi AC_SUBST(DISABLE_SIGN_COMPARE_WARNING)dnl AC_CACHE_CHECK([whether compiler supports -Wextra], [nmh_cv_has_wextra], [nmh_saved_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wextra -Wno-clobbered" AC_TRY_COMPILE([],[],nmh_cv_has_wextra=yes,nmh_cv_has_wextra=no) CFLAGS="$nmh_saved_cflags"]) AC_CACHE_CHECK([whether compiler supports -Wno-pointer-sign], [nmh_cv_has_noptrsign], [nmh_saved_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wno-pointer-sign" AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=yes,nmh_cv_has_noptrsign=no) CFLAGS="$nmh_saved_cflags"]) dnl if the user hasn't specified CFLAGS, then dnl if compiler is gcc, then dnl use -O2 and some warning flags dnl else use -O dnl We use -Wall and -Wextra if supported. If the compiler supports it we dnl also use -Wno-pointer-sign, because gcc 4 now produces a lot of new dnl warnings which are probably mostly spurious and which in any case we dnl don't want to deal with now. if test "$nmh_cv_has_noptrsign" = "yes"; then if test "$nmh_cv_has_wextra" = "yes"; then nmh_gcc_warnflags="-Wall -Wextra -Wno-clobbered -Wno-pointer-sign" else nmh_gcc_warnflags="-Wall -Wno-pointer-sign" fi else if test "$nmh_cv_has_wextra" = "yes"; then nmh_gcc_warnflags="-Wall -Wextra -Wno-clobbered" else nmh_gcc_warnflags="-Wall" fi fi if test -n "$auto_cflags"; then if test x"$enable_debug" = x"yes"; then if test -n "$GCC"; then test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -g" || CFLAGS="$CFLAGS $nmh_gcc_warnflags -g" else test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g" fi else if test -z "$LDFLAGS"; then case "$build_os" in darwin*) LDFLAGS= ;; *) LDFLAGS=-s ;; esac fi if test -n "$GCC"; then test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -O2" || CFLAGS="$CFLAGS $nmh_gcc_warnflags -O2" else test -z "$CFLAGS" && CFLAGS=-O || CFLAGS="$CFLAGS -O" fi fi fi AC_C_CONST dnl Does compiler support `const'. dnl ------------------ dnl CHECK FOR PROGRAMS dnl ------------------ AC_PROG_MAKE_SET dnl Does make define $MAKE AC_PROG_INSTALL dnl Check for BSD compatible `install' AC_PROG_RANLIB dnl Check for `ranlib' AC_PROG_AWK dnl Check for mawk,gawk,nawk, then awk AC_PROG_SED dnl Check for Posix-compliant sed AC_PROG_LEX dnl Check for lex/flex dnl Look for `cut' pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb AC_PATH_PROG([cutpath], [cut], [no], [$pathtmp]) dnl dnl Check for MD5 program and formatting command dnl AC_CHECK_PROGS([MD5SUM], [md5sum md5], [missing]) AS_CASE(["${MD5SUM}"], [md5sum], [MD5FMT="cat"], [md5], [[MD5FMT="${SED} -e 's/MD5 *(\(.*\)) *= \([0-9a-f]*\)/\2 \1/'"]], [MD5FMT="missing"]) AC_SUBST([MD5FMT]) dnl ---------------------------------------------- dnl check for lclint, and lint if it doesn't exist dnl ---------------------------------------------- AC_CHECK_PROG(linttmp1, lclint, lclint, no)dnl if test x$ac_cv_prog_linttmp1 != xno ; then LINT=$ac_cv_prog_linttmp1 LINTFLAGS="-weak +posixlib -macrovarprefixexclude" else AC_CHECK_PROG(linttmp2, lint, lint, no)dnl if test x$ac_cv_prog_linttmp2 != xno ; then LINT=$ac_cv_prog_linttmp2 LINTFLAGS="" else LINT="echo 'No lint program found'" LINTFLAGS="" fi fi AC_SUBST([LINT])dnl AC_SUBST([LINTFLAGS])dnl dnl Look for `ls' pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb AC_PATH_PROG([lspath], [ls], [no], [$pathtmp]) dnl See how we get ls to display the owner and the group if test "$lspath" != "no"; then AC_CACHE_CHECK([how to get ls to show us the group ownership of a file], [nmh_cv_ls_grpopt], [if test x"`$lspath -dl / | $AWK '{print $9}'`" = x"/"; then dnl There were 9 parameters, so unless this is a really bizarre, nonstandard dnl ls, it would seem -l gave us both the user and group. On this type of dnl ls, -g makes _only_ the group be displayed (and not the user). nmh_cv_ls_grpopt="-l" else dnl Looks like -l only gave us the user, so we need -g to get the group too. nmh_cv_ls_grpopt="-lg" fi]) fi dnl Look for `sendmail' pathtmp=/usr/lib:/usr/sbin:/usr/etc:/usr/ucblib:/usr/bin:/bin AC_PATH_PROG([sendmailpath], [sendmail], [/usr/sbin/sendmail], [$pathtmp]) dnl Look for `vi' pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin AC_PATH_PROG([vipath], [vi], [/bin/vi], [$pathtmp]) dnl If editor is not specified yet, dnl then use `vi' as the default. AS_IF([test -z "$editorpath"], [editorpath="$vipath"]) AC_SUBST([editorpath])dnl dnl ---------------------------------------------------------- dnl FIND MAIL SPOOL AND SEE IF WE NEED TO MAKE inc SETGID MAIL dnl ---------------------------------------------------------- AC_CACHE_CHECK(where mail spool is located, nmh_cv_mailspool, [for mailspool in /var/mail dnl /var/spool/mail dnl /usr/spool/mail dnl /dev/null; dnl Just in case we fall through do test -d $mailspool && break done nmh_cv_mailspool=$mailspool ]) mailspool=$nmh_cv_mailspool AC_SUBST([mailspool])dnl dnl See whether the mail spool directory is world-writable. if test "$lspath" != "no" -a "$cutpath" != "no"; then AC_CACHE_CHECK(whether the mail spool is world-writable, nmh_cv_mailspool_world_writable, [if test "`$lspath -dlL $mailspool | $cutpath -c9`" = "-"; then nmh_cv_mailspool_world_writable=no else nmh_cv_mailspool_world_writable=yes fi]) fi dnl Also, check for liblockfile (as found on Debian systems) AC_CHECK_HEADER([lockfile.h], [AC_CHECK_LIB(lockfile, lockfile_create)]) dnl and whether its companion program dotlockfile is setgid AC_PATH_PROG(dotlockfilepath, dotlockfile, no) if test "$ac_cv_lib_lockfile_lockfile_create" != "no" ; then if test "$ac_cv_path_dotlockfilepath" != "no" ; then AC_CACHE_CHECK(whether dotlockfile is setgid, nmh_cv_dotlockfile_setgid, [ if test -g "$ac_cv_path_dotlockfilepath" ; then nmh_cv_dotlockfile_setgid=yes else nmh_cv_dotlockfile_setgid=no fi]) fi fi dnl Provide a way for distcheck to disable setgid_mail via dnl DISTCHECK_CONFIGURE_FLAGS. if test x"$DISABLE_SETGID_MAIL" != x -a x"$DISABLE_SETGID_MAIL" != x0; then nmh_cv_dotlockfile_setgid=yes fi dnl If mailspool is not world-writable and dotlockfile is not setgid, dnl we need to #define MAILGROUP to 1 and make inc setgid. if test x"$LOCKTYPE" = x"dot" -a x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then dnl do we really need both of these? AC_DEFINE(MAILGROUP,1, [Define to 1 if you need to make `inc' set-group-id because your mail spool is not world writable. There are no guarantees as to the safety of doing this, but this #define will add some extra security checks.])dnl SETGID_MAIL=1 fi AC_SUBST(SETGID_MAIL)dnl dnl Use ls to see which group owns the mail spool directory. AC_CACHE_CHECK(what group owns the mail spool, nmh_cv_ls_mail_grp, [nmh_cv_ls_mail_grp=`$lspath -dL $nmh_cv_ls_grpopt $mailspool|$AWK '{print $4}'` ]) MAIL_SPOOL_GRP=$nmh_cv_ls_mail_grp AC_SUBST(MAIL_SPOOL_GRP)dnl dnl ------------------ dnl CHECK HEADER FILES dnl ------------------ dnl On glibc we need to define at least the '_XOPEN_SOURCE' level of features, dnl or wchar.h doesn't declare a prototype for wcwidth(). But if we only define dnl that level then db.h won't compile. So we define _GNU_SOURCE which turns dnl on everything. Perhaps other OSes need some feature switch set to get wcwidth() dnl declared; if so they should have an entry added to this case statement. dnl NB that we must define this on the compiler command line, not in config.h, dnl because it must be set before any system header is included and there's no dnl portable way to make sure that files generated by lex include config.h dnl before system header files. AS_CASE(["$host_os"], [linux*], [# Like DEFS, but doesn't get stomped on by configure when using config.h: AS_IF([test -z "$CPPFLAGS"],[CPPFLAGS="-D_GNU_SOURCE"], [CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"])]) AC_HEADER_STDC AC_HEADER_TIOCGWINSZ AC_CHECK_HEADERS([errno.h fcntl.h crypt.h ncurses/termcap.h termcap.h \ langinfo.h wchar.h wctype.h iconv.h netdb.h \ sys/param.h sys/time.h sys/stream.h]) dnl dnl Checks for _IO_write_ptr. A Linuxism used by nmh on linux. We dnl really use a whole set of them, but this check should be dnl sufficient. dnl AC_CHECK_HEADER(libio.h, [ AC_EGREP_HEADER(_IO_write_ptr, libio.h, [ AC_DEFINE(LINUX_STDIO,1,[Use the Linux _IO_*_ptr defines from .]) ]) ]) AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1, [Define to 1 if `struct winsize' requires .]),, [[#if HAVE_SYS_STREAM_H # include #endif ]]) dnl --------------- dnl CHECK FUNCTIONS dnl --------------- AC_CHECK_FUNCS([wcwidth mbtowc writev lstat nl_langinfo getutxent]) dnl Check for multibyte character set support if test "x$ac_cv_header_wchar_h" = "xyes" -a "x$ac_cv_header_wctype_h" = "xyes" \ -a "x$ac_cv_func_wcwidth" = "xyes" -a "x$ac_cv_func_mbtowc" = "xyes"; then AC_DEFINE(MULTIBYTE_SUPPORT, 1, [Define to enable support for multibyte character sets.]) fi dnl ------------------- dnl CHECK FOR LIBRARIES dnl ------------------- dnl Check location of modf AC_CHECK_FUNC([modf], , AC_CHECK_LIB([m], [modf])) dnl Checks for network libraries (nsl, socket) NMH_CHECK_NETLIBS NMH_READLINE termcap_curses_order="termcap curses ncurses" for lib in $termcap_curses_order; do AC_CHECK_LIB(${lib}, tgetent, [TERMLIB="-l$lib"; break]) done AC_SUBST([TERMLIB])dnl AS_IF([test "x$TERMLIB" = "x"], [AC_MSG_FAILURE([Could not find tgetent in any library. Is there a curses or ncurses library or package that you can install?])]) dnl --------------- dnl CHECK FOR ICONV dnl --------------- dnl Find iconv. It may be in libiconv and may be iconv() or libiconv() if test "x$ac_cv_header_iconv_h" = "xyes"; then AC_CHECK_FUNC(iconv, ac_found_iconv=yes, ac_found_iconv=no) if test "x$ac_found_iconv" = "xno"; then AC_CHECK_LIB(iconv, iconv, ac_found_iconv=yes) if test "x$ac_found_iconv" = "xno"; then AC_CHECK_LIB(iconv, libiconv, ac_found_iconv=yes) fi if test "x$ac_found_iconv" != "xno"; then ICONVLIB="-liconv" fi else dnl Handle case where there is a native iconv but iconv.h is from libiconv AC_CHECK_DECL(_libiconv_version, [ AC_CHECK_LIB(iconv, libiconv, LIBS="-liconv $LIBS") ],, [ #include ]) fi fi if test "x$ac_found_iconv" = xyes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function.]) fi AC_SUBST([ICONVLIB]) dnl Check if iconv uses const in prototype declaration if test "x$ac_found_iconv" = "xyes"; then AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[#ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif]])], [ac_cv_iconv_const=], [ac_cv_iconv_const=const])]) AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const, [Define as const if the declaration of iconv() needs const.]) fi dnl -------------- dnl CHECK FOR NDBM dnl -------------- AC_ARG_WITH([ndbm],AS_HELP_STRING([--with-ndbm=ARG],[use -lARG to link with ndbm]), [nmh_ndbm=$withval],[nmh_ndbm=autodetect]) AC_ARG_WITH([ndbmheader],AS_HELP_STRING([--with-ndbmheader=ARG],[#include to use ndbm]), [nmh_ndbmheader=$withval],[nmh_ndbmheader=autodetect]) if test "$nmh_ndbm" = "autodetect"; then if test "$nmh_ndbmheader" != "autodetect"; then AC_MSG_ERROR([must specify both --with-ndbm and --with-ndbmheader or neither]) else dnl There are at least four implementations of ndbm, and dnl several of those can be in different places at the whim dnl of the system integrator. A good summary of this mess dnl can be found at http://www.unixpapa.com/incnote/dbm.html dnl Classic ndbm with no library required (eg NetBSD): try this dnl first so we don't accidentally link in a pointless but harmless dnl library in one of the later ndbm.h+libfoo tests: NMH_CHECK_NDBM(ndbm.h,,, dnl Berkeley DBv2 emulating ndbm: header in db.h: NMH_CHECK_NDBM(db.h,db,, dnl Berkeley DBv1 emulating ndbm: NMH_CHECK_NDBM(ndbm.h,db,, NMH_CHECK_NDBM(ndbm.h,db1,, dnl Classic ndbm: NMH_CHECK_NDBM(ndbm.h,ndbm,, dnl glibc2.1 systems put db1 in a subdir: NMH_CHECK_NDBM(db1/ndbm.h,db1,, dnl GNU gdbm emulating ndbm, with header possibly in gdbm/ dnl and possibly needing gbdm_compat library: NMH_CHECK_NDBM(gdbm/ndbm.h,gdbm,, NMH_CHECK_NDBM(gdbm/ndbm.h,gdbm_compat -lgdbm,, NMH_CHECK_NDBM(ndbm.h,gdbm,, NMH_CHECK_NDBM(ndbm.h,gdbm_compat -lgdbm)))))))))) fi else dnl We don't really need to check that the user-specified values work, dnl but it is a convenience to the user to bomb out early rather than dnl after configure and half the compile process. NMH_CHECK_NDBM([$nmh_ndbmheader],[$nmh_ndbm]) fi if test "$nmh_ndbm_found" = "no"; then AC_MSG_ERROR([could not find a working ndbm library/header combination]) else dnl Now export the lib/header to our makefile/config.h: if test x"$nmh_ndbmheader" != x; then AC_DEFINE_UNQUOTED(NDBM_HEADER, <$nmh_ndbmheader>, [Define to the header containing the ndbm API prototypes.]) fi if test x"$nmh_ndbm" != x; then NDBM_LIBS="-l$nmh_ndbm" else NDBM_LIBS= fi AC_SUBST([NDBM_LIBS]) fi dnl ------------------ dnl Set RPM build root dnl ------------------ dnl nmhrpm is used in the final summary, see below. The default value is dnl reported there as ./RPM, consistent with the reporting of the default dnl source code location as ., but its absolute path is used in the Makefile. AC_ARG_WITH(rpmdir, AS_HELP_STRING([--with-rpmdir=RPMDIR], [RPM build directory @<:@RPM@:>@])) AS_IF([test x"$with_rpmdir" = x], [rpmdir='$(abs_srcdir)/RPM'; nmhrpm=./RPM], [rpmdir="$with_rpmdir"; eval "nmhrpm=${rpmdir}"]) AC_SUBST([rpmdir]) dnl -------------------- dnl CHECK FOR CYRUS-SASL dnl -------------------- AS_IF([test x"$sasl_support" = x"yes"],[ AC_CHECK_HEADER([sasl/sasl.h], , [AC_MSG_ERROR([sasl.h not found])]) AC_CHECK_LIB([sasl2], [sasl_client_new], [SASLLIB="-lsasl2"], [AC_MSG_ERROR([Cyrus SASL library not found])])],[SASLLIB=""]) AC_SUBST([SASLLIB]) dnl ----------------- dnl CHECK FOR OPENSSL dnl ----------------- AS_IF([test x"$tls_support" = x"yes"],[ AC_CHECK_HEADER([openssl/ssl.h], , [AC_MSG_ERROR([openssl/ssl.h not found])]) AC_CHECK_LIB([crypto], [BIO_write], , [AC_MSG_ERROR([OpenSSL crypto library not found])]) AC_CHECK_LIB([ssl], [SSL_library_init], , [AC_MSG_ERROR([OpenSSL library not found])])]) dnl --------------------- dnl CHECK TERMCAP LIBRARY dnl --------------------- dnl Add the termcap library, so that the following configure dnl tests will find it when it tries to link test programs. nmh_save_LIBS="$LIBS" LIBS="$TERMLIB $LIBS" dnl Check if tgetent accepts NULL (and will allocate its own termcap buffer) dnl Some termcaps reportedly accept a zero buffer, but then dump core dnl in tgetstr(). dnl Under Cygwin test program crashes but exit code is still 0. So, dnl we test for a file that porgram should create AH_TEMPLATE([TGETENT_ACCEPTS_NULL], [Define to 1 if tgetent() accepts NULL as a buffer.]) AC_CACHE_CHECK(if tgetent accepts NULL, nmh_cv_func_tgetent_accepts_null, [AC_TRY_RUN([ main() { char buf[4096]; int r1 = tgetent(buf, "vt100"); int r2 = tgetent((char*)0,"vt100"); if (r1 >= 0 && r1 == r2) { char tbuf[1024], *u; u = tbuf; tgetstr("cl", &u); creat("conftest.tgetent", 0640); } exit((r1 != r2) || r2 == -1); } ], if test -f conftest.tgetent; then nmh_cv_func_tgetent_accepts_null=yes else nmh_cv_func_tgetent_accepts_null=no fi, nmh_cv_func_tgetent_accepts_null=no, nmh_cv_func_tgetent_accepts_null=no)]) if test x$nmh_cv_func_tgetent_accepts_null = xyes; then AC_DEFINE(TGETENT_ACCEPTS_NULL) fi AC_CACHE_CHECK(if tgetent returns 0 on success, nmh_cv_func_tgetent_zero_success, [AC_TRY_RUN([ main() { char buf[4096]; int r1 = tgetent(buf, "!@#$%^&*"); int r2 = tgetent(buf, "vt100"); if (r1 < 0 && r2 == 0) { char tbuf[1024], *u; u = tbuf; tgetstr("cl", &u); creat("conftest.tgetent0", 0640); } exit(r1 == r2); } ], if test -f conftest.tgetent0; then nmh_cv_func_tgetent_zero_success=yes else nmh_cv_func_tgetent_zero_success=no fi, nmh_cv_func_tgetent_zero_success=no, nmh_cv_func_tgetent_zero_success=no)]) AH_TEMPLATE([TGETENT_SUCCESS], [Define to what tgetent() returns on success (0 on HP-UX X/Open curses).]) if test x$nmh_cv_func_tgetent_zero_success = xyes; then AC_DEFINE(TGETENT_SUCCESS, 0) else AC_DEFINE(TGETENT_SUCCESS, 1) fi dnl Now put the libraries back to what it was before we dnl starting checking the termcap library. LIBS="$nmh_save_LIBS" dnl -------------- dnl CHECK TYPEDEFS dnl -------------- AC_TYPE_PID_T AC_TYPE_OFF_T AC_TYPE_UID_T AC_TYPE_MODE_T AC_TYPE_SIZE_T dnl ---------------- dnl CHECK STRUCTURES dnl ---------------- dnl For platforms such as FreeBSD that have tm_gmtoff in struct tm. dnl (FreeBSD has a timezone() function but not a timezone global dnl variable that is visible). AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include ]) AC_STRUCT_DIRENT_D_TYPE dnl Where is located? Needed as input for signames.awk AC_CACHE_CHECK(where signal.h is located, nmh_cv_path_signal_h, [for SIGNAL_H in /usr/include/bsd/sys/signal.h dnl Next /usr/include/asm/signal.h dnl Linux 1.3.0 and above /usr/include/asm/signum.h dnl some versions of Linux/Alpha /usr/include/linux/signal.h dnl Linux up to 1.2.11 /usr/include/sys/signal.h dnl Almost everybody else /dev/null; dnl Just in case we fall through do test -f $SIGNAL_H && \ grep '#[ ]*define[ ][ ]*SIG[0-9A-Z]*[ ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \ break done nmh_cv_path_signal_h=$SIGNAL_H ]) SIGNAL_H=$nmh_cv_path_signal_h AC_SUBST(SIGNAL_H)dnl dnl dnl Sigh, this is required because under the new world order autoconf has dnl nothing to create in a few of the build directories when doing an object dnl tree build. So make sure we created certain directories if they don't dnl exist. dnl AC_CONFIG_COMMANDS([build-directories], [test -d etc || ${MKDIR_P} etc test -d man || ${MKDIR_P} man]) AC_CONFIG_COMMANDS_POST([ dnl These odd looking assignments are done to expand out unexpanded dnl variables in bindir et al (for instance mandir is '${datarootdir}/man'), dnl but expanding that gives '${prefix}/share/man', so we need to expand dnl again to get the final answer. dnl We only use the expanded versions to print the install paths in dnl the final summary and should use them nowhere else (see the autoconf dnl docs for the rationale for bindir etc being unexpanded). eval "nmhbin=${bindir}"; eval "nmhbin=${nmhbin}" eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf=${nmhsysconf}" eval "nmhlib=${libdir}"; eval "nmhlib=${nmhlib}" eval "nmhman=${mandir}"; eval "nmhman=${nmhman}" eval "nmhrpm=${nmhrpm}"; AC_MSG_NOTICE([ nmh configuration ----------------- nmh version : AC_PACKAGE_VERSION host os : ${host} compiler : ${CC} compiler flags : ${CFLAGS} linker flags : ${LDFLAGS} preprocessor flags : ${CPPFLAGS} source code location : ${srcdir} binary install path : ${nmhbin} library install path : ${nmhlib} config files install path : ${nmhsysconf} man page install path : ${nmhman} RPM build root : ${nmhrpm} backup prefix : ${backup_prefix} transport system : ${MTS} file locking type : ${LOCKTYPE} default smtp servers : ${smtpservers} default editor : ${editorpath} default pager : ${pagerpath} SASL support : ${sasl_support} TLS support : ${tls_support} ])])dnl dnl --------------- dnl OUTPUT MAKEFILE dnl --------------- AC_CONFIG_FILES([Makefile test/common.sh]) AC_OUTPUT nmh-1.5/COPYRIGHT000644 007761 000765 00000003123 11476006206 013366 0ustar00kenhkenh000000 000000 Copyright (c) 2002, the authors of nmh All rights reserved. Definition: The "authors of nmh" includes anyone, past or present, who has worked on the nmh source code. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name "the authors of nmh", nor variations such as "The nmh Developers", nor the names of the individual contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY ITS AUTHORS ``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 AUTHORS OF NMH 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. nmh-1.5/DATE000644 007761 000765 00000000015 11765267357 012551 0ustar00kenhkenh000000 000000 11 June 2012 nmh-1.5/depcomp000755 007761 000765 00000042246 11765270216 013466 0ustar00kenhkenh000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2006-10-15.18 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: nmh-1.5/docs/000777 007761 000765 00000000000 11765271326 013040 5ustar00kenhkenh000000 000000 nmh-1.5/etc/000777 007761 000765 00000000000 11765271326 012663 5ustar00kenhkenh000000 000000 nmh-1.5/h/000777 007761 000765 00000000000 11765271326 012337 5ustar00kenhkenh000000 000000 nmh-1.5/INSTALL000644 007761 000765 00000027571 11762736544 013156 0ustar00kenhkenh000000 000000 # # INSTALL -- installation instructions # -------------------------------- Installing nmh, guided by script -------------------------------- For routine installation on popular platforms, the shell script in docs/contrib/build_nmh can be used to guide you through configuration. It will then build and optionally (with -i) install in the configured location. ------------------------ Installing nmh, manually ------------------------ Please read all of the following instructions before you begin building nmh. You should check the MACHINES file to see if there are any specific build instructions for your operating system. To build nmh, you will need an ANSI C compiler such as gcc. 0) If you have obtained nmh by checking it out of the git repository, you will need to run the GNU autotools to regenerate some files. (If your directory already contains a file 'config.h.in' then this has already been done and you do not need to do it.) You can regenerate the files by running the command ./autogen.sh (Note that if you're doing nmh development, you should look at docs/README.developers, since there is other developer-friendly advice there as well.) If you have obtained nmh in the form of a tar archive and are trying to unpack it with cpio: due to an apparent bug in cpio, it might fail with "Malformed number" error messages. Try another tool to unpack, such as tar or pax. 1) From the top-level source directory, run the command ./configure [options] This will check the configuration of your OS, and create the include file config.h, as well as the Makefile. The configure script accepts various options. The options of most interest are listed in a section below. To see the list of all available options, you can run ./configure --help 2) make 3) (Optional) make check This takes a bit of time, around one minute on a modern machine, but is highly recommended. test/inc/test-deb359167 uses valgrind, which detects use of an uninitialized variable on older Linux distributions such as Mandriva 2007.0 and CentOS 5.4. That particular failure is beyond the scope of nmh and can be ignored. 4) make install Note that if you have [n]mh files in your install directories with the same names as the files being installed, the old ones will get overwritten without any warning. 5) Edit the file `mts.conf' (installed in the nmh `etc' directory) and make any necessary changes for the mail transport interface you are using. The default `mts.conf' file assumes you retrieve new mail from a local (or NFS mounted) maildrop, and send outgoing mail by injecting the message to a mail transfer agent (such as sendmail) on the local machine via SMTP. If, instead, all your mail sending and receiving occurs on a remote POP/SMTP server, you will need to look at the values of the variables "localname", "pophost", and "servers": a) "localname" defines the hostname that nmh considers local. If not set, then nmh queries your OS for this value. You will want to change this if you wish your e-mail to appear as if it originated on the POP server. b) "pophost" defines the server that runs the POP daemon, and to which `inc' and `msgchk' will always query for new mail. c) "servers" defines the server to which you send outgoing SMTP traffic. See the discussion of the --with-smtpserver configure option below. If you don't want to hardcode pophost in `mts.conf', you can use the `-host' and `-user' options to `inc' and `msgchk'. Check the `mh-tailor' man page for a list of all the available options for this file. 6) Edit the file `mhn.defaults' (installed in the nmh `etc' directory). This file contains the default profile entries for the nmh command `mhn' and is created by the script `mhn.defaults.sh'. This script will search a generic path (essentially your $PATH) for programs to handle various content types (for example, xv to display images). You can re-run this script and give it a more tailored path. You may want to re-run this script later if you install new programs to display content. An example of this is: % cd support/general % ./mhn.defaults.sh /usr/local/bin:/usr/X11/bin:/usr/ucb > mhn.defaults and then move `mhn.defaults' into the nmh `etc' directory. The `mhn.defaults.sh' script only searches for a simple set of programs. If you have specialized programs to handle various types, you will need to edit the `mhn.defaults' file manually. The syntax of this file is described in the man page for `mhn', and in section 9.4 of the book "MH & xmh: Email for Users and Programmers", 3rd edition, by Jerry Peek, on the Internet at . 7) Add an optional global mh.profile, if desired. This profile should be placed in the nmh `etc' directory with the name `mh.profile'. This file will be used to construct the initial .mh_profile of a new nmh user, but will not be consulted after that. ----------------------------------------------- Compiler options, or using a different compiler ----------------------------------------------- By default, configure will use the "gcc" compiler if found. You can use a different compiler, or add unusual options for compiling or linking that the "configure" script does not know about, by giving "configure" initial values for these on its command line or in its environment. For example, ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix If you wish to add options that are only used at compile time instead of link time, you can use the CPPFLAGS variable: ./configure CPPFLAGS='-Wextra -Wno-sign-compare' If you want to add to both compile and link flags at build time without putting them in the configuration, you can use the AM_CFLAGS Makefile macro: make AM_CFLAGS=--coverage ---------------------------------------- Building nmh on additional architectures ---------------------------------------- To build nmh on additional architectures, you can do a "make distclean". This should restore the nmh source distribution back to its original state. You can then configure nmh as above on other architectures in which you wish to build nmh. Or alternatively, you can use a different build directory for each architecture. --------------------------------- Using a different build directory --------------------------------- You can compile the nmh in a different directory from the one containing the source code. Doing so allows you to compile it on more than one architecture at the same time. To do this, you must use a version of "make" that supports the "VPATH" variable, such as GNU "make". "cd" to the directory where you want the object files and executables to go and run the "configure" script. "configure" automatically checks for the source code in the directory that "configure" is in. For example, cd /usr/local/solaris/nmh /usr/local/src/nmh-1.5/configure make --------------------- Options for configure --------------------- --prefix=DIR (DEFAULT is /usr/local/nmh) This will change the base prefix for the installation location for the various parts of nmh. Unless overridden, nmh is installed in ${prefix}/bin, ${prefix}/etc, ${prefix}/lib, ${prefix}/man. --bindir=DIR (DEFAULT is ${prefix}/bin) nmh's binaries (show, inc, comp, ...) are installed here. --libdir=DIR (DEFAULT is ${prefix}/lib) nmh's support binaries (post, slocal, mhl, ...) are installed here. --sysconfdir=DIR (DEFAULT is ${prefix}/etc) nmh's config files (mts.conf, mhn.defaults, ...) are installed here. --mandir=DIR (DEFAULT is ${prefix}/man) nmh's man pages are installed here. --enable-debug Enable debugging support. --with-editor=EDITOR (DEFAULT is vi) specify the full path of the default editor to use. If this option is not given, then the configuration process will search for the `vi' command and use it as the default. If you wish to specify an interface which is compatible with MH, then use the nmh command `prompter'. If you specify `prompter', then you don't need to give the full pathname. --with-locking=LOCKTYPE (DEFAULT is dot) Specify the locking mechanism when attempting to "inc" or "msgchk" a local mail spool. Valid options are "dot", "fcntl", "flock", and "lockf". Of the four, dot-locking requires no special kernel or filesystem support, and simply creates a file called "FILE.lock" to indicate that "FILE" is locked. In order to be effective, you should contact the site administrator to find out what locking mechanisms other mail delivery and user programs respect. The most common reason not to use dot-locking is if the mail spool directory is not world- or user-writeable, and thus a lock file cannot be created. --enable-lockdir=DIR (DEFAULT is disabled) If dot locking is being used, store all dot-lock files in "DIR". The default is to store them in the directory of the file being locked. --with-mts=MTS (DEFAULT is smtp) Specify the default mail transport system you want to use. The two acceptable options are "smtp" (which is the default), and "sendmail". This value will be put into the mts.conf file. You may find it convenient to specify a value at configure-time, however, so that each time nmh is reinstalled, the right value will be there. If you use "smtp", this will enable a direct SMTP (simple mail transport protocol) interface in nmh. When sending mail, instead of passing the message to the mail transport agent, `post' will open a socket connection to the mail port on the machine specified in the `mts.conf' file (default is localhost), and speak SMTP directly. If you use "sendmail", then `post' will send messages by forking a local copy of sendmail. Currently it will still speak SMTP with this local copy of sendmail. If you wish to use a transport agent other than sendmail, you will need to use a `sendmail wrapper'. --with-ndbm=LIB (DEFAULT is to autodetect) --with-ndbmheader=HEADER (DEFAULT is to autodetect) Specify the header file (eg ndbm.h) and library (eg ndbm) to use to compile against the ndbm database library. By default, configure will try various possibilities until it finds one that works; this option only needs to be specified if the autodetection fails or makes the wrong choice. If either of these options is given then the other must also be specified. --with-pager=PAGER (DEFAULT is more) Specify the default pager (file lister) to use. If this option is not given, then the configuration process will search for the command `more' and use it as the default. --with-smtpservers='SMTPSERVER1[ SMTPSERVER2...]' (DEFAULT is localhost) If this option is not specified, the mts.conf file will contain the line "servers: localhost", which may be manually edited later. You may find it convenient to specify a value at configure-time, however, so that each time nmh is reinstalled, the right value will be there. See the mh-tailor(5) man page for full documentation of "servers:". --with-cyrus-sasl (DEFAULT is without) Enable SASL support for SMTP and POP via the Cyrus SASL library. This is used for the POP AUTH and SMTP AUTH protocols. This supports a wide variety of security mechanisms, including Kerberos/GSSAPI. Session encryption via SASL is supported for both POP and SMTP (depending on server-side support and the security mechanism in use). --with-tls (DEFAULT is without) Enable TLS session encryption support for SMTP via the STARTTLS command. --with-readline (DEFAULT is to autodetect) Enable support for readline functionality (command history/editing) at the WhatNow? prompt. -- The nmh team nmh-workers@nongnu.org nmh-1.5/install-sh000755 007761 000765 00000031600 11765270216 014105 0ustar00kenhkenh000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2006-10-14.15 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 shift shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac done if test $# -ne 0 && test -z "$dir_arg$dstarg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix=/ ;; -*) prefix=./ ;; *) prefix= ;; esac case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac oIFS=$IFS IFS=/ $posix_glob && set -f set fnord $dstdir shift $posix_glob && set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dst"; then $doit $rmcmd -f "$dst" 2>/dev/null \ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: nmh-1.5/m4/000777 007761 000765 00000000000 11765271326 012430 5ustar00kenhkenh000000 000000 nmh-1.5/MACHINES000644 007761 000765 00000005470 11765267273 013232 0ustar00kenhkenh000000 000000 # # MACHINE -- operating system specific information # nmh is known to compile on the following platforms (save the exceptions noted below), using an ANSI C compiler, such as gcc. AIX 4.1.5.0.01 Cygwin (setup version 2.763, other versions may be fine) FreeBSD IRIX 6.5 Linux 2.2 to current (glibc 2.1 to current) Mac OS X NetBSD 1.4.2 OpenBSD Solaris 7 and 8 (sparc,x86) SunOS 4.1 Known Compilation problems: -------------------------------------- -------------------------------------- Cygwin: Be sure to install Cygwin packages libncurses-devel and libncurses10, in the Libs category. -------------------------------------- HPUX: Lots of problems have been reported with using HPUX `cc'. In particular, problems with `scan' giving incorrect dates (everything is 01/00). It is highly recommended that you use `gcc' instead. Also, new versions of HPUX (10.20?) will core dump in `scan' because of some workaround code in zotnet/tws/lexstring.c. This workaround is needed for older versions of HPUX, but causes problems on newer versions. The solution is the added line (minus our indentation): #undef hpux after line 15 of the file zotnet/tws/lexstring.c. -------------------------------------- Irix (SGI): Irix make is notoriously buggy. If you're using it, you should "touch config.h.in" before configuring to prevent a problem where it tries to rebuild targets that shouldn't be rebuilt. (Alternately, you can just use GNU make instead of Irix make.) -------------------------------------- Linux: The configuration script does a test to discover if your vi is broken (if it reports non-zero exit codes on certain pseudo-errors). This test will hang if the program `ex' on your system is a link to the vi clone `vile'. The workaround is to replace the command ex as a link to another vi clone such as nvi or elvis. -------------------------------------- Solaris: With --enable-debug you'll see a lot of warnings. This is even worse when compiling using the Sun Workshop compiler since it issues a warning for every instance of a problem instead of summarizing them. The main one concerns arrays with an index of type char. This is ok. The array itself is a hash of chars, so the array size and the type match. There isn't another safe and portable way to do this at the moment. An explicit cast would get rid of the warnings, but I think it's better to leave it complaining for now until we come up with a better solution. The whole thing is probablly going to be chucked with UTF-8 support anyway. Other than the warnings, it builds ok. -------------------------------------- SunOS 4.1.1/4.1.3/4.1.4: You can't use the C compiler that comes with SunOS 4 since it isn't ANSI C. But nmh builds just fine with gcc. With --enable-debug you will see a lot of warnings. -------------------------------------- -- The nmh team nmh-workers@nongnu.org nmh-1.5/Makefile.am000644 007761 000765 00000055111 11765267273 014151 0ustar00kenhkenh000000 000000 ## ## Our Makefile.am template for Makefile.in (and, eventually, Makefile) ## ## Process this with automake to generate Makefile.in ## ## We set this to get our autoconf macros in the m4 directory ACLOCAL_AMFLAGS = -I m4 ## ## This is the default set of libraries all programs link against. Some ## programs add extra libraries to this set, so they override this with ## a program-specific LDADD variable. Note that in all of the cases today ## LDADD is included in the program-specific LDADD since we want to add ## to this list of libraries, not replace it. ## LDADD = sbr/libmh.a sbr/libdtimep.a ## ## These are used to create the default mhn.defaults config file ## MHNSEARCHPATH is the default path to look for MIME content handlers ## MHNSEARCHPROG is the script used to find the support programs ## MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND" MHNSEARCHPROG = $(srcdir)/etc/mhn.find.sh ## ## Automake doesn't let us install programs in $(libdir), so we create our ## own directory prefix to use in the primary variable. ## auxexecdir = @libdir@ ## ## nmh _does_ have a test suite! ## TESTS_ENVIRONMENT = MH_OBJ_DIR=@abs_builddir@ \ MH_TEST_DIR=@abs_builddir@/test/testdir \ auxexecdir=$(auxexecdir) bindir=$(bindir) \ mandir=$(mandir) sysconfdir=$(sysconfdir) \ $(TESTS_SHELL) ## Keep at end of TESTS_ENVIRONMENT. ## ## Important note: the "cleanup" test should always be last ## TESTS = test/bad-input/test-header \ test/burst/test-burst \ test/comp/test-comp-format \ test/folder/test-create \ test/folder/test-total test/format/test-localmbox \ test/format/test-myname test/format/test-myhost \ test/format/test-mymbox \ test/forw/test-forw-digest \ test/forw/test-forw-format \ test/inc/test-deb359167 test/inc/test-eom-align \ test/inc/test-inc-scanout test/install-mh/test-install-mh \ test/manpages/test-manpages test/mhbuild/test-forw \ test/mhlist/test-mhlist test/mhparam/test-mhparam \ test/mhpath/test-mhpath \ test/mhshow/test-cte-binary test/mhshow/test-qp \ test/mhshow/test-subpart test/mhstore/test-mhstore \ test/new/test-basic \ test/pick/test-pick test/pick/test-stderr \ test/post/test-post-basic test/post/test-post-multiple \ test/post/test-post-dcc test/post/test-post-fcc \ test/post/test-post-multifrom test/post/test-post-envelope \ test/post/test-post-group \ test/refile/test-refile \ test/repl/test-if-str test/repl/test-trailing-newline \ test/repl/test-multicomp \ test/scan/test-scan \ test/sequences/test-flist test/sequences/test-mark \ test/whatnow/test-attach-detach test/whatnow/test-cd \ test/whatnow/test-ls test/whom/test-whom \ test/cleanup ## The "cleanup" test should always be last. check_SCRIPTS = test/common.sh check_PROGRAMS = test/getfullname test/getfqdn test/fakesmtp DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1 ## ## Stuff that should be cleaned via "make clean" ## CLEANFILES = config/version.c sbr/sigmsg.h etc/mts.conf etc/sendfiles \ etc/mhn.defaults man/man.sed man/mh-chart.man $(man_MANS) clean-local: @rm -rf RPM a.out.DSYM uip/a.out.DSYM @rm -rf test/testdir ## ## Stuff that should be cleaned via "make maintainer-clean" ## MAINTAINERCLEANFILES = cscope.files cscope.out ## ## And our own superclean, to get everything left by maintainer-clean. ## SUPERCLEANFILES = ChangeLog Makefile.in aclocal.m4 compile config.guess \ config.h.in config.h.in~ config.sub configure depcomp \ install-sh missing ylwrap nmh-*.tar.gz superclean: maintainer-clean @rm -f $(SUPERCLEANFILES) .PHONY: superclean ## ## Files that need to be built before everything else ## BUILT_SOURCES = sbr/sigmsg.h ## ## This is a list of all programs that get installed in the "bin" directory ## Note that primary difference between "PROGRAMS" and "SCRIPTS" is that ## the latter do not have $(EXEEXT) added on the end. ## bin_PROGRAMS = uip/ali uip/anno uip/burst uip/comp uip/dist uip/flist \ uip/folder uip/forw uip/inc uip/install-mh uip/mark \ uip/mhbuild uip/mhlist uip/mhmail uip/mhn uip/mhparam \ uip/mhpath uip/mhshow uip/mhstore uip/msgchk uip/msh uip/new \ uip/packf uip/pick uip/prompter uip/refile uip/repl uip/rmf \ uip/rmm uip/scan uip/send uip/show uip/sortm uip/whatnow \ uip/whom bin_SCRIPTS = etc/sendfiles ## ## This is all programs that get installed in the "lib" directory ## auxexec_PROGRAMS = uip/ap uip/conflict uip/dp uip/fmtdump uip/mhl uip/post \ uip/rcvdist uip/rcvpack uip/rcvstore uip/rcvtty uip/slocal \ uip/spost uip/viamail uip/mhtest ## ## Internal libraries that we create as part of the build process ## but do not install ## noinst_LIBRARIES = sbr/libmh.a sbr/libdtimep.a mts/libmts.a ## ## These are all of our header files. Right now we don't install any of ## them, but that might change in the future. ## noinst_HEADERS = h/addrsbr.h h/aliasbr.h h/crawl_folders.h h/dropsbr.h \ h/fmt_compile.h h/fmt_scan.h h/md5.h h/mf.h \ h/mh.h h/mhcachesbr.h h/mhparse.h h/mime.h h/msh.h \ h/mts.h h/nmh.h h/picksbr.h h/popsbr.h h/prototypes.h \ h/rcvmail.h h/scansbr.h h/signals.h h/tws.h h/utils.h \ h/vmhsbr.h mts/smtp/smtp.h ## ## Extra files we need to install in various places ## dist_sysconf_DATA = etc/MailAliases etc/components etc/digestcomps \ etc/distcomps etc/forwcomps etc/mhl.body etc/mhl.digest \ etc/mhl.format etc/mhl.forward etc/mhl.headers \ etc/mhl.reply etc/rcvdistcomps etc/rcvdistcomps.outbox \ etc/replcomps etc/replgroupcomps etc/scan.MMDDYY \ etc/scan.YYYYMMDD etc/scan.default etc/scan.mailx \ etc/scan.nomime etc/scan.size etc/scan.time \ etc/scan.timely etc/scan.unseen ## ## The same as above, but we don't include these in the distribution ## (because they're generated at compile time) ## sysconf_DATA = etc/mhn.defaults etc/mts.conf ## ## Documentation that gets installed in docdir ## dist_doc_DATA = COPYRIGHT INSTALL NEWS README VERSION \ docs/COMPLETION-BASH docs/COMPLETION-TCSH \ docs/COMPLETION-ZSH docs/DIFFERENCES docs/FAQ \ docs/MAIL.FILTERING docs/MAILING-LISTS docs/README-ATTACHMENTS \ docs/README-HOOKS docs/README-components docs/README.about \ docs/README.SASL docs/README.developers docs/README.manpages \ docs/TODO ## ## Contribs that get installed in docdir/contrib/ ## contribdir = $(docdir)/contrib dist_contrib_DATA = docs/contrib/nmh.spec docs/contrib/replyfilter \ docs/contrib/build_nmh ## ## Our man pages ## man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \ man/conflict.8 man/dist.1 man/dp.8 man/flist.1 man/flists.1 \ man/fmtdump.8 man/fnext.1 man/folder.1 man/folders.1 \ man/forw.1 man/fprev.1 man/inc.1 man/install-mh.1 man/mark.1 \ man/mh-alias.5 man/mh-chart.1 man/mh-draft.5 man/mh-format.5 \ man/mh-mail.5 man/mh-profile.5 man/mh-sequence.5 \ man/mh-tailor.5 man/mhbuild.1 man/mhl.1 man/mhlist.1 \ man/mhmail.1 man/mhn.1 man/mhparam.1 man/mhpath.1 \ man/mhshow.1 man/mhstore.1 man/msgchk.1 man/msh.1 \ man/mts.conf.5 man/new.1 man/next.1 man/nmh.1 man/packf.1 \ man/pick.1 man/post.8 man/prev.1 man/prompter.1 man/rcvdist.1 \ man/rcvpack.1 man/rcvstore.1 man/rcvtty.1 man/refile.1 \ man/repl.1 man/rmf.1 man/rmm.1 man/scan.1 man/send.1 \ man/sendfiles.1 man/show.1 man/slocal.1 man/sortm.1 man/unseen.1 \ man/whatnow.1 man/whom.1 ## ## Files we need to include in the distribution which aren't found by ## Automake using the automatic rules ## EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \ etc/mhn.defaults.sh $(MHNSEARCHPROG) DATE MACHINES \ docs/ChangeLog_MH-3_to_MH-6.6 \ docs/ChangeLog_MH-6.7.0_to_MH-6.8.4.html \ man/ali.man man/anno.man man/ap.man man/burst.man man/comp.man \ man/conflict.man man/dist.man man/dp.man man/flist.man \ man/flists.man man/fmtdump.man man/fnext.man man/folder.man \ man/folders.man man/forw.man man/fprev.man man/inc.man \ man/install-mh.man man/mark.man man/mh-alias.man \ man/mh-chart-gen.sh man/mh-draft.man man/mh-format.man \ man/mh-mail.man man/mh-profile.man man/mh-sequence.man \ man/mh-tailor.man man/mhbuild.man man/mhl.man man/mhlist.man \ man/mhmail.man man/mhn.man man/mhparam.man man/mhpath.man \ man/mhshow.man man/mhstore.man man/msgchk.man man/msh.man \ man/mts.conf.man man/new.man man/next.man man/nmh.man \ man/packf.man man/pick.man man/post.man man/prev.man \ man/prompter.man man/rcvdist.man man/rcvpack.man \ man/rcvstore.man man/rcvtty.man man/refile.man man/repl.man \ man/rmf.man man/rmm.man man/scan.man man/send.man \ man/sendfiles.man man/show.man man/slocal.man man/sortm.man \ man/unseen.man man/whatnow.man man/whom.man \ test/README $(TESTS) test/inc/deb359167.mbox \ test/inc/fromline.txt test/inc/msgheader.txt test/inc/filler.txt \ test/inc/md5sums test/post/test-post-common.sh ## ## These are all of the definitions for each of the programs listed above. ## They describe the source files that make up the programs and any particular ## overrides that are used to select different library options from the ## default. ## uip_ali_SOURCES = uip/ali.c uip/aliasbr.c uip_anno_SOURCES = uip/anno.c uip/annosbr.c uip_burst_SOURCES = uip/burst.c uip_comp_SOURCES = uip/comp.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip_comp_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_dist_SOURCES = uip/dist.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip/forwsbr.c uip_dist_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_flist_SOURCES = uip/flist.c uip_folder_SOURCES = uip/folder.c uip_forw_SOURCES = uip/forw.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip/forwsbr.c uip_forw_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/termsbr.c \ uip/popsbr.c uip_inc_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(SASLLIB) uip_install_mh_SOURCES = uip/install-mh.c uip_mark_SOURCES = uip/mark.c uip_mhbuild_SOURCES = uip/mhbuild.c uip/mhbuildsbr.c uip/mhcachesbr.c \ uip/mhlistsbr.c uip/mhoutsbr.c uip/mhmisc.c \ uip/mhfree.c uip/mhparse.c uip/termsbr.c uip/md5.c uip_mhbuild_LDADD = $(LDADD) $(TERMLIB) uip_mhlist_SOURCES = uip/mhlist.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhlistsbr.c uip/mhmisc.c uip/mhfree.c uip/termsbr.c \ uip/md5.c uip_mhlist_LDADD = $(LDADD) $(TERMLIB) uip_mhmail_SOURCES = uip/mhmail.c uip_mhn_SOURCES = uip/mhn.c uip/mhparse.c uip/mhcachesbr.c uip/mhshowsbr.c \ uip/mhlistsbr.c uip/mhstoresbr.c uip/mhmisc.c uip/mhfree.c \ uip/termsbr.c uip/md5.c uip_mhn_LDADD = $(LDADD) $(TERMLIB) uip_mhparam_SOURCES = uip/mhparam.c uip_mhpath_SOURCES = uip/mhpath.c uip_mhshow_SOURCES = uip/mhshow.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhshowsbr.c uip/mhlistsbr.c uip/mhmisc.c \ uip/mhfree.c uip/termsbr.c uip/md5.c uip_mhshow_LDADD = $(LDADD) $(TERMLIB) uip_mhstore_SOURCES = uip/mhstore.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhshowsbr.c uip/mhlistsbr.c uip/mhstoresbr.c \ uip/mhmisc.c uip/mhfree.c uip/termsbr.c uip/md5.c uip_mhstore_LDADD = $(LDADD) $(TERMLIB) uip_msgchk_SOURCES = uip/msgchk.c uip/popsbr.c uip_msgchk_LDADD = $(LDADD) $(SASLLIB) uip_msh_SOURCES = uip/msh.c uip/mshcmds.c uip/vmhsbr.c uip/picksbr.c \ uip/scansbr.c uip/dropsbr.c uip/mhlsbr.c uip/termsbr.c uip_msh_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_new_SOURCES = uip/new.c uip_packf_SOURCES = uip/packf.c uip/dropsbr.c uip_pick_SOURCES = uip/pick.c uip/picksbr.c uip_prompter_SOURCES = uip/prompter.c uip_refile_SOURCES = uip/refile.c uip_repl_SOURCES = uip/repl.c uip/replsbr.c uip/whatnowproc.c \ uip/whatnowsbr.c uip/sendsbr.c uip/annosbr.c uip/distsbr.c uip_repl_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_rmf_SOURCES = uip/rmf.c uip_rmm_SOURCES = uip/rmm.c uip_scan_SOURCES = uip/scan.c uip/scansbr.c uip/termsbr.c uip_scan_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_send_SOURCES = uip/send.c uip/sendsbr.c uip/annosbr.c uip/distsbr.c uip_show_SOURCES = uip/show.c uip/mhlsbr.c uip/termsbr.c uip_show_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_sortm_SOURCES = uip/sortm.c uip_whatnow_SOURCES = uip/whatnow.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip_whatnow_LDADD = $(LDADD) $(READLINELIB) uip_whom_SOURCES = uip/whom.c uip/distsbr.c ## ## Programs definitions for all utilities that end up in $(libdir) ## uip_ap_SOURCES = uip/ap.c uip/termsbr.c uip_ap_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_conflict_SOURCES = uip/conflict.c uip/aliasbr.c uip_dp_SOURCES = uip/dp.c uip/termsbr.c uip_dp_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_fmtdump_SOURCES = uip/fmtdump.c uip_fmtdump_LDADD = $(LDADD) $(ICONVLIB) uip_mhl_SOURCES = uip/mhl.c uip/mhlsbr.c uip/termsbr.c uip_mhl_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_mhtest_SOURCES = uip/mhtest.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhoutsbr.c uip/mhmisc.c uip/mhfree.c \ uip/termsbr.c uip/md5.c uip_mhtest_LDADD = $(LDADD) $(TERMLIB) uip_post_SOURCES = uip/post.c uip/aliasbr.c uip_post_LDADD = mts/libmts.a $(LDADD) $(SASLLIB) uip_rcvdist_SOURCES = uip/rcvdist.c uip/distsbr.c uip_rcvdist_LDADD = $(LDADD) $(ICONVLIB) uip_rcvpack_SOURCES = uip/rcvpack.c uip/dropsbr.c uip_rcvstore_SOURCES = uip/rcvstore.c uip_rcvtty_SOURCES = uip/rcvtty.c uip/scansbr.c uip/termsbr.c uip_rcvtty_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_slocal_SOURCES = uip/slocal.c uip/aliasbr.c uip/dropsbr.c uip_slocal_LDADD = $(LDADD) $(NDBM_LIBS) uip_spost_SOURCES = uip/spost.c uip/aliasbr.c uip_viamail_SOURCES = uip/viamail.c uip/mhmisc.c uip/mhoutsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c test_getfullname_SOURCES = test/getfullname.c test_getfullname_LDADD = sbr/libmh.a test_getfqdn_SOURCES = test/getfqdn.c test_getfqdn_LDADD = test_fakesmtp_SOURCES = test/fakesmtp.c test_fakesmtp_LDADD = ## ## Our rebuild rules for files that aren't built via the normal mechanisms ## config/version.c: Makefile sh $(srcdir)/config/version.sh $(VERSION) > $@ sbr/sigmsg.h: $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) $(AWK) -f $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) > $@ etc/mts.conf: $(srcdir)/etc/mts.conf.in Makefile rm -f $@ $(SED) -e 's,%mts%,$(MTS),' \ -e 's,%mailspool%,$(mailspool),' \ -e 's,%smtpservers%,$(smtpservers),' \ < $(srcdir)/etc/mts.conf.in > $@ etc/mhn.defaults: $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPROG) rm -f $@ $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@ etc/sendfiles: $(srcdir)/etc/sendfiles.in Makefile rm -f $@ $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/etc/sendfiles.in > $@ ## ## This rule gets called at "make install" time; we use it to create links ## between different programs. ## install-exec-hook: rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT) rm -f $(DESTDIR)$(bindir)/folders$(EXEEXT) rm -f $(DESTDIR)$(bindir)/fnext$(EXEEXT) rm -f $(DESTDIR)$(bindir)/fprev$(EXEEXT) rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT) rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT) rm -f $(DESTDIR)$(bindir)/next$(EXEEXT) ln $(DESTDIR)$(bindir)/flist$(EXEEXT) $(DESTDIR)$(bindir)/flists$(EXEEXT) ln $(DESTDIR)$(bindir)/folder$(EXEEXT) $(DESTDIR)$(bindir)/folders$(EXEEXT) ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fnext$(EXEEXT) ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fprev$(EXEEXT) ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/unseen$(EXEEXT) ln $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/prev$(EXEEXT) ln $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/next$(EXEEXT) if test x$(SETGID_MAIL) != x; then \ chgrp $(MAIL_SPOOL_GRP) $(DESTDIR)$(bindir)/inc$(EXEEXT) && \ chmod 2755 $(DESTDIR)$(bindir)/inc$(EXEEXT); \ fi install-data-hook: rm -f $(DESTDIR)$(man5dir)/mh_profile.5 ln $(DESTDIR)$(man5dir)/mh-profile.5 $(DESTDIR)$(man5dir)/mh_profile.5 ## ## Make sure we remove those links at uninstall time ## uninstall-hook: rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT) rm -f $(DESTDIR)$(bindir)/folders$(EXEEXT) rm -f $(DESTDIR)$(bindir)/fnext$(EXEEXT) rm -f $(DESTDIR)$(bindir)/fprev$(EXEEXT) rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT) rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT) rm -f $(DESTDIR)$(bindir)/next$(EXEEXT) rm -f $(DESTDIR)$(man5dir)/mh_profile.5 ## ## Our rules to build our internal libraries (libmh.a, libmts.a) ## sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/brkstring.c \ sbr/check_charset.c sbr/client.c sbr/closefds.c \ sbr/concat.c sbr/context_del.c sbr/context_find.c \ sbr/context_foil.c sbr/context_read.c \ sbr/context_replace.c sbr/context_save.c \ sbr/copy.c sbr/copyip.c sbr/cpydata.c \ sbr/cpydgst.c sbr/crawl_folders.c sbr/discard.c \ sbr/done.c sbr/dtime.c sbr/escape_display_name.c \ sbr/error.c sbr/ext_hook.c sbr/fdcompare.c \ sbr/folder_addmsg.c sbr/folder_delmsgs.c \ sbr/folder_free.c sbr/folder_pack.c \ sbr/folder_read.c sbr/folder_realloc.c sbr/gans.c \ sbr/getans.c sbr/getanswer.c sbr/getarguments.c \ sbr/getcpy.c sbr/getfolder.c sbr/getpass.c \ sbr/fmt_addr.c sbr/fmt_compile.c sbr/fmt_new.c \ sbr/fmt_rfc2047.c sbr/fmt_scan.c sbr/lock_file.c \ sbr/m_atoi.c sbr/m_backup.c sbr/m_convert.c \ sbr/m_draft.c sbr/m_getfld.c sbr/m_gmprot.c \ sbr/m_maildir.c sbr/m_name.c \ sbr/makedir.c sbr/mts.c sbr/norm_charmap.c sbr/path.c \ sbr/peekc.c sbr/pidwait.c sbr/pidstatus.c \ sbr/print_help.c sbr/print_sw.c sbr/print_version.c \ sbr/push.c sbr/putenv.c sbr/refile.c sbr/remdir.c \ sbr/r1bindex.c sbr/readconfig.c sbr/ruserpass.c \ sbr/seq_add.c sbr/seq_bits.c sbr/seq_del.c \ sbr/seq_getnum.c sbr/seq_list.c sbr/seq_nameok.c \ sbr/seq_print.c sbr/seq_read.c sbr/seq_save.c \ sbr/seq_setcur.c sbr/seq_setprev.c sbr/seq_setunseen.c \ sbr/showfile.c sbr/signals.c sbr/smatch.c \ sbr/snprintb.c sbr/ssequal.c sbr/strcasecmp.c \ sbr/strindex.c sbr/trimcpy.c sbr/uprf.c sbr/vfgets.c \ sbr/fmt_def.c sbr/m_msgdef.c sbr/mf.c sbr/utils.c \ sbr/m_mktemp.c sbr/getansreadline.c config/config.c \ config/version.c sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(sysconfdir)"' \ -DMAILSPOOL='"$(mailspool)"' \ -DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \ -DNMHLIBDIR='"$(libdir)"' \ -DDEFAULT_EDITOR='"$(editorpath)"' \ -DDEFAULT_PAGER='"$(pagerpath)"' sbr_libdtimep_a_SOURCES = sbr/dtimep.l sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) \ $(DISABLE_UNUSED_MACROS_WARNING) \ $(DISABLE_SIGN_COMPARE_WARNING) mts_libmts_a_SOURCES = mts/smtp/smtp.c ## ## Our rules for generating man pages (both the rule for man.sed and ## the implicit rules for man page generation). ## manext1 = 1 manext5 = 5 manext8 = 8 $(man_MANS): man/man.sed man/man.sed: Makefile @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@ @echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@ @echo 's,%nmhdate%,$(DATE),g' >> $@ @echo 's,%bindir%,$(bindir),g' >> $@ @echo 's,%etcdir%,$(sysconfdir),g' >> $@ @echo 's,%libdir%,$(libdir),g' >> $@ @echo 's,%mandir%,$(mandir),g' >> $@ @echo 's,%mailspool%,$(mailspool),g' >> $@ @echo 's,%sendmailpath%,$(sendmailpath),g' >> $@ @echo 's,%default_editor%,$(editorpath),g' >> $@ @echo 's,%default_pager%,$(pagerpath),g' >> $@ @echo 's,%manext1%,$(manext1),g' >> $@ @echo 's,%manext5%,$(manext5),g' >> $@ @echo 's,%manext8%,$(manext8),g' >> $@ @echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@ @echo ' s,%mhl_forward%,,g' >> $@ @echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@ @echo ' s,%mhl_format%,,g' >> $@ @echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@ @echo ' s,%mhl_reply%,,g' >> $@ man/mh-chart.man: @$(srcdir)/man/mh-chart-gen.sh > $@ .man.$(manext1): @$(SED) -f man/man.sed $< > $@ .man.$(manext5): @$(SED) -f man/man.sed $< > $@ .man.$(manext8): @$(SED) -f man/man.sed $< > $@ ## Don't include commit hashes in ChangeLog. ChangeLog: @[ -d .git ] && git --no-pager log --abbrev-commit | \ egrep -v '^commit [0-9a-f]+$$' > $@ || true ## Make ChangeLog phony so it will always get regenerated. But don't ## fail if we don't have a git repository in order to allow ## regeneration of distribution archive or RPM. .PHONY: ChangeLog ## ## Our RPM build target ## rpm: dist @test -d $(rpmdir)/SOURCES || $(MKDIR_P) $(rpmdir)/SOURCES @test -d $(rpmdir)/SPECS || $(MKDIR_P) $(rpmdir)/SPECS @mv -f $(DIST_ARCHIVES) $(rpmdir)/SOURCES @cp -p VERSION $(rpmdir)/SOURCES @cp -p docs/contrib/nmh.spec $(rpmdir)/SPECS @rpmbuild --define '_topdir $(rpmdir)' \ --define '_tmppath %{_topdir}/TMP' \ --define "_sysconfdir $(DESTDIR)$(sysconfdir)" \ -ba $(rpmdir)/SPECS/nmh.spec .PHONY: rpm ## ## A target to build information needed by cscope ## cscope: echo "-I $(srcdir)/h -I $(srcdir)/sbr -I $(srcdir)/uip -I $(srcdir)/mts/smtp" > cscope.files find $(srcdir) \( -name docs -prune \) -o \( -name \*.c -o -name \*.l \) -print | grep -v dtimep.c >> cscope.files .PHONY: cscope ## ## Use GNU gcov to find the coverage of the test suite. ## These targets are not integrated into the other automake ## targets because they will be used so infrequently, if at all. ## gcov: @if ./config.status --config | grep -e --enable-debug >/dev/null; then \ echo For best results with gcov, configure without --enable-debug; \ fi @echo rebuilding with AM_CFLAGS=--coverage . . . @(make clean && make AM_CFLAGS=--coverage) > /dev/null && \ make check AM_CFLAGS=--coverage @for i in `find . -name '*.gcda'`; do \ gcov -p -o `echo $$i | $(SED) 's%\\(.*\\)/%\\1 %'`; \ done @for i in `find . -name '*.gcno'`; do \ if ! test -f `echo $$i | sed 's%\.gcno%.gcda%'`; then \ echo untested: $$i; \ fi; \ done gcov-mostlyclean: @find . -name '*.gcno' -o -name '*.gcda' | xargs rm gcov-clean: gcov-mostlyclean @find . -name '*.gcov' | xargs rm .PHONY: gcov gcov-mostlyclean gcov-clean ## ## Rules to upload the distribution to savannah ## upload: dist @if test -z "$(SAVANNAH_USERNAME)"; then \ echo "You need to set SAVANNAH_USERNAME to the your username on savannah.gnu.org." ;\ echo "You can set it either in your environment or on the make command line."; \ false; \ fi @echo "Did you run 'make distcheck' already?" @if test -z "$(SKIP_GPG_SIG)"; then \ echo "Creating GPG signature (set SKIP_GPG_SIG to bypass this step)"; \ gpg --output $(DIST_ARCHIVES).sig --detatch-sig $(DIST_ARCHIVES); \ fi @echo "Setting permissions for savannah.gnu.org" chmod 664 $(DIST_ARCHIVES) if test -f $(DIST_ARCHIVES).sig; then \ chmod 664 $(DIST_ARCHIVES).sig; \ fi @echo "Uploading to savannah" scp -p $(DIST_ARCHIVES)* $(SAVANNAH_USERNAME)@dl.sv.nongnu.org:/releases/nmh .PHONY: upload nmh-1.5/Makefile.in000644 007761 000765 00001135703 11765270217 014161 0ustar00kenhkenh000000 000000 # Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = test/getfullname$(EXEEXT) test/getfqdn$(EXEEXT) \ test/fakesmtp$(EXEEXT) bin_PROGRAMS = uip/ali$(EXEEXT) uip/anno$(EXEEXT) uip/burst$(EXEEXT) \ uip/comp$(EXEEXT) uip/dist$(EXEEXT) uip/flist$(EXEEXT) \ uip/folder$(EXEEXT) uip/forw$(EXEEXT) uip/inc$(EXEEXT) \ uip/install-mh$(EXEEXT) uip/mark$(EXEEXT) uip/mhbuild$(EXEEXT) \ uip/mhlist$(EXEEXT) uip/mhmail$(EXEEXT) uip/mhn$(EXEEXT) \ uip/mhparam$(EXEEXT) uip/mhpath$(EXEEXT) uip/mhshow$(EXEEXT) \ uip/mhstore$(EXEEXT) uip/msgchk$(EXEEXT) uip/msh$(EXEEXT) \ uip/new$(EXEEXT) uip/packf$(EXEEXT) uip/pick$(EXEEXT) \ uip/prompter$(EXEEXT) uip/refile$(EXEEXT) uip/repl$(EXEEXT) \ uip/rmf$(EXEEXT) uip/rmm$(EXEEXT) uip/scan$(EXEEXT) \ uip/send$(EXEEXT) uip/show$(EXEEXT) uip/sortm$(EXEEXT) \ uip/whatnow$(EXEEXT) uip/whom$(EXEEXT) auxexec_PROGRAMS = uip/ap$(EXEEXT) uip/conflict$(EXEEXT) \ uip/dp$(EXEEXT) uip/fmtdump$(EXEEXT) uip/mhl$(EXEEXT) \ uip/post$(EXEEXT) uip/rcvdist$(EXEEXT) uip/rcvpack$(EXEEXT) \ uip/rcvstore$(EXEEXT) uip/rcvtty$(EXEEXT) uip/slocal$(EXEEXT) \ uip/spost$(EXEEXT) uip/viamail$(EXEEXT) uip/mhtest$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_contrib_DATA) \ $(dist_doc_DATA) $(dist_sysconf_DATA) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(top_srcdir)/configure \ $(top_srcdir)/test/common.sh.in ChangeLog INSTALL NEWS compile \ config.guess config.sub depcomp install-sh missing \ sbr/dtimep.c ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ndbm.m4 \ $(top_srcdir)/m4/netlibs.m4 $(top_srcdir)/m4/readline.m4 \ $(top_srcdir)/VERSION $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = test/common.sh LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru mts_libmts_a_AR = $(AR) $(ARFLAGS) mts_libmts_a_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_mts_libmts_a_OBJECTS = mts/smtp/smtp.$(OBJEXT) mts_libmts_a_OBJECTS = $(am_mts_libmts_a_OBJECTS) sbr_libdtimep_a_AR = $(AR) $(ARFLAGS) sbr_libdtimep_a_LIBADD = am_sbr_libdtimep_a_OBJECTS = sbr/sbr_libdtimep_a-dtimep.$(OBJEXT) sbr_libdtimep_a_OBJECTS = $(am_sbr_libdtimep_a_OBJECTS) sbr_libmh_a_AR = $(AR) $(ARFLAGS) sbr_libmh_a_LIBADD = am_sbr_libmh_a_OBJECTS = sbr/sbr_libmh_a-addrsbr.$(OBJEXT) \ sbr/sbr_libmh_a-ambigsw.$(OBJEXT) \ sbr/sbr_libmh_a-atooi.$(OBJEXT) \ sbr/sbr_libmh_a-brkstring.$(OBJEXT) \ sbr/sbr_libmh_a-check_charset.$(OBJEXT) \ sbr/sbr_libmh_a-client.$(OBJEXT) \ sbr/sbr_libmh_a-closefds.$(OBJEXT) \ sbr/sbr_libmh_a-concat.$(OBJEXT) \ sbr/sbr_libmh_a-context_del.$(OBJEXT) \ sbr/sbr_libmh_a-context_find.$(OBJEXT) \ sbr/sbr_libmh_a-context_foil.$(OBJEXT) \ sbr/sbr_libmh_a-context_read.$(OBJEXT) \ sbr/sbr_libmh_a-context_replace.$(OBJEXT) \ sbr/sbr_libmh_a-context_save.$(OBJEXT) \ sbr/sbr_libmh_a-copy.$(OBJEXT) \ sbr/sbr_libmh_a-copyip.$(OBJEXT) \ sbr/sbr_libmh_a-cpydata.$(OBJEXT) \ sbr/sbr_libmh_a-cpydgst.$(OBJEXT) \ sbr/sbr_libmh_a-crawl_folders.$(OBJEXT) \ sbr/sbr_libmh_a-discard.$(OBJEXT) \ sbr/sbr_libmh_a-done.$(OBJEXT) sbr/sbr_libmh_a-dtime.$(OBJEXT) \ sbr/sbr_libmh_a-escape_display_name.$(OBJEXT) \ sbr/sbr_libmh_a-error.$(OBJEXT) \ sbr/sbr_libmh_a-ext_hook.$(OBJEXT) \ sbr/sbr_libmh_a-fdcompare.$(OBJEXT) \ sbr/sbr_libmh_a-folder_addmsg.$(OBJEXT) \ sbr/sbr_libmh_a-folder_delmsgs.$(OBJEXT) \ sbr/sbr_libmh_a-folder_free.$(OBJEXT) \ sbr/sbr_libmh_a-folder_pack.$(OBJEXT) \ sbr/sbr_libmh_a-folder_read.$(OBJEXT) \ sbr/sbr_libmh_a-folder_realloc.$(OBJEXT) \ sbr/sbr_libmh_a-gans.$(OBJEXT) \ sbr/sbr_libmh_a-getans.$(OBJEXT) \ sbr/sbr_libmh_a-getanswer.$(OBJEXT) \ sbr/sbr_libmh_a-getarguments.$(OBJEXT) \ sbr/sbr_libmh_a-getcpy.$(OBJEXT) \ sbr/sbr_libmh_a-getfolder.$(OBJEXT) \ sbr/sbr_libmh_a-getpass.$(OBJEXT) \ sbr/sbr_libmh_a-fmt_addr.$(OBJEXT) \ sbr/sbr_libmh_a-fmt_compile.$(OBJEXT) \ sbr/sbr_libmh_a-fmt_new.$(OBJEXT) \ sbr/sbr_libmh_a-fmt_rfc2047.$(OBJEXT) \ sbr/sbr_libmh_a-fmt_scan.$(OBJEXT) \ sbr/sbr_libmh_a-lock_file.$(OBJEXT) \ sbr/sbr_libmh_a-m_atoi.$(OBJEXT) \ sbr/sbr_libmh_a-m_backup.$(OBJEXT) \ sbr/sbr_libmh_a-m_convert.$(OBJEXT) \ sbr/sbr_libmh_a-m_draft.$(OBJEXT) \ sbr/sbr_libmh_a-m_getfld.$(OBJEXT) \ sbr/sbr_libmh_a-m_gmprot.$(OBJEXT) \ sbr/sbr_libmh_a-m_maildir.$(OBJEXT) \ sbr/sbr_libmh_a-m_name.$(OBJEXT) \ sbr/sbr_libmh_a-makedir.$(OBJEXT) \ sbr/sbr_libmh_a-mts.$(OBJEXT) \ sbr/sbr_libmh_a-norm_charmap.$(OBJEXT) \ sbr/sbr_libmh_a-path.$(OBJEXT) sbr/sbr_libmh_a-peekc.$(OBJEXT) \ sbr/sbr_libmh_a-pidwait.$(OBJEXT) \ sbr/sbr_libmh_a-pidstatus.$(OBJEXT) \ sbr/sbr_libmh_a-print_help.$(OBJEXT) \ sbr/sbr_libmh_a-print_sw.$(OBJEXT) \ sbr/sbr_libmh_a-print_version.$(OBJEXT) \ sbr/sbr_libmh_a-push.$(OBJEXT) \ sbr/sbr_libmh_a-putenv.$(OBJEXT) \ sbr/sbr_libmh_a-refile.$(OBJEXT) \ sbr/sbr_libmh_a-remdir.$(OBJEXT) \ sbr/sbr_libmh_a-r1bindex.$(OBJEXT) \ sbr/sbr_libmh_a-readconfig.$(OBJEXT) \ sbr/sbr_libmh_a-ruserpass.$(OBJEXT) \ sbr/sbr_libmh_a-seq_add.$(OBJEXT) \ sbr/sbr_libmh_a-seq_bits.$(OBJEXT) \ sbr/sbr_libmh_a-seq_del.$(OBJEXT) \ sbr/sbr_libmh_a-seq_getnum.$(OBJEXT) \ sbr/sbr_libmh_a-seq_list.$(OBJEXT) \ sbr/sbr_libmh_a-seq_nameok.$(OBJEXT) \ sbr/sbr_libmh_a-seq_print.$(OBJEXT) \ sbr/sbr_libmh_a-seq_read.$(OBJEXT) \ sbr/sbr_libmh_a-seq_save.$(OBJEXT) \ sbr/sbr_libmh_a-seq_setcur.$(OBJEXT) \ sbr/sbr_libmh_a-seq_setprev.$(OBJEXT) \ sbr/sbr_libmh_a-seq_setunseen.$(OBJEXT) \ sbr/sbr_libmh_a-showfile.$(OBJEXT) \ sbr/sbr_libmh_a-signals.$(OBJEXT) \ sbr/sbr_libmh_a-smatch.$(OBJEXT) \ sbr/sbr_libmh_a-snprintb.$(OBJEXT) \ sbr/sbr_libmh_a-ssequal.$(OBJEXT) \ sbr/sbr_libmh_a-strcasecmp.$(OBJEXT) \ sbr/sbr_libmh_a-strindex.$(OBJEXT) \ sbr/sbr_libmh_a-trimcpy.$(OBJEXT) \ sbr/sbr_libmh_a-uprf.$(OBJEXT) \ sbr/sbr_libmh_a-vfgets.$(OBJEXT) \ sbr/sbr_libmh_a-fmt_def.$(OBJEXT) \ sbr/sbr_libmh_a-m_msgdef.$(OBJEXT) \ sbr/sbr_libmh_a-mf.$(OBJEXT) sbr/sbr_libmh_a-utils.$(OBJEXT) \ sbr/sbr_libmh_a-m_mktemp.$(OBJEXT) \ sbr/sbr_libmh_a-getansreadline.$(OBJEXT) \ config/sbr_libmh_a-config.$(OBJEXT) \ config/sbr_libmh_a-version.$(OBJEXT) sbr_libmh_a_OBJECTS = $(am_sbr_libmh_a_OBJECTS) am__installdirs = "$(DESTDIR)$(auxexecdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \ "$(DESTDIR)$(contribdir)" "$(DESTDIR)$(docdir)" \ "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(sysconfdir)" auxexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(auxexec_PROGRAMS) $(bin_PROGRAMS) am_test_fakesmtp_OBJECTS = test/fakesmtp.$(OBJEXT) test_fakesmtp_OBJECTS = $(am_test_fakesmtp_OBJECTS) test_fakesmtp_DEPENDENCIES = am_test_getfqdn_OBJECTS = test/getfqdn.$(OBJEXT) test_getfqdn_OBJECTS = $(am_test_getfqdn_OBJECTS) test_getfqdn_DEPENDENCIES = am_test_getfullname_OBJECTS = test/getfullname.$(OBJEXT) test_getfullname_OBJECTS = $(am_test_getfullname_OBJECTS) test_getfullname_DEPENDENCIES = sbr/libmh.a am_uip_ali_OBJECTS = uip/ali.$(OBJEXT) uip/aliasbr.$(OBJEXT) uip_ali_OBJECTS = $(am_uip_ali_OBJECTS) uip_ali_LDADD = $(LDADD) uip_ali_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_anno_OBJECTS = uip/anno.$(OBJEXT) uip/annosbr.$(OBJEXT) uip_anno_OBJECTS = $(am_uip_anno_OBJECTS) uip_anno_LDADD = $(LDADD) uip_anno_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_ap_OBJECTS = uip/ap.$(OBJEXT) uip/termsbr.$(OBJEXT) uip_ap_OBJECTS = $(am_uip_ap_OBJECTS) am__DEPENDENCIES_1 = uip_ap_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_burst_OBJECTS = uip/burst.$(OBJEXT) uip_burst_OBJECTS = $(am_uip_burst_OBJECTS) uip_burst_LDADD = $(LDADD) uip_burst_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_comp_OBJECTS = uip/comp.$(OBJEXT) uip/whatnowproc.$(OBJEXT) \ uip/whatnowsbr.$(OBJEXT) uip/sendsbr.$(OBJEXT) \ uip/annosbr.$(OBJEXT) uip/distsbr.$(OBJEXT) uip_comp_OBJECTS = $(am_uip_comp_OBJECTS) uip_comp_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_conflict_OBJECTS = uip/conflict.$(OBJEXT) uip/aliasbr.$(OBJEXT) uip_conflict_OBJECTS = $(am_uip_conflict_OBJECTS) uip_conflict_LDADD = $(LDADD) uip_conflict_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_dist_OBJECTS = uip/dist.$(OBJEXT) uip/whatnowproc.$(OBJEXT) \ uip/whatnowsbr.$(OBJEXT) uip/sendsbr.$(OBJEXT) \ uip/annosbr.$(OBJEXT) uip/distsbr.$(OBJEXT) \ uip/forwsbr.$(OBJEXT) uip_dist_OBJECTS = $(am_uip_dist_OBJECTS) uip_dist_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_dp_OBJECTS = uip/dp.$(OBJEXT) uip/termsbr.$(OBJEXT) uip_dp_OBJECTS = $(am_uip_dp_OBJECTS) uip_dp_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_flist_OBJECTS = uip/flist.$(OBJEXT) uip_flist_OBJECTS = $(am_uip_flist_OBJECTS) uip_flist_LDADD = $(LDADD) uip_flist_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_fmtdump_OBJECTS = uip/fmtdump.$(OBJEXT) uip_fmtdump_OBJECTS = $(am_uip_fmtdump_OBJECTS) uip_fmtdump_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_folder_OBJECTS = uip/folder.$(OBJEXT) uip_folder_OBJECTS = $(am_uip_folder_OBJECTS) uip_folder_LDADD = $(LDADD) uip_folder_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_forw_OBJECTS = uip/forw.$(OBJEXT) uip/whatnowproc.$(OBJEXT) \ uip/whatnowsbr.$(OBJEXT) uip/sendsbr.$(OBJEXT) \ uip/annosbr.$(OBJEXT) uip/distsbr.$(OBJEXT) \ uip/forwsbr.$(OBJEXT) uip_forw_OBJECTS = $(am_uip_forw_OBJECTS) uip_forw_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_inc_OBJECTS = uip/inc.$(OBJEXT) uip/scansbr.$(OBJEXT) \ uip/dropsbr.$(OBJEXT) uip/termsbr.$(OBJEXT) \ uip/popsbr.$(OBJEXT) uip_inc_OBJECTS = $(am_uip_inc_OBJECTS) uip_inc_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_uip_install_mh_OBJECTS = uip/install-mh.$(OBJEXT) uip_install_mh_OBJECTS = $(am_uip_install_mh_OBJECTS) uip_install_mh_LDADD = $(LDADD) uip_install_mh_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_mark_OBJECTS = uip/mark.$(OBJEXT) uip_mark_OBJECTS = $(am_uip_mark_OBJECTS) uip_mark_LDADD = $(LDADD) uip_mark_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_mhbuild_OBJECTS = uip/mhbuild.$(OBJEXT) \ uip/mhbuildsbr.$(OBJEXT) uip/mhcachesbr.$(OBJEXT) \ uip/mhlistsbr.$(OBJEXT) uip/mhoutsbr.$(OBJEXT) \ uip/mhmisc.$(OBJEXT) uip/mhfree.$(OBJEXT) \ uip/mhparse.$(OBJEXT) uip/termsbr.$(OBJEXT) uip/md5.$(OBJEXT) uip_mhbuild_OBJECTS = $(am_uip_mhbuild_OBJECTS) uip_mhbuild_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_mhl_OBJECTS = uip/mhl.$(OBJEXT) uip/mhlsbr.$(OBJEXT) \ uip/termsbr.$(OBJEXT) uip_mhl_OBJECTS = $(am_uip_mhl_OBJECTS) uip_mhl_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_mhlist_OBJECTS = uip/mhlist.$(OBJEXT) uip/mhparse.$(OBJEXT) \ uip/mhcachesbr.$(OBJEXT) uip/mhlistsbr.$(OBJEXT) \ uip/mhmisc.$(OBJEXT) uip/mhfree.$(OBJEXT) \ uip/termsbr.$(OBJEXT) uip/md5.$(OBJEXT) uip_mhlist_OBJECTS = $(am_uip_mhlist_OBJECTS) uip_mhlist_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_mhmail_OBJECTS = uip/mhmail.$(OBJEXT) uip_mhmail_OBJECTS = $(am_uip_mhmail_OBJECTS) uip_mhmail_LDADD = $(LDADD) uip_mhmail_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_mhn_OBJECTS = uip/mhn.$(OBJEXT) uip/mhparse.$(OBJEXT) \ uip/mhcachesbr.$(OBJEXT) uip/mhshowsbr.$(OBJEXT) \ uip/mhlistsbr.$(OBJEXT) uip/mhstoresbr.$(OBJEXT) \ uip/mhmisc.$(OBJEXT) uip/mhfree.$(OBJEXT) \ uip/termsbr.$(OBJEXT) uip/md5.$(OBJEXT) uip_mhn_OBJECTS = $(am_uip_mhn_OBJECTS) uip_mhn_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_mhparam_OBJECTS = uip/mhparam.$(OBJEXT) uip_mhparam_OBJECTS = $(am_uip_mhparam_OBJECTS) uip_mhparam_LDADD = $(LDADD) uip_mhparam_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_mhpath_OBJECTS = uip/mhpath.$(OBJEXT) uip_mhpath_OBJECTS = $(am_uip_mhpath_OBJECTS) uip_mhpath_LDADD = $(LDADD) uip_mhpath_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_mhshow_OBJECTS = uip/mhshow.$(OBJEXT) uip/mhparse.$(OBJEXT) \ uip/mhcachesbr.$(OBJEXT) uip/mhshowsbr.$(OBJEXT) \ uip/mhlistsbr.$(OBJEXT) uip/mhmisc.$(OBJEXT) \ uip/mhfree.$(OBJEXT) uip/termsbr.$(OBJEXT) uip/md5.$(OBJEXT) uip_mhshow_OBJECTS = $(am_uip_mhshow_OBJECTS) uip_mhshow_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_mhstore_OBJECTS = uip/mhstore.$(OBJEXT) uip/mhparse.$(OBJEXT) \ uip/mhcachesbr.$(OBJEXT) uip/mhshowsbr.$(OBJEXT) \ uip/mhlistsbr.$(OBJEXT) uip/mhstoresbr.$(OBJEXT) \ uip/mhmisc.$(OBJEXT) uip/mhfree.$(OBJEXT) \ uip/termsbr.$(OBJEXT) uip/md5.$(OBJEXT) uip_mhstore_OBJECTS = $(am_uip_mhstore_OBJECTS) uip_mhstore_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_mhtest_OBJECTS = uip/mhtest.$(OBJEXT) uip/mhparse.$(OBJEXT) \ uip/mhcachesbr.$(OBJEXT) uip/mhoutsbr.$(OBJEXT) \ uip/mhmisc.$(OBJEXT) uip/mhfree.$(OBJEXT) \ uip/termsbr.$(OBJEXT) uip/md5.$(OBJEXT) uip_mhtest_OBJECTS = $(am_uip_mhtest_OBJECTS) uip_mhtest_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_msgchk_OBJECTS = uip/msgchk.$(OBJEXT) uip/popsbr.$(OBJEXT) uip_msgchk_OBJECTS = $(am_uip_msgchk_OBJECTS) uip_msgchk_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_msh_OBJECTS = uip/msh.$(OBJEXT) uip/mshcmds.$(OBJEXT) \ uip/vmhsbr.$(OBJEXT) uip/picksbr.$(OBJEXT) \ uip/scansbr.$(OBJEXT) uip/dropsbr.$(OBJEXT) \ uip/mhlsbr.$(OBJEXT) uip/termsbr.$(OBJEXT) uip_msh_OBJECTS = $(am_uip_msh_OBJECTS) uip_msh_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_new_OBJECTS = uip/new.$(OBJEXT) uip_new_OBJECTS = $(am_uip_new_OBJECTS) uip_new_LDADD = $(LDADD) uip_new_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_packf_OBJECTS = uip/packf.$(OBJEXT) uip/dropsbr.$(OBJEXT) uip_packf_OBJECTS = $(am_uip_packf_OBJECTS) uip_packf_LDADD = $(LDADD) uip_packf_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_pick_OBJECTS = uip/pick.$(OBJEXT) uip/picksbr.$(OBJEXT) uip_pick_OBJECTS = $(am_uip_pick_OBJECTS) uip_pick_LDADD = $(LDADD) uip_pick_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_post_OBJECTS = uip/post.$(OBJEXT) uip/aliasbr.$(OBJEXT) uip_post_OBJECTS = $(am_uip_post_OBJECTS) uip_post_DEPENDENCIES = mts/libmts.a $(LDADD) $(am__DEPENDENCIES_1) am_uip_prompter_OBJECTS = uip/prompter.$(OBJEXT) uip_prompter_OBJECTS = $(am_uip_prompter_OBJECTS) uip_prompter_LDADD = $(LDADD) uip_prompter_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_rcvdist_OBJECTS = uip/rcvdist.$(OBJEXT) uip/distsbr.$(OBJEXT) uip_rcvdist_OBJECTS = $(am_uip_rcvdist_OBJECTS) uip_rcvdist_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_rcvpack_OBJECTS = uip/rcvpack.$(OBJEXT) uip/dropsbr.$(OBJEXT) uip_rcvpack_OBJECTS = $(am_uip_rcvpack_OBJECTS) uip_rcvpack_LDADD = $(LDADD) uip_rcvpack_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_rcvstore_OBJECTS = uip/rcvstore.$(OBJEXT) uip_rcvstore_OBJECTS = $(am_uip_rcvstore_OBJECTS) uip_rcvstore_LDADD = $(LDADD) uip_rcvstore_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_rcvtty_OBJECTS = uip/rcvtty.$(OBJEXT) uip/scansbr.$(OBJEXT) \ uip/termsbr.$(OBJEXT) uip_rcvtty_OBJECTS = $(am_uip_rcvtty_OBJECTS) uip_rcvtty_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_refile_OBJECTS = uip/refile.$(OBJEXT) uip_refile_OBJECTS = $(am_uip_refile_OBJECTS) uip_refile_LDADD = $(LDADD) uip_refile_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_repl_OBJECTS = uip/repl.$(OBJEXT) uip/replsbr.$(OBJEXT) \ uip/whatnowproc.$(OBJEXT) uip/whatnowsbr.$(OBJEXT) \ uip/sendsbr.$(OBJEXT) uip/annosbr.$(OBJEXT) \ uip/distsbr.$(OBJEXT) uip_repl_OBJECTS = $(am_uip_repl_OBJECTS) uip_repl_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_rmf_OBJECTS = uip/rmf.$(OBJEXT) uip_rmf_OBJECTS = $(am_uip_rmf_OBJECTS) uip_rmf_LDADD = $(LDADD) uip_rmf_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_rmm_OBJECTS = uip/rmm.$(OBJEXT) uip_rmm_OBJECTS = $(am_uip_rmm_OBJECTS) uip_rmm_LDADD = $(LDADD) uip_rmm_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_scan_OBJECTS = uip/scan.$(OBJEXT) uip/scansbr.$(OBJEXT) \ uip/termsbr.$(OBJEXT) uip_scan_OBJECTS = $(am_uip_scan_OBJECTS) uip_scan_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_send_OBJECTS = uip/send.$(OBJEXT) uip/sendsbr.$(OBJEXT) \ uip/annosbr.$(OBJEXT) uip/distsbr.$(OBJEXT) uip_send_OBJECTS = $(am_uip_send_OBJECTS) uip_send_LDADD = $(LDADD) uip_send_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_show_OBJECTS = uip/show.$(OBJEXT) uip/mhlsbr.$(OBJEXT) \ uip/termsbr.$(OBJEXT) uip_show_OBJECTS = $(am_uip_show_OBJECTS) uip_show_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_uip_slocal_OBJECTS = uip/slocal.$(OBJEXT) uip/aliasbr.$(OBJEXT) \ uip/dropsbr.$(OBJEXT) uip_slocal_OBJECTS = $(am_uip_slocal_OBJECTS) uip_slocal_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_sortm_OBJECTS = uip/sortm.$(OBJEXT) uip_sortm_OBJECTS = $(am_uip_sortm_OBJECTS) uip_sortm_LDADD = $(LDADD) uip_sortm_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_spost_OBJECTS = uip/spost.$(OBJEXT) uip/aliasbr.$(OBJEXT) uip_spost_OBJECTS = $(am_uip_spost_OBJECTS) uip_spost_LDADD = $(LDADD) uip_spost_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_viamail_OBJECTS = uip/viamail.$(OBJEXT) uip/mhmisc.$(OBJEXT) \ uip/mhoutsbr.$(OBJEXT) uip/sendsbr.$(OBJEXT) \ uip/annosbr.$(OBJEXT) uip/distsbr.$(OBJEXT) uip_viamail_OBJECTS = $(am_uip_viamail_OBJECTS) uip_viamail_LDADD = $(LDADD) uip_viamail_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a am_uip_whatnow_OBJECTS = uip/whatnow.$(OBJEXT) \ uip/whatnowsbr.$(OBJEXT) uip/sendsbr.$(OBJEXT) \ uip/annosbr.$(OBJEXT) uip/distsbr.$(OBJEXT) uip_whatnow_OBJECTS = $(am_uip_whatnow_OBJECTS) uip_whatnow_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) am_uip_whom_OBJECTS = uip/whom.$(OBJEXT) uip/distsbr.$(OBJEXT) uip_whom_OBJECTS = $(am_uip_whom_OBJECTS) uip_whom_LDADD = $(LDADD) uip_whom_DEPENDENCIES = sbr/libmh.a sbr/libdtimep.a binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) YLWRAP = $(top_srcdir)/ylwrap SOURCES = $(mts_libmts_a_SOURCES) $(sbr_libdtimep_a_SOURCES) \ $(sbr_libmh_a_SOURCES) $(test_fakesmtp_SOURCES) \ $(test_getfqdn_SOURCES) $(test_getfullname_SOURCES) \ $(uip_ali_SOURCES) $(uip_anno_SOURCES) $(uip_ap_SOURCES) \ $(uip_burst_SOURCES) $(uip_comp_SOURCES) \ $(uip_conflict_SOURCES) $(uip_dist_SOURCES) $(uip_dp_SOURCES) \ $(uip_flist_SOURCES) $(uip_fmtdump_SOURCES) \ $(uip_folder_SOURCES) $(uip_forw_SOURCES) $(uip_inc_SOURCES) \ $(uip_install_mh_SOURCES) $(uip_mark_SOURCES) \ $(uip_mhbuild_SOURCES) $(uip_mhl_SOURCES) \ $(uip_mhlist_SOURCES) $(uip_mhmail_SOURCES) $(uip_mhn_SOURCES) \ $(uip_mhparam_SOURCES) $(uip_mhpath_SOURCES) \ $(uip_mhshow_SOURCES) $(uip_mhstore_SOURCES) \ $(uip_mhtest_SOURCES) $(uip_msgchk_SOURCES) $(uip_msh_SOURCES) \ $(uip_new_SOURCES) $(uip_packf_SOURCES) $(uip_pick_SOURCES) \ $(uip_post_SOURCES) $(uip_prompter_SOURCES) \ $(uip_rcvdist_SOURCES) $(uip_rcvpack_SOURCES) \ $(uip_rcvstore_SOURCES) $(uip_rcvtty_SOURCES) \ $(uip_refile_SOURCES) $(uip_repl_SOURCES) $(uip_rmf_SOURCES) \ $(uip_rmm_SOURCES) $(uip_scan_SOURCES) $(uip_send_SOURCES) \ $(uip_show_SOURCES) $(uip_slocal_SOURCES) $(uip_sortm_SOURCES) \ $(uip_spost_SOURCES) $(uip_viamail_SOURCES) \ $(uip_whatnow_SOURCES) $(uip_whom_SOURCES) DIST_SOURCES = $(mts_libmts_a_SOURCES) $(sbr_libdtimep_a_SOURCES) \ $(sbr_libmh_a_SOURCES) $(test_fakesmtp_SOURCES) \ $(test_getfqdn_SOURCES) $(test_getfullname_SOURCES) \ $(uip_ali_SOURCES) $(uip_anno_SOURCES) $(uip_ap_SOURCES) \ $(uip_burst_SOURCES) $(uip_comp_SOURCES) \ $(uip_conflict_SOURCES) $(uip_dist_SOURCES) $(uip_dp_SOURCES) \ $(uip_flist_SOURCES) $(uip_fmtdump_SOURCES) \ $(uip_folder_SOURCES) $(uip_forw_SOURCES) $(uip_inc_SOURCES) \ $(uip_install_mh_SOURCES) $(uip_mark_SOURCES) \ $(uip_mhbuild_SOURCES) $(uip_mhl_SOURCES) \ $(uip_mhlist_SOURCES) $(uip_mhmail_SOURCES) $(uip_mhn_SOURCES) \ $(uip_mhparam_SOURCES) $(uip_mhpath_SOURCES) \ $(uip_mhshow_SOURCES) $(uip_mhstore_SOURCES) \ $(uip_mhtest_SOURCES) $(uip_msgchk_SOURCES) $(uip_msh_SOURCES) \ $(uip_new_SOURCES) $(uip_packf_SOURCES) $(uip_pick_SOURCES) \ $(uip_post_SOURCES) $(uip_prompter_SOURCES) \ $(uip_rcvdist_SOURCES) $(uip_rcvpack_SOURCES) \ $(uip_rcvstore_SOURCES) $(uip_rcvtty_SOURCES) \ $(uip_refile_SOURCES) $(uip_repl_SOURCES) $(uip_rmf_SOURCES) \ $(uip_rmm_SOURCES) $(uip_scan_SOURCES) $(uip_send_SOURCES) \ $(uip_show_SOURCES) $(uip_slocal_SOURCES) $(uip_sortm_SOURCES) \ $(uip_spost_SOURCES) $(uip_viamail_SOURCES) \ $(uip_whatnow_SOURCES) $(uip_whom_SOURCES) man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; dist_contribDATA_INSTALL = $(INSTALL_DATA) dist_docDATA_INSTALL = $(INSTALL_DATA) dist_sysconfDATA_INSTALL = $(INSTALL_DATA) sysconfDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_contrib_DATA) $(dist_doc_DATA) $(dist_sysconf_DATA) \ $(sysconf_DATA) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DISABLE_SIGN_COMPARE_WARNING = @DISABLE_SIGN_COMPARE_WARNING@ DISABLE_UNUSED_MACROS_WARNING = @DISABLE_UNUSED_MACROS_WARNING@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ ICONVLIB = @ICONVLIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LINT = @LINT@ LINTFLAGS = @LINTFLAGS@ LTLIBOBJS = @LTLIBOBJS@ MAIL_SPOOL_GRP = @MAIL_SPOOL_GRP@ MAKEINFO = @MAKEINFO@ MD5FMT = @MD5FMT@ MD5SUM = @MD5SUM@ MKDIR_P = @MKDIR_P@ MTS = @MTS@ NDBM_LIBS = @NDBM_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINELIB = @READLINELIB@ SASLLIB = @SASLLIB@ SED = @SED@ SETGID_MAIL = @SETGID_MAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIGNAL_H = @SIGNAL_H@ STRIP = @STRIP@ TERMLIB = @TERMLIB@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cutpath = @cutpath@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dotlockfilepath = @dotlockfilepath@ dvidir = @dvidir@ editorpath = @editorpath@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ linttmp1 = @linttmp1@ linttmp2 = @linttmp2@ localedir = @localedir@ localstatedir = @localstatedir@ lspath = @lspath@ mailspool = @mailspool@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pagerpath = @pagerpath@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ rpmdir = @rpmdir@ sbindir = @sbindir@ sendmailpath = @sendmailpath@ sharedstatedir = @sharedstatedir@ smtpservers = @smtpservers@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ vipath = @vipath@ ACLOCAL_AMFLAGS = -I m4 LDADD = sbr/libmh.a sbr/libdtimep.a MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND" MHNSEARCHPROG = $(srcdir)/etc/mhn.find.sh auxexecdir = @libdir@ TESTS_ENVIRONMENT = MH_OBJ_DIR=@abs_builddir@ \ MH_TEST_DIR=@abs_builddir@/test/testdir \ auxexecdir=$(auxexecdir) bindir=$(bindir) \ mandir=$(mandir) sysconfdir=$(sysconfdir) \ $(TESTS_SHELL) ## Keep at end of TESTS_ENVIRONMENT. TESTS = test/bad-input/test-header \ test/burst/test-burst \ test/comp/test-comp-format \ test/folder/test-create \ test/folder/test-total test/format/test-localmbox \ test/format/test-myname test/format/test-myhost \ test/format/test-mymbox \ test/forw/test-forw-digest \ test/forw/test-forw-format \ test/inc/test-deb359167 test/inc/test-eom-align \ test/inc/test-inc-scanout test/install-mh/test-install-mh \ test/manpages/test-manpages test/mhbuild/test-forw \ test/mhlist/test-mhlist test/mhparam/test-mhparam \ test/mhpath/test-mhpath \ test/mhshow/test-cte-binary test/mhshow/test-qp \ test/mhshow/test-subpart test/mhstore/test-mhstore \ test/new/test-basic \ test/pick/test-pick test/pick/test-stderr \ test/post/test-post-basic test/post/test-post-multiple \ test/post/test-post-dcc test/post/test-post-fcc \ test/post/test-post-multifrom test/post/test-post-envelope \ test/post/test-post-group \ test/refile/test-refile \ test/repl/test-if-str test/repl/test-trailing-newline \ test/repl/test-multicomp \ test/scan/test-scan \ test/sequences/test-flist test/sequences/test-mark \ test/whatnow/test-attach-detach test/whatnow/test-cd \ test/whatnow/test-ls test/whom/test-whom \ test/cleanup ## The "cleanup" test should always be last. check_SCRIPTS = test/common.sh DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1 CLEANFILES = config/version.c sbr/sigmsg.h etc/mts.conf etc/sendfiles \ etc/mhn.defaults man/man.sed man/mh-chart.man $(man_MANS) MAINTAINERCLEANFILES = cscope.files cscope.out SUPERCLEANFILES = ChangeLog Makefile.in aclocal.m4 compile config.guess \ config.h.in config.h.in~ config.sub configure depcomp \ install-sh missing ylwrap nmh-*.tar.gz BUILT_SOURCES = sbr/sigmsg.h bin_SCRIPTS = etc/sendfiles noinst_LIBRARIES = sbr/libmh.a sbr/libdtimep.a mts/libmts.a noinst_HEADERS = h/addrsbr.h h/aliasbr.h h/crawl_folders.h h/dropsbr.h \ h/fmt_compile.h h/fmt_scan.h h/md5.h h/mf.h \ h/mh.h h/mhcachesbr.h h/mhparse.h h/mime.h h/msh.h \ h/mts.h h/nmh.h h/picksbr.h h/popsbr.h h/prototypes.h \ h/rcvmail.h h/scansbr.h h/signals.h h/tws.h h/utils.h \ h/vmhsbr.h mts/smtp/smtp.h dist_sysconf_DATA = etc/MailAliases etc/components etc/digestcomps \ etc/distcomps etc/forwcomps etc/mhl.body etc/mhl.digest \ etc/mhl.format etc/mhl.forward etc/mhl.headers \ etc/mhl.reply etc/rcvdistcomps etc/rcvdistcomps.outbox \ etc/replcomps etc/replgroupcomps etc/scan.MMDDYY \ etc/scan.YYYYMMDD etc/scan.default etc/scan.mailx \ etc/scan.nomime etc/scan.size etc/scan.time \ etc/scan.timely etc/scan.unseen sysconf_DATA = etc/mhn.defaults etc/mts.conf dist_doc_DATA = COPYRIGHT INSTALL NEWS README VERSION \ docs/COMPLETION-BASH docs/COMPLETION-TCSH \ docs/COMPLETION-ZSH docs/DIFFERENCES docs/FAQ \ docs/MAIL.FILTERING docs/MAILING-LISTS docs/README-ATTACHMENTS \ docs/README-HOOKS docs/README-components docs/README.about \ docs/README.SASL docs/README.developers docs/README.manpages \ docs/TODO contribdir = $(docdir)/contrib dist_contrib_DATA = docs/contrib/nmh.spec docs/contrib/replyfilter \ docs/contrib/build_nmh man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \ man/conflict.8 man/dist.1 man/dp.8 man/flist.1 man/flists.1 \ man/fmtdump.8 man/fnext.1 man/folder.1 man/folders.1 \ man/forw.1 man/fprev.1 man/inc.1 man/install-mh.1 man/mark.1 \ man/mh-alias.5 man/mh-chart.1 man/mh-draft.5 man/mh-format.5 \ man/mh-mail.5 man/mh-profile.5 man/mh-sequence.5 \ man/mh-tailor.5 man/mhbuild.1 man/mhl.1 man/mhlist.1 \ man/mhmail.1 man/mhn.1 man/mhparam.1 man/mhpath.1 \ man/mhshow.1 man/mhstore.1 man/msgchk.1 man/msh.1 \ man/mts.conf.5 man/new.1 man/next.1 man/nmh.1 man/packf.1 \ man/pick.1 man/post.8 man/prev.1 man/prompter.1 man/rcvdist.1 \ man/rcvpack.1 man/rcvstore.1 man/rcvtty.1 man/refile.1 \ man/repl.1 man/rmf.1 man/rmm.1 man/scan.1 man/send.1 \ man/sendfiles.1 man/show.1 man/slocal.1 man/sortm.1 man/unseen.1 \ man/whatnow.1 man/whom.1 EXTRA_DIST = config/version.sh sbr/sigmsg.awk etc/mts.conf.in etc/sendfiles.in \ etc/mhn.defaults.sh $(MHNSEARCHPROG) DATE MACHINES \ docs/ChangeLog_MH-3_to_MH-6.6 \ docs/ChangeLog_MH-6.7.0_to_MH-6.8.4.html \ man/ali.man man/anno.man man/ap.man man/burst.man man/comp.man \ man/conflict.man man/dist.man man/dp.man man/flist.man \ man/flists.man man/fmtdump.man man/fnext.man man/folder.man \ man/folders.man man/forw.man man/fprev.man man/inc.man \ man/install-mh.man man/mark.man man/mh-alias.man \ man/mh-chart-gen.sh man/mh-draft.man man/mh-format.man \ man/mh-mail.man man/mh-profile.man man/mh-sequence.man \ man/mh-tailor.man man/mhbuild.man man/mhl.man man/mhlist.man \ man/mhmail.man man/mhn.man man/mhparam.man man/mhpath.man \ man/mhshow.man man/mhstore.man man/msgchk.man man/msh.man \ man/mts.conf.man man/new.man man/next.man man/nmh.man \ man/packf.man man/pick.man man/post.man man/prev.man \ man/prompter.man man/rcvdist.man man/rcvpack.man \ man/rcvstore.man man/rcvtty.man man/refile.man man/repl.man \ man/rmf.man man/rmm.man man/scan.man man/send.man \ man/sendfiles.man man/show.man man/slocal.man man/sortm.man \ man/unseen.man man/whatnow.man man/whom.man \ test/README $(TESTS) test/inc/deb359167.mbox \ test/inc/fromline.txt test/inc/msgheader.txt test/inc/filler.txt \ test/inc/md5sums test/post/test-post-common.sh uip_ali_SOURCES = uip/ali.c uip/aliasbr.c uip_anno_SOURCES = uip/anno.c uip/annosbr.c uip_burst_SOURCES = uip/burst.c uip_comp_SOURCES = uip/comp.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip_comp_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_dist_SOURCES = uip/dist.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip/forwsbr.c uip_dist_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_flist_SOURCES = uip/flist.c uip_folder_SOURCES = uip/folder.c uip_forw_SOURCES = uip/forw.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip/forwsbr.c uip_forw_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/termsbr.c \ uip/popsbr.c uip_inc_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(SASLLIB) uip_install_mh_SOURCES = uip/install-mh.c uip_mark_SOURCES = uip/mark.c uip_mhbuild_SOURCES = uip/mhbuild.c uip/mhbuildsbr.c uip/mhcachesbr.c \ uip/mhlistsbr.c uip/mhoutsbr.c uip/mhmisc.c \ uip/mhfree.c uip/mhparse.c uip/termsbr.c uip/md5.c uip_mhbuild_LDADD = $(LDADD) $(TERMLIB) uip_mhlist_SOURCES = uip/mhlist.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhlistsbr.c uip/mhmisc.c uip/mhfree.c uip/termsbr.c \ uip/md5.c uip_mhlist_LDADD = $(LDADD) $(TERMLIB) uip_mhmail_SOURCES = uip/mhmail.c uip_mhn_SOURCES = uip/mhn.c uip/mhparse.c uip/mhcachesbr.c uip/mhshowsbr.c \ uip/mhlistsbr.c uip/mhstoresbr.c uip/mhmisc.c uip/mhfree.c \ uip/termsbr.c uip/md5.c uip_mhn_LDADD = $(LDADD) $(TERMLIB) uip_mhparam_SOURCES = uip/mhparam.c uip_mhpath_SOURCES = uip/mhpath.c uip_mhshow_SOURCES = uip/mhshow.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhshowsbr.c uip/mhlistsbr.c uip/mhmisc.c \ uip/mhfree.c uip/termsbr.c uip/md5.c uip_mhshow_LDADD = $(LDADD) $(TERMLIB) uip_mhstore_SOURCES = uip/mhstore.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhshowsbr.c uip/mhlistsbr.c uip/mhstoresbr.c \ uip/mhmisc.c uip/mhfree.c uip/termsbr.c uip/md5.c uip_mhstore_LDADD = $(LDADD) $(TERMLIB) uip_msgchk_SOURCES = uip/msgchk.c uip/popsbr.c uip_msgchk_LDADD = $(LDADD) $(SASLLIB) uip_msh_SOURCES = uip/msh.c uip/mshcmds.c uip/vmhsbr.c uip/picksbr.c \ uip/scansbr.c uip/dropsbr.c uip/mhlsbr.c uip/termsbr.c uip_msh_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_new_SOURCES = uip/new.c uip_packf_SOURCES = uip/packf.c uip/dropsbr.c uip_pick_SOURCES = uip/pick.c uip/picksbr.c uip_prompter_SOURCES = uip/prompter.c uip_refile_SOURCES = uip/refile.c uip_repl_SOURCES = uip/repl.c uip/replsbr.c uip/whatnowproc.c \ uip/whatnowsbr.c uip/sendsbr.c uip/annosbr.c uip/distsbr.c uip_repl_LDADD = $(LDADD) $(ICONVLIB) $(READLINELIB) uip_rmf_SOURCES = uip/rmf.c uip_rmm_SOURCES = uip/rmm.c uip_scan_SOURCES = uip/scan.c uip/scansbr.c uip/termsbr.c uip_scan_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_send_SOURCES = uip/send.c uip/sendsbr.c uip/annosbr.c uip/distsbr.c uip_show_SOURCES = uip/show.c uip/mhlsbr.c uip/termsbr.c uip_show_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_sortm_SOURCES = uip/sortm.c uip_whatnow_SOURCES = uip/whatnow.c uip/whatnowsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c uip_whatnow_LDADD = $(LDADD) $(READLINELIB) uip_whom_SOURCES = uip/whom.c uip/distsbr.c uip_ap_SOURCES = uip/ap.c uip/termsbr.c uip_ap_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_conflict_SOURCES = uip/conflict.c uip/aliasbr.c uip_dp_SOURCES = uip/dp.c uip/termsbr.c uip_dp_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_fmtdump_SOURCES = uip/fmtdump.c uip_fmtdump_LDADD = $(LDADD) $(ICONVLIB) uip_mhl_SOURCES = uip/mhl.c uip/mhlsbr.c uip/termsbr.c uip_mhl_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_mhtest_SOURCES = uip/mhtest.c uip/mhparse.c uip/mhcachesbr.c \ uip/mhoutsbr.c uip/mhmisc.c uip/mhfree.c \ uip/termsbr.c uip/md5.c uip_mhtest_LDADD = $(LDADD) $(TERMLIB) uip_post_SOURCES = uip/post.c uip/aliasbr.c uip_post_LDADD = mts/libmts.a $(LDADD) $(SASLLIB) uip_rcvdist_SOURCES = uip/rcvdist.c uip/distsbr.c uip_rcvdist_LDADD = $(LDADD) $(ICONVLIB) uip_rcvpack_SOURCES = uip/rcvpack.c uip/dropsbr.c uip_rcvstore_SOURCES = uip/rcvstore.c uip_rcvtty_SOURCES = uip/rcvtty.c uip/scansbr.c uip/termsbr.c uip_rcvtty_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) uip_slocal_SOURCES = uip/slocal.c uip/aliasbr.c uip/dropsbr.c uip_slocal_LDADD = $(LDADD) $(NDBM_LIBS) uip_spost_SOURCES = uip/spost.c uip/aliasbr.c uip_viamail_SOURCES = uip/viamail.c uip/mhmisc.c uip/mhoutsbr.c uip/sendsbr.c \ uip/annosbr.c uip/distsbr.c test_getfullname_SOURCES = test/getfullname.c test_getfullname_LDADD = sbr/libmh.a test_getfqdn_SOURCES = test/getfqdn.c test_getfqdn_LDADD = test_fakesmtp_SOURCES = test/fakesmtp.c test_fakesmtp_LDADD = sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/brkstring.c \ sbr/check_charset.c sbr/client.c sbr/closefds.c \ sbr/concat.c sbr/context_del.c sbr/context_find.c \ sbr/context_foil.c sbr/context_read.c \ sbr/context_replace.c sbr/context_save.c \ sbr/copy.c sbr/copyip.c sbr/cpydata.c \ sbr/cpydgst.c sbr/crawl_folders.c sbr/discard.c \ sbr/done.c sbr/dtime.c sbr/escape_display_name.c \ sbr/error.c sbr/ext_hook.c sbr/fdcompare.c \ sbr/folder_addmsg.c sbr/folder_delmsgs.c \ sbr/folder_free.c sbr/folder_pack.c \ sbr/folder_read.c sbr/folder_realloc.c sbr/gans.c \ sbr/getans.c sbr/getanswer.c sbr/getarguments.c \ sbr/getcpy.c sbr/getfolder.c sbr/getpass.c \ sbr/fmt_addr.c sbr/fmt_compile.c sbr/fmt_new.c \ sbr/fmt_rfc2047.c sbr/fmt_scan.c sbr/lock_file.c \ sbr/m_atoi.c sbr/m_backup.c sbr/m_convert.c \ sbr/m_draft.c sbr/m_getfld.c sbr/m_gmprot.c \ sbr/m_maildir.c sbr/m_name.c \ sbr/makedir.c sbr/mts.c sbr/norm_charmap.c sbr/path.c \ sbr/peekc.c sbr/pidwait.c sbr/pidstatus.c \ sbr/print_help.c sbr/print_sw.c sbr/print_version.c \ sbr/push.c sbr/putenv.c sbr/refile.c sbr/remdir.c \ sbr/r1bindex.c sbr/readconfig.c sbr/ruserpass.c \ sbr/seq_add.c sbr/seq_bits.c sbr/seq_del.c \ sbr/seq_getnum.c sbr/seq_list.c sbr/seq_nameok.c \ sbr/seq_print.c sbr/seq_read.c sbr/seq_save.c \ sbr/seq_setcur.c sbr/seq_setprev.c sbr/seq_setunseen.c \ sbr/showfile.c sbr/signals.c sbr/smatch.c \ sbr/snprintb.c sbr/ssequal.c sbr/strcasecmp.c \ sbr/strindex.c sbr/trimcpy.c sbr/uprf.c sbr/vfgets.c \ sbr/fmt_def.c sbr/m_msgdef.c sbr/mf.c sbr/utils.c \ sbr/m_mktemp.c sbr/getansreadline.c config/config.c \ config/version.c sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(sysconfdir)"' \ -DMAILSPOOL='"$(mailspool)"' \ -DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \ -DNMHLIBDIR='"$(libdir)"' \ -DDEFAULT_EDITOR='"$(editorpath)"' \ -DDEFAULT_PAGER='"$(pagerpath)"' sbr_libdtimep_a_SOURCES = sbr/dtimep.l sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) \ $(DISABLE_UNUSED_MACROS_WARNING) \ $(DISABLE_SIGN_COMPARE_WARNING) mts_libmts_a_SOURCES = mts/smtp/smtp.c manext1 = 1 manext5 = 5 manext8 = 8 all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .$(manext1) .$(manext5) .$(manext8) .c .l .man .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 test/common.sh: $(top_builddir)/config.status $(top_srcdir)/test/common.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) mts/smtp/$(am__dirstamp): @$(MKDIR_P) mts/smtp @: > mts/smtp/$(am__dirstamp) mts/smtp/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) mts/smtp/$(DEPDIR) @: > mts/smtp/$(DEPDIR)/$(am__dirstamp) mts/smtp/smtp.$(OBJEXT): mts/smtp/$(am__dirstamp) \ mts/smtp/$(DEPDIR)/$(am__dirstamp) mts/$(am__dirstamp): @$(MKDIR_P) mts @: > mts/$(am__dirstamp) mts/libmts.a: $(mts_libmts_a_OBJECTS) $(mts_libmts_a_DEPENDENCIES) mts/$(am__dirstamp) -rm -f mts/libmts.a $(mts_libmts_a_AR) mts/libmts.a $(mts_libmts_a_OBJECTS) $(mts_libmts_a_LIBADD) $(RANLIB) mts/libmts.a sbr/$(am__dirstamp): @$(MKDIR_P) sbr @: > sbr/$(am__dirstamp) sbr/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) sbr/$(DEPDIR) @: > sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libdtimep_a-dtimep.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/libdtimep.a: $(sbr_libdtimep_a_OBJECTS) $(sbr_libdtimep_a_DEPENDENCIES) sbr/$(am__dirstamp) -rm -f sbr/libdtimep.a $(sbr_libdtimep_a_AR) sbr/libdtimep.a $(sbr_libdtimep_a_OBJECTS) $(sbr_libdtimep_a_LIBADD) $(RANLIB) sbr/libdtimep.a sbr/sbr_libmh_a-addrsbr.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-ambigsw.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-atooi.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-brkstring.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-check_charset.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-client.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-closefds.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-concat.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-context_del.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-context_find.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-context_foil.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-context_read.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-context_replace.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-context_save.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-copy.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-copyip.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-cpydata.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-cpydgst.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-crawl_folders.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-discard.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-done.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-dtime.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-escape_display_name.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-error.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-ext_hook.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-fdcompare.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-folder_addmsg.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-folder_delmsgs.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-folder_free.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-folder_pack.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-folder_read.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-folder_realloc.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-gans.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-getans.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-getanswer.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-getarguments.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-getcpy.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-getfolder.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-getpass.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-fmt_addr.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-fmt_compile.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-fmt_new.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-fmt_rfc2047.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-fmt_scan.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-lock_file.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_atoi.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_backup.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_convert.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_draft.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_getfld.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_gmprot.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_maildir.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_name.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-makedir.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-mts.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-norm_charmap.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-path.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-peekc.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-pidwait.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-pidstatus.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-print_help.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-print_sw.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-print_version.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-push.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-putenv.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-refile.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-remdir.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-r1bindex.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-readconfig.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-ruserpass.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_add.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_bits.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_del.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_getnum.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_list.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_nameok.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_print.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_read.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_save.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_setcur.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_setprev.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-seq_setunseen.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-showfile.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-signals.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-smatch.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-snprintb.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-ssequal.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-strcasecmp.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-strindex.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-trimcpy.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-uprf.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-vfgets.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-fmt_def.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_msgdef.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-mf.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-utils.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-m_mktemp.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) sbr/sbr_libmh_a-getansreadline.$(OBJEXT): sbr/$(am__dirstamp) \ sbr/$(DEPDIR)/$(am__dirstamp) config/$(am__dirstamp): @$(MKDIR_P) config @: > config/$(am__dirstamp) config/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) config/$(DEPDIR) @: > config/$(DEPDIR)/$(am__dirstamp) config/sbr_libmh_a-config.$(OBJEXT): config/$(am__dirstamp) \ config/$(DEPDIR)/$(am__dirstamp) config/sbr_libmh_a-version.$(OBJEXT): config/$(am__dirstamp) \ config/$(DEPDIR)/$(am__dirstamp) sbr/libmh.a: $(sbr_libmh_a_OBJECTS) $(sbr_libmh_a_DEPENDENCIES) sbr/$(am__dirstamp) -rm -f sbr/libmh.a $(sbr_libmh_a_AR) sbr/libmh.a $(sbr_libmh_a_OBJECTS) $(sbr_libmh_a_LIBADD) $(RANLIB) sbr/libmh.a install-auxexecPROGRAMS: $(auxexec_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(auxexecdir)" || $(MKDIR_P) "$(DESTDIR)$(auxexecdir)" @list='$(auxexec_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(auxexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(auxexecdir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(auxexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(auxexecdir)/$$f" || exit 1; \ else :; fi; \ done uninstall-auxexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(auxexec_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(auxexecdir)/$$f'"; \ rm -f "$(DESTDIR)$(auxexecdir)/$$f"; \ done clean-auxexecPROGRAMS: -test -z "$(auxexec_PROGRAMS)" || rm -f $(auxexec_PROGRAMS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) test/$(am__dirstamp): @$(MKDIR_P) test @: > test/$(am__dirstamp) test/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) test/$(DEPDIR) @: > test/$(DEPDIR)/$(am__dirstamp) test/fakesmtp.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/fakesmtp$(EXEEXT): $(test_fakesmtp_OBJECTS) $(test_fakesmtp_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/fakesmtp$(EXEEXT) $(LINK) $(test_fakesmtp_OBJECTS) $(test_fakesmtp_LDADD) $(LIBS) test/getfqdn.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/getfqdn$(EXEEXT): $(test_getfqdn_OBJECTS) $(test_getfqdn_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/getfqdn$(EXEEXT) $(LINK) $(test_getfqdn_OBJECTS) $(test_getfqdn_LDADD) $(LIBS) test/getfullname.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/getfullname$(EXEEXT): $(test_getfullname_OBJECTS) $(test_getfullname_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/getfullname$(EXEEXT) $(LINK) $(test_getfullname_OBJECTS) $(test_getfullname_LDADD) $(LIBS) uip/$(am__dirstamp): @$(MKDIR_P) uip @: > uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) uip/$(DEPDIR) @: > uip/$(DEPDIR)/$(am__dirstamp) uip/ali.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/aliasbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/ali$(EXEEXT): $(uip_ali_OBJECTS) $(uip_ali_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/ali$(EXEEXT) $(LINK) $(uip_ali_OBJECTS) $(uip_ali_LDADD) $(LIBS) uip/anno.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/annosbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/anno$(EXEEXT): $(uip_anno_OBJECTS) $(uip_anno_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/anno$(EXEEXT) $(LINK) $(uip_anno_OBJECTS) $(uip_anno_LDADD) $(LIBS) uip/ap.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/termsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/ap$(EXEEXT): $(uip_ap_OBJECTS) $(uip_ap_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/ap$(EXEEXT) $(LINK) $(uip_ap_OBJECTS) $(uip_ap_LDADD) $(LIBS) uip/burst.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/burst$(EXEEXT): $(uip_burst_OBJECTS) $(uip_burst_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/burst$(EXEEXT) $(LINK) $(uip_burst_OBJECTS) $(uip_burst_LDADD) $(LIBS) uip/comp.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/whatnowproc.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/whatnowsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/sendsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/distsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/comp$(EXEEXT): $(uip_comp_OBJECTS) $(uip_comp_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/comp$(EXEEXT) $(LINK) $(uip_comp_OBJECTS) $(uip_comp_LDADD) $(LIBS) uip/conflict.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/conflict$(EXEEXT): $(uip_conflict_OBJECTS) $(uip_conflict_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/conflict$(EXEEXT) $(LINK) $(uip_conflict_OBJECTS) $(uip_conflict_LDADD) $(LIBS) uip/dist.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/forwsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/dist$(EXEEXT): $(uip_dist_OBJECTS) $(uip_dist_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/dist$(EXEEXT) $(LINK) $(uip_dist_OBJECTS) $(uip_dist_LDADD) $(LIBS) uip/dp.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/dp$(EXEEXT): $(uip_dp_OBJECTS) $(uip_dp_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/dp$(EXEEXT) $(LINK) $(uip_dp_OBJECTS) $(uip_dp_LDADD) $(LIBS) uip/flist.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/flist$(EXEEXT): $(uip_flist_OBJECTS) $(uip_flist_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/flist$(EXEEXT) $(LINK) $(uip_flist_OBJECTS) $(uip_flist_LDADD) $(LIBS) uip/fmtdump.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/fmtdump$(EXEEXT): $(uip_fmtdump_OBJECTS) $(uip_fmtdump_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/fmtdump$(EXEEXT) $(LINK) $(uip_fmtdump_OBJECTS) $(uip_fmtdump_LDADD) $(LIBS) uip/folder.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/folder$(EXEEXT): $(uip_folder_OBJECTS) $(uip_folder_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/folder$(EXEEXT) $(LINK) $(uip_folder_OBJECTS) $(uip_folder_LDADD) $(LIBS) uip/forw.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/forw$(EXEEXT): $(uip_forw_OBJECTS) $(uip_forw_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/forw$(EXEEXT) $(LINK) $(uip_forw_OBJECTS) $(uip_forw_LDADD) $(LIBS) uip/inc.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/scansbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/dropsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/popsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/inc$(EXEEXT): $(uip_inc_OBJECTS) $(uip_inc_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/inc$(EXEEXT) $(LINK) $(uip_inc_OBJECTS) $(uip_inc_LDADD) $(LIBS) uip/install-mh.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/install-mh$(EXEEXT): $(uip_install_mh_OBJECTS) $(uip_install_mh_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/install-mh$(EXEEXT) $(LINK) $(uip_install_mh_OBJECTS) $(uip_install_mh_LDADD) $(LIBS) uip/mark.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/mark$(EXEEXT): $(uip_mark_OBJECTS) $(uip_mark_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mark$(EXEEXT) $(LINK) $(uip_mark_OBJECTS) $(uip_mark_LDADD) $(LIBS) uip/mhbuild.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhbuildsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhcachesbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhlistsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhoutsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhmisc.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhfree.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhparse.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/md5.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/mhbuild$(EXEEXT): $(uip_mhbuild_OBJECTS) $(uip_mhbuild_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhbuild$(EXEEXT) $(LINK) $(uip_mhbuild_OBJECTS) $(uip_mhbuild_LDADD) $(LIBS) uip/mhl.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/mhlsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhl$(EXEEXT): $(uip_mhl_OBJECTS) $(uip_mhl_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhl$(EXEEXT) $(LINK) $(uip_mhl_OBJECTS) $(uip_mhl_LDADD) $(LIBS) uip/mhlist.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhlist$(EXEEXT): $(uip_mhlist_OBJECTS) $(uip_mhlist_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhlist$(EXEEXT) $(LINK) $(uip_mhlist_OBJECTS) $(uip_mhlist_LDADD) $(LIBS) uip/mhmail.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhmail$(EXEEXT): $(uip_mhmail_OBJECTS) $(uip_mhmail_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhmail$(EXEEXT) $(LINK) $(uip_mhmail_OBJECTS) $(uip_mhmail_LDADD) $(LIBS) uip/mhn.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/mhshowsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhstoresbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhn$(EXEEXT): $(uip_mhn_OBJECTS) $(uip_mhn_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhn$(EXEEXT) $(LINK) $(uip_mhn_OBJECTS) $(uip_mhn_LDADD) $(LIBS) uip/mhparam.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhparam$(EXEEXT): $(uip_mhparam_OBJECTS) $(uip_mhparam_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhparam$(EXEEXT) $(LINK) $(uip_mhparam_OBJECTS) $(uip_mhparam_LDADD) $(LIBS) uip/mhpath.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhpath$(EXEEXT): $(uip_mhpath_OBJECTS) $(uip_mhpath_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhpath$(EXEEXT) $(LINK) $(uip_mhpath_OBJECTS) $(uip_mhpath_LDADD) $(LIBS) uip/mhshow.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhshow$(EXEEXT): $(uip_mhshow_OBJECTS) $(uip_mhshow_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhshow$(EXEEXT) $(LINK) $(uip_mhshow_OBJECTS) $(uip_mhshow_LDADD) $(LIBS) uip/mhstore.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhstore$(EXEEXT): $(uip_mhstore_OBJECTS) $(uip_mhstore_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhstore$(EXEEXT) $(LINK) $(uip_mhstore_OBJECTS) $(uip_mhstore_LDADD) $(LIBS) uip/mhtest.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/mhtest$(EXEEXT): $(uip_mhtest_OBJECTS) $(uip_mhtest_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/mhtest$(EXEEXT) $(LINK) $(uip_mhtest_OBJECTS) $(uip_mhtest_LDADD) $(LIBS) uip/msgchk.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/msgchk$(EXEEXT): $(uip_msgchk_OBJECTS) $(uip_msgchk_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/msgchk$(EXEEXT) $(LINK) $(uip_msgchk_OBJECTS) $(uip_msgchk_LDADD) $(LIBS) uip/msh.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/mshcmds.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/vmhsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/picksbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/msh$(EXEEXT): $(uip_msh_OBJECTS) $(uip_msh_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/msh$(EXEEXT) $(LINK) $(uip_msh_OBJECTS) $(uip_msh_LDADD) $(LIBS) uip/new.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/new$(EXEEXT): $(uip_new_OBJECTS) $(uip_new_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/new$(EXEEXT) $(LINK) $(uip_new_OBJECTS) $(uip_new_LDADD) $(LIBS) uip/packf.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/packf$(EXEEXT): $(uip_packf_OBJECTS) $(uip_packf_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/packf$(EXEEXT) $(LINK) $(uip_packf_OBJECTS) $(uip_packf_LDADD) $(LIBS) uip/pick.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/pick$(EXEEXT): $(uip_pick_OBJECTS) $(uip_pick_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/pick$(EXEEXT) $(LINK) $(uip_pick_OBJECTS) $(uip_pick_LDADD) $(LIBS) uip/post.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/post$(EXEEXT): $(uip_post_OBJECTS) $(uip_post_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/post$(EXEEXT) $(LINK) $(uip_post_OBJECTS) $(uip_post_LDADD) $(LIBS) uip/prompter.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/prompter$(EXEEXT): $(uip_prompter_OBJECTS) $(uip_prompter_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/prompter$(EXEEXT) $(LINK) $(uip_prompter_OBJECTS) $(uip_prompter_LDADD) $(LIBS) uip/rcvdist.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/rcvdist$(EXEEXT): $(uip_rcvdist_OBJECTS) $(uip_rcvdist_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/rcvdist$(EXEEXT) $(LINK) $(uip_rcvdist_OBJECTS) $(uip_rcvdist_LDADD) $(LIBS) uip/rcvpack.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/rcvpack$(EXEEXT): $(uip_rcvpack_OBJECTS) $(uip_rcvpack_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/rcvpack$(EXEEXT) $(LINK) $(uip_rcvpack_OBJECTS) $(uip_rcvpack_LDADD) $(LIBS) uip/rcvstore.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/rcvstore$(EXEEXT): $(uip_rcvstore_OBJECTS) $(uip_rcvstore_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/rcvstore$(EXEEXT) $(LINK) $(uip_rcvstore_OBJECTS) $(uip_rcvstore_LDADD) $(LIBS) uip/rcvtty.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/rcvtty$(EXEEXT): $(uip_rcvtty_OBJECTS) $(uip_rcvtty_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/rcvtty$(EXEEXT) $(LINK) $(uip_rcvtty_OBJECTS) $(uip_rcvtty_LDADD) $(LIBS) uip/refile.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/refile$(EXEEXT): $(uip_refile_OBJECTS) $(uip_refile_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/refile$(EXEEXT) $(LINK) $(uip_refile_OBJECTS) $(uip_refile_LDADD) $(LIBS) uip/repl.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/replsbr.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/repl$(EXEEXT): $(uip_repl_OBJECTS) $(uip_repl_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/repl$(EXEEXT) $(LINK) $(uip_repl_OBJECTS) $(uip_repl_LDADD) $(LIBS) uip/rmf.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/rmf$(EXEEXT): $(uip_rmf_OBJECTS) $(uip_rmf_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/rmf$(EXEEXT) $(LINK) $(uip_rmf_OBJECTS) $(uip_rmf_LDADD) $(LIBS) uip/rmm.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/rmm$(EXEEXT): $(uip_rmm_OBJECTS) $(uip_rmm_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/rmm$(EXEEXT) $(LINK) $(uip_rmm_OBJECTS) $(uip_rmm_LDADD) $(LIBS) uip/scan.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/scan$(EXEEXT): $(uip_scan_OBJECTS) $(uip_scan_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/scan$(EXEEXT) $(LINK) $(uip_scan_OBJECTS) $(uip_scan_LDADD) $(LIBS) uip/send.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/send$(EXEEXT): $(uip_send_OBJECTS) $(uip_send_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/send$(EXEEXT) $(LINK) $(uip_send_OBJECTS) $(uip_send_LDADD) $(LIBS) uip/show.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/show$(EXEEXT): $(uip_show_OBJECTS) $(uip_show_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/show$(EXEEXT) $(LINK) $(uip_show_OBJECTS) $(uip_show_LDADD) $(LIBS) uip/slocal.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/slocal$(EXEEXT): $(uip_slocal_OBJECTS) $(uip_slocal_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/slocal$(EXEEXT) $(LINK) $(uip_slocal_OBJECTS) $(uip_slocal_LDADD) $(LIBS) uip/sortm.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/sortm$(EXEEXT): $(uip_sortm_OBJECTS) $(uip_sortm_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/sortm$(EXEEXT) $(LINK) $(uip_sortm_OBJECTS) $(uip_sortm_LDADD) $(LIBS) uip/spost.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/spost$(EXEEXT): $(uip_spost_OBJECTS) $(uip_spost_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/spost$(EXEEXT) $(LINK) $(uip_spost_OBJECTS) $(uip_spost_LDADD) $(LIBS) uip/viamail.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/viamail$(EXEEXT): $(uip_viamail_OBJECTS) $(uip_viamail_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/viamail$(EXEEXT) $(LINK) $(uip_viamail_OBJECTS) $(uip_viamail_LDADD) $(LIBS) uip/whatnow.$(OBJEXT): uip/$(am__dirstamp) \ uip/$(DEPDIR)/$(am__dirstamp) uip/whatnow$(EXEEXT): $(uip_whatnow_OBJECTS) $(uip_whatnow_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/whatnow$(EXEEXT) $(LINK) $(uip_whatnow_OBJECTS) $(uip_whatnow_LDADD) $(LIBS) uip/whom.$(OBJEXT): uip/$(am__dirstamp) uip/$(DEPDIR)/$(am__dirstamp) uip/whom$(EXEEXT): $(uip_whom_OBJECTS) $(uip_whom_DEPENDENCIES) uip/$(am__dirstamp) @rm -f uip/whom$(EXEEXT) $(LINK) $(uip_whom_OBJECTS) $(uip_whom_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f config/sbr_libmh_a-config.$(OBJEXT) -rm -f config/sbr_libmh_a-version.$(OBJEXT) -rm -f mts/smtp/smtp.$(OBJEXT) -rm -f sbr/sbr_libdtimep_a-dtimep.$(OBJEXT) -rm -f sbr/sbr_libmh_a-addrsbr.$(OBJEXT) -rm -f sbr/sbr_libmh_a-ambigsw.$(OBJEXT) -rm -f sbr/sbr_libmh_a-atooi.$(OBJEXT) -rm -f sbr/sbr_libmh_a-brkstring.$(OBJEXT) -rm -f sbr/sbr_libmh_a-check_charset.$(OBJEXT) -rm -f sbr/sbr_libmh_a-client.$(OBJEXT) -rm -f sbr/sbr_libmh_a-closefds.$(OBJEXT) -rm -f sbr/sbr_libmh_a-concat.$(OBJEXT) -rm -f sbr/sbr_libmh_a-context_del.$(OBJEXT) -rm -f sbr/sbr_libmh_a-context_find.$(OBJEXT) -rm -f sbr/sbr_libmh_a-context_foil.$(OBJEXT) -rm -f sbr/sbr_libmh_a-context_read.$(OBJEXT) -rm -f sbr/sbr_libmh_a-context_replace.$(OBJEXT) -rm -f sbr/sbr_libmh_a-context_save.$(OBJEXT) -rm -f sbr/sbr_libmh_a-copy.$(OBJEXT) -rm -f sbr/sbr_libmh_a-copyip.$(OBJEXT) -rm -f sbr/sbr_libmh_a-cpydata.$(OBJEXT) -rm -f sbr/sbr_libmh_a-cpydgst.$(OBJEXT) -rm -f sbr/sbr_libmh_a-crawl_folders.$(OBJEXT) -rm -f sbr/sbr_libmh_a-discard.$(OBJEXT) -rm -f sbr/sbr_libmh_a-done.$(OBJEXT) -rm -f sbr/sbr_libmh_a-dtime.$(OBJEXT) -rm -f sbr/sbr_libmh_a-error.$(OBJEXT) -rm -f sbr/sbr_libmh_a-escape_display_name.$(OBJEXT) -rm -f sbr/sbr_libmh_a-ext_hook.$(OBJEXT) -rm -f sbr/sbr_libmh_a-fdcompare.$(OBJEXT) -rm -f sbr/sbr_libmh_a-fmt_addr.$(OBJEXT) -rm -f sbr/sbr_libmh_a-fmt_compile.$(OBJEXT) -rm -f sbr/sbr_libmh_a-fmt_def.$(OBJEXT) -rm -f sbr/sbr_libmh_a-fmt_new.$(OBJEXT) -rm -f sbr/sbr_libmh_a-fmt_rfc2047.$(OBJEXT) -rm -f sbr/sbr_libmh_a-fmt_scan.$(OBJEXT) -rm -f sbr/sbr_libmh_a-folder_addmsg.$(OBJEXT) -rm -f sbr/sbr_libmh_a-folder_delmsgs.$(OBJEXT) -rm -f sbr/sbr_libmh_a-folder_free.$(OBJEXT) -rm -f sbr/sbr_libmh_a-folder_pack.$(OBJEXT) -rm -f sbr/sbr_libmh_a-folder_read.$(OBJEXT) -rm -f sbr/sbr_libmh_a-folder_realloc.$(OBJEXT) -rm -f sbr/sbr_libmh_a-gans.$(OBJEXT) -rm -f sbr/sbr_libmh_a-getans.$(OBJEXT) -rm -f sbr/sbr_libmh_a-getansreadline.$(OBJEXT) -rm -f sbr/sbr_libmh_a-getanswer.$(OBJEXT) -rm -f sbr/sbr_libmh_a-getarguments.$(OBJEXT) -rm -f sbr/sbr_libmh_a-getcpy.$(OBJEXT) -rm -f sbr/sbr_libmh_a-getfolder.$(OBJEXT) -rm -f sbr/sbr_libmh_a-getpass.$(OBJEXT) -rm -f sbr/sbr_libmh_a-lock_file.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_atoi.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_backup.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_convert.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_draft.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_getfld.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_gmprot.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_maildir.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_mktemp.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_msgdef.$(OBJEXT) -rm -f sbr/sbr_libmh_a-m_name.$(OBJEXT) -rm -f sbr/sbr_libmh_a-makedir.$(OBJEXT) -rm -f sbr/sbr_libmh_a-mf.$(OBJEXT) -rm -f sbr/sbr_libmh_a-mts.$(OBJEXT) -rm -f sbr/sbr_libmh_a-norm_charmap.$(OBJEXT) -rm -f sbr/sbr_libmh_a-path.$(OBJEXT) -rm -f sbr/sbr_libmh_a-peekc.$(OBJEXT) -rm -f sbr/sbr_libmh_a-pidstatus.$(OBJEXT) -rm -f sbr/sbr_libmh_a-pidwait.$(OBJEXT) -rm -f sbr/sbr_libmh_a-print_help.$(OBJEXT) -rm -f sbr/sbr_libmh_a-print_sw.$(OBJEXT) -rm -f sbr/sbr_libmh_a-print_version.$(OBJEXT) -rm -f sbr/sbr_libmh_a-push.$(OBJEXT) -rm -f sbr/sbr_libmh_a-putenv.$(OBJEXT) -rm -f sbr/sbr_libmh_a-r1bindex.$(OBJEXT) -rm -f sbr/sbr_libmh_a-readconfig.$(OBJEXT) -rm -f sbr/sbr_libmh_a-refile.$(OBJEXT) -rm -f sbr/sbr_libmh_a-remdir.$(OBJEXT) -rm -f sbr/sbr_libmh_a-ruserpass.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_add.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_bits.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_del.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_getnum.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_list.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_nameok.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_print.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_read.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_save.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_setcur.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_setprev.$(OBJEXT) -rm -f sbr/sbr_libmh_a-seq_setunseen.$(OBJEXT) -rm -f sbr/sbr_libmh_a-showfile.$(OBJEXT) -rm -f sbr/sbr_libmh_a-signals.$(OBJEXT) -rm -f sbr/sbr_libmh_a-smatch.$(OBJEXT) -rm -f sbr/sbr_libmh_a-snprintb.$(OBJEXT) -rm -f sbr/sbr_libmh_a-ssequal.$(OBJEXT) -rm -f sbr/sbr_libmh_a-strcasecmp.$(OBJEXT) -rm -f sbr/sbr_libmh_a-strindex.$(OBJEXT) -rm -f sbr/sbr_libmh_a-trimcpy.$(OBJEXT) -rm -f sbr/sbr_libmh_a-uprf.$(OBJEXT) -rm -f sbr/sbr_libmh_a-utils.$(OBJEXT) -rm -f sbr/sbr_libmh_a-vfgets.$(OBJEXT) -rm -f test/fakesmtp.$(OBJEXT) -rm -f test/getfqdn.$(OBJEXT) -rm -f test/getfullname.$(OBJEXT) -rm -f uip/ali.$(OBJEXT) -rm -f uip/aliasbr.$(OBJEXT) -rm -f uip/anno.$(OBJEXT) -rm -f uip/annosbr.$(OBJEXT) -rm -f uip/ap.$(OBJEXT) -rm -f uip/burst.$(OBJEXT) -rm -f uip/comp.$(OBJEXT) -rm -f uip/conflict.$(OBJEXT) -rm -f uip/dist.$(OBJEXT) -rm -f uip/distsbr.$(OBJEXT) -rm -f uip/dp.$(OBJEXT) -rm -f uip/dropsbr.$(OBJEXT) -rm -f uip/flist.$(OBJEXT) -rm -f uip/fmtdump.$(OBJEXT) -rm -f uip/folder.$(OBJEXT) -rm -f uip/forw.$(OBJEXT) -rm -f uip/forwsbr.$(OBJEXT) -rm -f uip/inc.$(OBJEXT) -rm -f uip/install-mh.$(OBJEXT) -rm -f uip/mark.$(OBJEXT) -rm -f uip/md5.$(OBJEXT) -rm -f uip/mhbuild.$(OBJEXT) -rm -f uip/mhbuildsbr.$(OBJEXT) -rm -f uip/mhcachesbr.$(OBJEXT) -rm -f uip/mhfree.$(OBJEXT) -rm -f uip/mhl.$(OBJEXT) -rm -f uip/mhlist.$(OBJEXT) -rm -f uip/mhlistsbr.$(OBJEXT) -rm -f uip/mhlsbr.$(OBJEXT) -rm -f uip/mhmail.$(OBJEXT) -rm -f uip/mhmisc.$(OBJEXT) -rm -f uip/mhn.$(OBJEXT) -rm -f uip/mhoutsbr.$(OBJEXT) -rm -f uip/mhparam.$(OBJEXT) -rm -f uip/mhparse.$(OBJEXT) -rm -f uip/mhpath.$(OBJEXT) -rm -f uip/mhshow.$(OBJEXT) -rm -f uip/mhshowsbr.$(OBJEXT) -rm -f uip/mhstore.$(OBJEXT) -rm -f uip/mhstoresbr.$(OBJEXT) -rm -f uip/mhtest.$(OBJEXT) -rm -f uip/msgchk.$(OBJEXT) -rm -f uip/msh.$(OBJEXT) -rm -f uip/mshcmds.$(OBJEXT) -rm -f uip/new.$(OBJEXT) -rm -f uip/packf.$(OBJEXT) -rm -f uip/pick.$(OBJEXT) -rm -f uip/picksbr.$(OBJEXT) -rm -f uip/popsbr.$(OBJEXT) -rm -f uip/post.$(OBJEXT) -rm -f uip/prompter.$(OBJEXT) -rm -f uip/rcvdist.$(OBJEXT) -rm -f uip/rcvpack.$(OBJEXT) -rm -f uip/rcvstore.$(OBJEXT) -rm -f uip/rcvtty.$(OBJEXT) -rm -f uip/refile.$(OBJEXT) -rm -f uip/repl.$(OBJEXT) -rm -f uip/replsbr.$(OBJEXT) -rm -f uip/rmf.$(OBJEXT) -rm -f uip/rmm.$(OBJEXT) -rm -f uip/scan.$(OBJEXT) -rm -f uip/scansbr.$(OBJEXT) -rm -f uip/send.$(OBJEXT) -rm -f uip/sendsbr.$(OBJEXT) -rm -f uip/show.$(OBJEXT) -rm -f uip/slocal.$(OBJEXT) -rm -f uip/sortm.$(OBJEXT) -rm -f uip/spost.$(OBJEXT) -rm -f uip/termsbr.$(OBJEXT) -rm -f uip/viamail.$(OBJEXT) -rm -f uip/vmhsbr.$(OBJEXT) -rm -f uip/whatnow.$(OBJEXT) -rm -f uip/whatnowproc.$(OBJEXT) -rm -f uip/whatnowsbr.$(OBJEXT) -rm -f uip/whom.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/sbr_libmh_a-config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@config/$(DEPDIR)/sbr_libmh_a-version.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@mts/smtp/$(DEPDIR)/smtp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libdtimep_a-dtimep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-addrsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-ambigsw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-atooi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-brkstring.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-check_charset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-closefds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-concat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-context_del.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-context_find.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-context_foil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-context_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-context_replace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-context_save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-copy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-copyip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-cpydata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-cpydgst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-crawl_folders.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-discard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-done.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-dtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-escape_display_name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-ext_hook.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-fdcompare.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-fmt_addr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-fmt_compile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-fmt_def.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-fmt_new.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-fmt_rfc2047.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-fmt_scan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-folder_addmsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-folder_delmsgs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-folder_free.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-folder_pack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-folder_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-folder_realloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-gans.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-getans.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-getansreadline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-getanswer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-getarguments.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-getcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-getfolder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-getpass.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-lock_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_atoi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_backup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_convert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_draft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_getfld.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_gmprot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_maildir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_mktemp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_msgdef.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-m_name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-makedir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-mf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-mts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-norm_charmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-path.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-peekc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-pidstatus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-pidwait.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-print_help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-print_sw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-print_version.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-push.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-putenv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-r1bindex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-readconfig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-refile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-remdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-ruserpass.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_bits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_del.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_getnum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_nameok.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_print.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_setcur.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_setprev.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-seq_setunseen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-showfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-signals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-smatch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-snprintb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-ssequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-strcasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-strindex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-trimcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-uprf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sbr/$(DEPDIR)/sbr_libmh_a-vfgets.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/fakesmtp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/getfqdn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/getfullname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/ali.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/aliasbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/anno.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/annosbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/ap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/burst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/comp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/conflict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/dist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/distsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/dp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/dropsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/flist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/fmtdump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/folder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/forw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/forwsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/inc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/install-mh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mark.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhbuild.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhbuildsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhcachesbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhfree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhlistsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhlsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhmail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhmisc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhoutsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhparam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhpath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhshow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhshowsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhstore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhstoresbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mhtest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/msgchk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/msh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/mshcmds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/new.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/packf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/pick.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/picksbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/popsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/post.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/prompter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/rcvdist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/rcvpack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/rcvstore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/rcvtty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/refile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/repl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/replsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/rmf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/rmm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/scan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/scansbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/send.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/sendsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/show.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/slocal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/sortm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/spost.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/termsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/viamail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/vmhsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/whatnow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/whatnowproc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/whatnowsbr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@uip/$(DEPDIR)/whom.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` sbr/sbr_libdtimep_a-dtimep.o: sbr/dtimep.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sbr_libdtimep_a_CFLAGS) $(CFLAGS) -MT sbr/sbr_libdtimep_a-dtimep.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libdtimep_a-dtimep.Tpo -c -o sbr/sbr_libdtimep_a-dtimep.o `test -f 'sbr/dtimep.c' || echo '$(srcdir)/'`sbr/dtimep.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libdtimep_a-dtimep.Tpo sbr/$(DEPDIR)/sbr_libdtimep_a-dtimep.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/dtimep.c' object='sbr/sbr_libdtimep_a-dtimep.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sbr_libdtimep_a_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libdtimep_a-dtimep.o `test -f 'sbr/dtimep.c' || echo '$(srcdir)/'`sbr/dtimep.c sbr/sbr_libdtimep_a-dtimep.obj: sbr/dtimep.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sbr_libdtimep_a_CFLAGS) $(CFLAGS) -MT sbr/sbr_libdtimep_a-dtimep.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libdtimep_a-dtimep.Tpo -c -o sbr/sbr_libdtimep_a-dtimep.obj `if test -f 'sbr/dtimep.c'; then $(CYGPATH_W) 'sbr/dtimep.c'; else $(CYGPATH_W) '$(srcdir)/sbr/dtimep.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libdtimep_a-dtimep.Tpo sbr/$(DEPDIR)/sbr_libdtimep_a-dtimep.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/dtimep.c' object='sbr/sbr_libdtimep_a-dtimep.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sbr_libdtimep_a_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libdtimep_a-dtimep.obj `if test -f 'sbr/dtimep.c'; then $(CYGPATH_W) 'sbr/dtimep.c'; else $(CYGPATH_W) '$(srcdir)/sbr/dtimep.c'; fi` sbr/sbr_libmh_a-addrsbr.o: sbr/addrsbr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-addrsbr.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-addrsbr.Tpo -c -o sbr/sbr_libmh_a-addrsbr.o `test -f 'sbr/addrsbr.c' || echo '$(srcdir)/'`sbr/addrsbr.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-addrsbr.Tpo sbr/$(DEPDIR)/sbr_libmh_a-addrsbr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/addrsbr.c' object='sbr/sbr_libmh_a-addrsbr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-addrsbr.o `test -f 'sbr/addrsbr.c' || echo '$(srcdir)/'`sbr/addrsbr.c sbr/sbr_libmh_a-addrsbr.obj: sbr/addrsbr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-addrsbr.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-addrsbr.Tpo -c -o sbr/sbr_libmh_a-addrsbr.obj `if test -f 'sbr/addrsbr.c'; then $(CYGPATH_W) 'sbr/addrsbr.c'; else $(CYGPATH_W) '$(srcdir)/sbr/addrsbr.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-addrsbr.Tpo sbr/$(DEPDIR)/sbr_libmh_a-addrsbr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/addrsbr.c' object='sbr/sbr_libmh_a-addrsbr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-addrsbr.obj `if test -f 'sbr/addrsbr.c'; then $(CYGPATH_W) 'sbr/addrsbr.c'; else $(CYGPATH_W) '$(srcdir)/sbr/addrsbr.c'; fi` sbr/sbr_libmh_a-ambigsw.o: sbr/ambigsw.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-ambigsw.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-ambigsw.Tpo -c -o sbr/sbr_libmh_a-ambigsw.o `test -f 'sbr/ambigsw.c' || echo '$(srcdir)/'`sbr/ambigsw.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-ambigsw.Tpo sbr/$(DEPDIR)/sbr_libmh_a-ambigsw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/ambigsw.c' object='sbr/sbr_libmh_a-ambigsw.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-ambigsw.o `test -f 'sbr/ambigsw.c' || echo '$(srcdir)/'`sbr/ambigsw.c sbr/sbr_libmh_a-ambigsw.obj: sbr/ambigsw.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-ambigsw.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-ambigsw.Tpo -c -o sbr/sbr_libmh_a-ambigsw.obj `if test -f 'sbr/ambigsw.c'; then $(CYGPATH_W) 'sbr/ambigsw.c'; else $(CYGPATH_W) '$(srcdir)/sbr/ambigsw.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-ambigsw.Tpo sbr/$(DEPDIR)/sbr_libmh_a-ambigsw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/ambigsw.c' object='sbr/sbr_libmh_a-ambigsw.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-ambigsw.obj `if test -f 'sbr/ambigsw.c'; then $(CYGPATH_W) 'sbr/ambigsw.c'; else $(CYGPATH_W) '$(srcdir)/sbr/ambigsw.c'; fi` sbr/sbr_libmh_a-atooi.o: sbr/atooi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-atooi.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-atooi.Tpo -c -o sbr/sbr_libmh_a-atooi.o `test -f 'sbr/atooi.c' || echo '$(srcdir)/'`sbr/atooi.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-atooi.Tpo sbr/$(DEPDIR)/sbr_libmh_a-atooi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/atooi.c' object='sbr/sbr_libmh_a-atooi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-atooi.o `test -f 'sbr/atooi.c' || echo '$(srcdir)/'`sbr/atooi.c sbr/sbr_libmh_a-atooi.obj: sbr/atooi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-atooi.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-atooi.Tpo -c -o sbr/sbr_libmh_a-atooi.obj `if test -f 'sbr/atooi.c'; then $(CYGPATH_W) 'sbr/atooi.c'; else $(CYGPATH_W) '$(srcdir)/sbr/atooi.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-atooi.Tpo sbr/$(DEPDIR)/sbr_libmh_a-atooi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/atooi.c' object='sbr/sbr_libmh_a-atooi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-atooi.obj `if test -f 'sbr/atooi.c'; then $(CYGPATH_W) 'sbr/atooi.c'; else $(CYGPATH_W) '$(srcdir)/sbr/atooi.c'; fi` sbr/sbr_libmh_a-brkstring.o: sbr/brkstring.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-brkstring.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-brkstring.Tpo -c -o sbr/sbr_libmh_a-brkstring.o `test -f 'sbr/brkstring.c' || echo '$(srcdir)/'`sbr/brkstring.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-brkstring.Tpo sbr/$(DEPDIR)/sbr_libmh_a-brkstring.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/brkstring.c' object='sbr/sbr_libmh_a-brkstring.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-brkstring.o `test -f 'sbr/brkstring.c' || echo '$(srcdir)/'`sbr/brkstring.c sbr/sbr_libmh_a-brkstring.obj: sbr/brkstring.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-brkstring.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-brkstring.Tpo -c -o sbr/sbr_libmh_a-brkstring.obj `if test -f 'sbr/brkstring.c'; then $(CYGPATH_W) 'sbr/brkstring.c'; else $(CYGPATH_W) '$(srcdir)/sbr/brkstring.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-brkstring.Tpo sbr/$(DEPDIR)/sbr_libmh_a-brkstring.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/brkstring.c' object='sbr/sbr_libmh_a-brkstring.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-brkstring.obj `if test -f 'sbr/brkstring.c'; then $(CYGPATH_W) 'sbr/brkstring.c'; else $(CYGPATH_W) '$(srcdir)/sbr/brkstring.c'; fi` sbr/sbr_libmh_a-check_charset.o: sbr/check_charset.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-check_charset.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-check_charset.Tpo -c -o sbr/sbr_libmh_a-check_charset.o `test -f 'sbr/check_charset.c' || echo '$(srcdir)/'`sbr/check_charset.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-check_charset.Tpo sbr/$(DEPDIR)/sbr_libmh_a-check_charset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/check_charset.c' object='sbr/sbr_libmh_a-check_charset.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-check_charset.o `test -f 'sbr/check_charset.c' || echo '$(srcdir)/'`sbr/check_charset.c sbr/sbr_libmh_a-check_charset.obj: sbr/check_charset.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-check_charset.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-check_charset.Tpo -c -o sbr/sbr_libmh_a-check_charset.obj `if test -f 'sbr/check_charset.c'; then $(CYGPATH_W) 'sbr/check_charset.c'; else $(CYGPATH_W) '$(srcdir)/sbr/check_charset.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-check_charset.Tpo sbr/$(DEPDIR)/sbr_libmh_a-check_charset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/check_charset.c' object='sbr/sbr_libmh_a-check_charset.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-check_charset.obj `if test -f 'sbr/check_charset.c'; then $(CYGPATH_W) 'sbr/check_charset.c'; else $(CYGPATH_W) '$(srcdir)/sbr/check_charset.c'; fi` sbr/sbr_libmh_a-client.o: sbr/client.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-client.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-client.Tpo -c -o sbr/sbr_libmh_a-client.o `test -f 'sbr/client.c' || echo '$(srcdir)/'`sbr/client.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-client.Tpo sbr/$(DEPDIR)/sbr_libmh_a-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/client.c' object='sbr/sbr_libmh_a-client.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-client.o `test -f 'sbr/client.c' || echo '$(srcdir)/'`sbr/client.c sbr/sbr_libmh_a-client.obj: sbr/client.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-client.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-client.Tpo -c -o sbr/sbr_libmh_a-client.obj `if test -f 'sbr/client.c'; then $(CYGPATH_W) 'sbr/client.c'; else $(CYGPATH_W) '$(srcdir)/sbr/client.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-client.Tpo sbr/$(DEPDIR)/sbr_libmh_a-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/client.c' object='sbr/sbr_libmh_a-client.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-client.obj `if test -f 'sbr/client.c'; then $(CYGPATH_W) 'sbr/client.c'; else $(CYGPATH_W) '$(srcdir)/sbr/client.c'; fi` sbr/sbr_libmh_a-closefds.o: sbr/closefds.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-closefds.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-closefds.Tpo -c -o sbr/sbr_libmh_a-closefds.o `test -f 'sbr/closefds.c' || echo '$(srcdir)/'`sbr/closefds.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-closefds.Tpo sbr/$(DEPDIR)/sbr_libmh_a-closefds.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/closefds.c' object='sbr/sbr_libmh_a-closefds.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-closefds.o `test -f 'sbr/closefds.c' || echo '$(srcdir)/'`sbr/closefds.c sbr/sbr_libmh_a-closefds.obj: sbr/closefds.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-closefds.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-closefds.Tpo -c -o sbr/sbr_libmh_a-closefds.obj `if test -f 'sbr/closefds.c'; then $(CYGPATH_W) 'sbr/closefds.c'; else $(CYGPATH_W) '$(srcdir)/sbr/closefds.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-closefds.Tpo sbr/$(DEPDIR)/sbr_libmh_a-closefds.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/closefds.c' object='sbr/sbr_libmh_a-closefds.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-closefds.obj `if test -f 'sbr/closefds.c'; then $(CYGPATH_W) 'sbr/closefds.c'; else $(CYGPATH_W) '$(srcdir)/sbr/closefds.c'; fi` sbr/sbr_libmh_a-concat.o: sbr/concat.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-concat.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-concat.Tpo -c -o sbr/sbr_libmh_a-concat.o `test -f 'sbr/concat.c' || echo '$(srcdir)/'`sbr/concat.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-concat.Tpo sbr/$(DEPDIR)/sbr_libmh_a-concat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/concat.c' object='sbr/sbr_libmh_a-concat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-concat.o `test -f 'sbr/concat.c' || echo '$(srcdir)/'`sbr/concat.c sbr/sbr_libmh_a-concat.obj: sbr/concat.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-concat.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-concat.Tpo -c -o sbr/sbr_libmh_a-concat.obj `if test -f 'sbr/concat.c'; then $(CYGPATH_W) 'sbr/concat.c'; else $(CYGPATH_W) '$(srcdir)/sbr/concat.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-concat.Tpo sbr/$(DEPDIR)/sbr_libmh_a-concat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/concat.c' object='sbr/sbr_libmh_a-concat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-concat.obj `if test -f 'sbr/concat.c'; then $(CYGPATH_W) 'sbr/concat.c'; else $(CYGPATH_W) '$(srcdir)/sbr/concat.c'; fi` sbr/sbr_libmh_a-context_del.o: sbr/context_del.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_del.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_del.Tpo -c -o sbr/sbr_libmh_a-context_del.o `test -f 'sbr/context_del.c' || echo '$(srcdir)/'`sbr/context_del.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_del.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_del.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_del.c' object='sbr/sbr_libmh_a-context_del.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_del.o `test -f 'sbr/context_del.c' || echo '$(srcdir)/'`sbr/context_del.c sbr/sbr_libmh_a-context_del.obj: sbr/context_del.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_del.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_del.Tpo -c -o sbr/sbr_libmh_a-context_del.obj `if test -f 'sbr/context_del.c'; then $(CYGPATH_W) 'sbr/context_del.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_del.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_del.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_del.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_del.c' object='sbr/sbr_libmh_a-context_del.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_del.obj `if test -f 'sbr/context_del.c'; then $(CYGPATH_W) 'sbr/context_del.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_del.c'; fi` sbr/sbr_libmh_a-context_find.o: sbr/context_find.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_find.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_find.Tpo -c -o sbr/sbr_libmh_a-context_find.o `test -f 'sbr/context_find.c' || echo '$(srcdir)/'`sbr/context_find.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_find.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_find.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_find.c' object='sbr/sbr_libmh_a-context_find.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_find.o `test -f 'sbr/context_find.c' || echo '$(srcdir)/'`sbr/context_find.c sbr/sbr_libmh_a-context_find.obj: sbr/context_find.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_find.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_find.Tpo -c -o sbr/sbr_libmh_a-context_find.obj `if test -f 'sbr/context_find.c'; then $(CYGPATH_W) 'sbr/context_find.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_find.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_find.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_find.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_find.c' object='sbr/sbr_libmh_a-context_find.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_find.obj `if test -f 'sbr/context_find.c'; then $(CYGPATH_W) 'sbr/context_find.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_find.c'; fi` sbr/sbr_libmh_a-context_foil.o: sbr/context_foil.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_foil.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_foil.Tpo -c -o sbr/sbr_libmh_a-context_foil.o `test -f 'sbr/context_foil.c' || echo '$(srcdir)/'`sbr/context_foil.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_foil.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_foil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_foil.c' object='sbr/sbr_libmh_a-context_foil.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_foil.o `test -f 'sbr/context_foil.c' || echo '$(srcdir)/'`sbr/context_foil.c sbr/sbr_libmh_a-context_foil.obj: sbr/context_foil.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_foil.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_foil.Tpo -c -o sbr/sbr_libmh_a-context_foil.obj `if test -f 'sbr/context_foil.c'; then $(CYGPATH_W) 'sbr/context_foil.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_foil.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_foil.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_foil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_foil.c' object='sbr/sbr_libmh_a-context_foil.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_foil.obj `if test -f 'sbr/context_foil.c'; then $(CYGPATH_W) 'sbr/context_foil.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_foil.c'; fi` sbr/sbr_libmh_a-context_read.o: sbr/context_read.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_read.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_read.Tpo -c -o sbr/sbr_libmh_a-context_read.o `test -f 'sbr/context_read.c' || echo '$(srcdir)/'`sbr/context_read.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_read.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_read.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_read.c' object='sbr/sbr_libmh_a-context_read.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_read.o `test -f 'sbr/context_read.c' || echo '$(srcdir)/'`sbr/context_read.c sbr/sbr_libmh_a-context_read.obj: sbr/context_read.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_read.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_read.Tpo -c -o sbr/sbr_libmh_a-context_read.obj `if test -f 'sbr/context_read.c'; then $(CYGPATH_W) 'sbr/context_read.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_read.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_read.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_read.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_read.c' object='sbr/sbr_libmh_a-context_read.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_read.obj `if test -f 'sbr/context_read.c'; then $(CYGPATH_W) 'sbr/context_read.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_read.c'; fi` sbr/sbr_libmh_a-context_replace.o: sbr/context_replace.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_replace.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_replace.Tpo -c -o sbr/sbr_libmh_a-context_replace.o `test -f 'sbr/context_replace.c' || echo '$(srcdir)/'`sbr/context_replace.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_replace.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_replace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_replace.c' object='sbr/sbr_libmh_a-context_replace.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_replace.o `test -f 'sbr/context_replace.c' || echo '$(srcdir)/'`sbr/context_replace.c sbr/sbr_libmh_a-context_replace.obj: sbr/context_replace.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_replace.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_replace.Tpo -c -o sbr/sbr_libmh_a-context_replace.obj `if test -f 'sbr/context_replace.c'; then $(CYGPATH_W) 'sbr/context_replace.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_replace.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_replace.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_replace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_replace.c' object='sbr/sbr_libmh_a-context_replace.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_replace.obj `if test -f 'sbr/context_replace.c'; then $(CYGPATH_W) 'sbr/context_replace.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_replace.c'; fi` sbr/sbr_libmh_a-context_save.o: sbr/context_save.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_save.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_save.Tpo -c -o sbr/sbr_libmh_a-context_save.o `test -f 'sbr/context_save.c' || echo '$(srcdir)/'`sbr/context_save.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_save.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_save.c' object='sbr/sbr_libmh_a-context_save.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_save.o `test -f 'sbr/context_save.c' || echo '$(srcdir)/'`sbr/context_save.c sbr/sbr_libmh_a-context_save.obj: sbr/context_save.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-context_save.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-context_save.Tpo -c -o sbr/sbr_libmh_a-context_save.obj `if test -f 'sbr/context_save.c'; then $(CYGPATH_W) 'sbr/context_save.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_save.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-context_save.Tpo sbr/$(DEPDIR)/sbr_libmh_a-context_save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/context_save.c' object='sbr/sbr_libmh_a-context_save.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-context_save.obj `if test -f 'sbr/context_save.c'; then $(CYGPATH_W) 'sbr/context_save.c'; else $(CYGPATH_W) '$(srcdir)/sbr/context_save.c'; fi` sbr/sbr_libmh_a-copy.o: sbr/copy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-copy.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-copy.Tpo -c -o sbr/sbr_libmh_a-copy.o `test -f 'sbr/copy.c' || echo '$(srcdir)/'`sbr/copy.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-copy.Tpo sbr/$(DEPDIR)/sbr_libmh_a-copy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/copy.c' object='sbr/sbr_libmh_a-copy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-copy.o `test -f 'sbr/copy.c' || echo '$(srcdir)/'`sbr/copy.c sbr/sbr_libmh_a-copy.obj: sbr/copy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-copy.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-copy.Tpo -c -o sbr/sbr_libmh_a-copy.obj `if test -f 'sbr/copy.c'; then $(CYGPATH_W) 'sbr/copy.c'; else $(CYGPATH_W) '$(srcdir)/sbr/copy.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-copy.Tpo sbr/$(DEPDIR)/sbr_libmh_a-copy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/copy.c' object='sbr/sbr_libmh_a-copy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-copy.obj `if test -f 'sbr/copy.c'; then $(CYGPATH_W) 'sbr/copy.c'; else $(CYGPATH_W) '$(srcdir)/sbr/copy.c'; fi` sbr/sbr_libmh_a-copyip.o: sbr/copyip.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-copyip.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-copyip.Tpo -c -o sbr/sbr_libmh_a-copyip.o `test -f 'sbr/copyip.c' || echo '$(srcdir)/'`sbr/copyip.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-copyip.Tpo sbr/$(DEPDIR)/sbr_libmh_a-copyip.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/copyip.c' object='sbr/sbr_libmh_a-copyip.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-copyip.o `test -f 'sbr/copyip.c' || echo '$(srcdir)/'`sbr/copyip.c sbr/sbr_libmh_a-copyip.obj: sbr/copyip.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-copyip.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-copyip.Tpo -c -o sbr/sbr_libmh_a-copyip.obj `if test -f 'sbr/copyip.c'; then $(CYGPATH_W) 'sbr/copyip.c'; else $(CYGPATH_W) '$(srcdir)/sbr/copyip.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-copyip.Tpo sbr/$(DEPDIR)/sbr_libmh_a-copyip.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/copyip.c' object='sbr/sbr_libmh_a-copyip.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-copyip.obj `if test -f 'sbr/copyip.c'; then $(CYGPATH_W) 'sbr/copyip.c'; else $(CYGPATH_W) '$(srcdir)/sbr/copyip.c'; fi` sbr/sbr_libmh_a-cpydata.o: sbr/cpydata.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-cpydata.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-cpydata.Tpo -c -o sbr/sbr_libmh_a-cpydata.o `test -f 'sbr/cpydata.c' || echo '$(srcdir)/'`sbr/cpydata.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-cpydata.Tpo sbr/$(DEPDIR)/sbr_libmh_a-cpydata.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/cpydata.c' object='sbr/sbr_libmh_a-cpydata.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-cpydata.o `test -f 'sbr/cpydata.c' || echo '$(srcdir)/'`sbr/cpydata.c sbr/sbr_libmh_a-cpydata.obj: sbr/cpydata.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-cpydata.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-cpydata.Tpo -c -o sbr/sbr_libmh_a-cpydata.obj `if test -f 'sbr/cpydata.c'; then $(CYGPATH_W) 'sbr/cpydata.c'; else $(CYGPATH_W) '$(srcdir)/sbr/cpydata.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-cpydata.Tpo sbr/$(DEPDIR)/sbr_libmh_a-cpydata.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/cpydata.c' object='sbr/sbr_libmh_a-cpydata.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-cpydata.obj `if test -f 'sbr/cpydata.c'; then $(CYGPATH_W) 'sbr/cpydata.c'; else $(CYGPATH_W) '$(srcdir)/sbr/cpydata.c'; fi` sbr/sbr_libmh_a-cpydgst.o: sbr/cpydgst.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-cpydgst.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-cpydgst.Tpo -c -o sbr/sbr_libmh_a-cpydgst.o `test -f 'sbr/cpydgst.c' || echo '$(srcdir)/'`sbr/cpydgst.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-cpydgst.Tpo sbr/$(DEPDIR)/sbr_libmh_a-cpydgst.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/cpydgst.c' object='sbr/sbr_libmh_a-cpydgst.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-cpydgst.o `test -f 'sbr/cpydgst.c' || echo '$(srcdir)/'`sbr/cpydgst.c sbr/sbr_libmh_a-cpydgst.obj: sbr/cpydgst.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-cpydgst.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-cpydgst.Tpo -c -o sbr/sbr_libmh_a-cpydgst.obj `if test -f 'sbr/cpydgst.c'; then $(CYGPATH_W) 'sbr/cpydgst.c'; else $(CYGPATH_W) '$(srcdir)/sbr/cpydgst.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-cpydgst.Tpo sbr/$(DEPDIR)/sbr_libmh_a-cpydgst.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/cpydgst.c' object='sbr/sbr_libmh_a-cpydgst.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-cpydgst.obj `if test -f 'sbr/cpydgst.c'; then $(CYGPATH_W) 'sbr/cpydgst.c'; else $(CYGPATH_W) '$(srcdir)/sbr/cpydgst.c'; fi` sbr/sbr_libmh_a-crawl_folders.o: sbr/crawl_folders.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-crawl_folders.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-crawl_folders.Tpo -c -o sbr/sbr_libmh_a-crawl_folders.o `test -f 'sbr/crawl_folders.c' || echo '$(srcdir)/'`sbr/crawl_folders.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-crawl_folders.Tpo sbr/$(DEPDIR)/sbr_libmh_a-crawl_folders.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/crawl_folders.c' object='sbr/sbr_libmh_a-crawl_folders.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-crawl_folders.o `test -f 'sbr/crawl_folders.c' || echo '$(srcdir)/'`sbr/crawl_folders.c sbr/sbr_libmh_a-crawl_folders.obj: sbr/crawl_folders.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-crawl_folders.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-crawl_folders.Tpo -c -o sbr/sbr_libmh_a-crawl_folders.obj `if test -f 'sbr/crawl_folders.c'; then $(CYGPATH_W) 'sbr/crawl_folders.c'; else $(CYGPATH_W) '$(srcdir)/sbr/crawl_folders.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-crawl_folders.Tpo sbr/$(DEPDIR)/sbr_libmh_a-crawl_folders.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/crawl_folders.c' object='sbr/sbr_libmh_a-crawl_folders.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-crawl_folders.obj `if test -f 'sbr/crawl_folders.c'; then $(CYGPATH_W) 'sbr/crawl_folders.c'; else $(CYGPATH_W) '$(srcdir)/sbr/crawl_folders.c'; fi` sbr/sbr_libmh_a-discard.o: sbr/discard.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-discard.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-discard.Tpo -c -o sbr/sbr_libmh_a-discard.o `test -f 'sbr/discard.c' || echo '$(srcdir)/'`sbr/discard.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-discard.Tpo sbr/$(DEPDIR)/sbr_libmh_a-discard.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/discard.c' object='sbr/sbr_libmh_a-discard.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-discard.o `test -f 'sbr/discard.c' || echo '$(srcdir)/'`sbr/discard.c sbr/sbr_libmh_a-discard.obj: sbr/discard.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-discard.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-discard.Tpo -c -o sbr/sbr_libmh_a-discard.obj `if test -f 'sbr/discard.c'; then $(CYGPATH_W) 'sbr/discard.c'; else $(CYGPATH_W) '$(srcdir)/sbr/discard.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-discard.Tpo sbr/$(DEPDIR)/sbr_libmh_a-discard.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/discard.c' object='sbr/sbr_libmh_a-discard.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-discard.obj `if test -f 'sbr/discard.c'; then $(CYGPATH_W) 'sbr/discard.c'; else $(CYGPATH_W) '$(srcdir)/sbr/discard.c'; fi` sbr/sbr_libmh_a-done.o: sbr/done.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-done.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-done.Tpo -c -o sbr/sbr_libmh_a-done.o `test -f 'sbr/done.c' || echo '$(srcdir)/'`sbr/done.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-done.Tpo sbr/$(DEPDIR)/sbr_libmh_a-done.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/done.c' object='sbr/sbr_libmh_a-done.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-done.o `test -f 'sbr/done.c' || echo '$(srcdir)/'`sbr/done.c sbr/sbr_libmh_a-done.obj: sbr/done.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-done.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-done.Tpo -c -o sbr/sbr_libmh_a-done.obj `if test -f 'sbr/done.c'; then $(CYGPATH_W) 'sbr/done.c'; else $(CYGPATH_W) '$(srcdir)/sbr/done.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-done.Tpo sbr/$(DEPDIR)/sbr_libmh_a-done.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/done.c' object='sbr/sbr_libmh_a-done.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-done.obj `if test -f 'sbr/done.c'; then $(CYGPATH_W) 'sbr/done.c'; else $(CYGPATH_W) '$(srcdir)/sbr/done.c'; fi` sbr/sbr_libmh_a-dtime.o: sbr/dtime.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-dtime.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-dtime.Tpo -c -o sbr/sbr_libmh_a-dtime.o `test -f 'sbr/dtime.c' || echo '$(srcdir)/'`sbr/dtime.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-dtime.Tpo sbr/$(DEPDIR)/sbr_libmh_a-dtime.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/dtime.c' object='sbr/sbr_libmh_a-dtime.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-dtime.o `test -f 'sbr/dtime.c' || echo '$(srcdir)/'`sbr/dtime.c sbr/sbr_libmh_a-dtime.obj: sbr/dtime.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-dtime.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-dtime.Tpo -c -o sbr/sbr_libmh_a-dtime.obj `if test -f 'sbr/dtime.c'; then $(CYGPATH_W) 'sbr/dtime.c'; else $(CYGPATH_W) '$(srcdir)/sbr/dtime.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-dtime.Tpo sbr/$(DEPDIR)/sbr_libmh_a-dtime.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/dtime.c' object='sbr/sbr_libmh_a-dtime.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-dtime.obj `if test -f 'sbr/dtime.c'; then $(CYGPATH_W) 'sbr/dtime.c'; else $(CYGPATH_W) '$(srcdir)/sbr/dtime.c'; fi` sbr/sbr_libmh_a-escape_display_name.o: sbr/escape_display_name.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-escape_display_name.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-escape_display_name.Tpo -c -o sbr/sbr_libmh_a-escape_display_name.o `test -f 'sbr/escape_display_name.c' || echo '$(srcdir)/'`sbr/escape_display_name.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-escape_display_name.Tpo sbr/$(DEPDIR)/sbr_libmh_a-escape_display_name.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/escape_display_name.c' object='sbr/sbr_libmh_a-escape_display_name.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-escape_display_name.o `test -f 'sbr/escape_display_name.c' || echo '$(srcdir)/'`sbr/escape_display_name.c sbr/sbr_libmh_a-escape_display_name.obj: sbr/escape_display_name.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-escape_display_name.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-escape_display_name.Tpo -c -o sbr/sbr_libmh_a-escape_display_name.obj `if test -f 'sbr/escape_display_name.c'; then $(CYGPATH_W) 'sbr/escape_display_name.c'; else $(CYGPATH_W) '$(srcdir)/sbr/escape_display_name.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-escape_display_name.Tpo sbr/$(DEPDIR)/sbr_libmh_a-escape_display_name.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/escape_display_name.c' object='sbr/sbr_libmh_a-escape_display_name.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-escape_display_name.obj `if test -f 'sbr/escape_display_name.c'; then $(CYGPATH_W) 'sbr/escape_display_name.c'; else $(CYGPATH_W) '$(srcdir)/sbr/escape_display_name.c'; fi` sbr/sbr_libmh_a-error.o: sbr/error.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-error.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-error.Tpo -c -o sbr/sbr_libmh_a-error.o `test -f 'sbr/error.c' || echo '$(srcdir)/'`sbr/error.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-error.Tpo sbr/$(DEPDIR)/sbr_libmh_a-error.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/error.c' object='sbr/sbr_libmh_a-error.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-error.o `test -f 'sbr/error.c' || echo '$(srcdir)/'`sbr/error.c sbr/sbr_libmh_a-error.obj: sbr/error.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-error.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-error.Tpo -c -o sbr/sbr_libmh_a-error.obj `if test -f 'sbr/error.c'; then $(CYGPATH_W) 'sbr/error.c'; else $(CYGPATH_W) '$(srcdir)/sbr/error.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-error.Tpo sbr/$(DEPDIR)/sbr_libmh_a-error.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/error.c' object='sbr/sbr_libmh_a-error.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-error.obj `if test -f 'sbr/error.c'; then $(CYGPATH_W) 'sbr/error.c'; else $(CYGPATH_W) '$(srcdir)/sbr/error.c'; fi` sbr/sbr_libmh_a-ext_hook.o: sbr/ext_hook.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-ext_hook.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-ext_hook.Tpo -c -o sbr/sbr_libmh_a-ext_hook.o `test -f 'sbr/ext_hook.c' || echo '$(srcdir)/'`sbr/ext_hook.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-ext_hook.Tpo sbr/$(DEPDIR)/sbr_libmh_a-ext_hook.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/ext_hook.c' object='sbr/sbr_libmh_a-ext_hook.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-ext_hook.o `test -f 'sbr/ext_hook.c' || echo '$(srcdir)/'`sbr/ext_hook.c sbr/sbr_libmh_a-ext_hook.obj: sbr/ext_hook.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-ext_hook.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-ext_hook.Tpo -c -o sbr/sbr_libmh_a-ext_hook.obj `if test -f 'sbr/ext_hook.c'; then $(CYGPATH_W) 'sbr/ext_hook.c'; else $(CYGPATH_W) '$(srcdir)/sbr/ext_hook.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-ext_hook.Tpo sbr/$(DEPDIR)/sbr_libmh_a-ext_hook.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/ext_hook.c' object='sbr/sbr_libmh_a-ext_hook.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-ext_hook.obj `if test -f 'sbr/ext_hook.c'; then $(CYGPATH_W) 'sbr/ext_hook.c'; else $(CYGPATH_W) '$(srcdir)/sbr/ext_hook.c'; fi` sbr/sbr_libmh_a-fdcompare.o: sbr/fdcompare.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fdcompare.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fdcompare.Tpo -c -o sbr/sbr_libmh_a-fdcompare.o `test -f 'sbr/fdcompare.c' || echo '$(srcdir)/'`sbr/fdcompare.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fdcompare.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fdcompare.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fdcompare.c' object='sbr/sbr_libmh_a-fdcompare.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fdcompare.o `test -f 'sbr/fdcompare.c' || echo '$(srcdir)/'`sbr/fdcompare.c sbr/sbr_libmh_a-fdcompare.obj: sbr/fdcompare.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fdcompare.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fdcompare.Tpo -c -o sbr/sbr_libmh_a-fdcompare.obj `if test -f 'sbr/fdcompare.c'; then $(CYGPATH_W) 'sbr/fdcompare.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fdcompare.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fdcompare.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fdcompare.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fdcompare.c' object='sbr/sbr_libmh_a-fdcompare.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fdcompare.obj `if test -f 'sbr/fdcompare.c'; then $(CYGPATH_W) 'sbr/fdcompare.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fdcompare.c'; fi` sbr/sbr_libmh_a-folder_addmsg.o: sbr/folder_addmsg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_addmsg.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_addmsg.Tpo -c -o sbr/sbr_libmh_a-folder_addmsg.o `test -f 'sbr/folder_addmsg.c' || echo '$(srcdir)/'`sbr/folder_addmsg.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_addmsg.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_addmsg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_addmsg.c' object='sbr/sbr_libmh_a-folder_addmsg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_addmsg.o `test -f 'sbr/folder_addmsg.c' || echo '$(srcdir)/'`sbr/folder_addmsg.c sbr/sbr_libmh_a-folder_addmsg.obj: sbr/folder_addmsg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_addmsg.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_addmsg.Tpo -c -o sbr/sbr_libmh_a-folder_addmsg.obj `if test -f 'sbr/folder_addmsg.c'; then $(CYGPATH_W) 'sbr/folder_addmsg.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_addmsg.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_addmsg.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_addmsg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_addmsg.c' object='sbr/sbr_libmh_a-folder_addmsg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_addmsg.obj `if test -f 'sbr/folder_addmsg.c'; then $(CYGPATH_W) 'sbr/folder_addmsg.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_addmsg.c'; fi` sbr/sbr_libmh_a-folder_delmsgs.o: sbr/folder_delmsgs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_delmsgs.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_delmsgs.Tpo -c -o sbr/sbr_libmh_a-folder_delmsgs.o `test -f 'sbr/folder_delmsgs.c' || echo '$(srcdir)/'`sbr/folder_delmsgs.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_delmsgs.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_delmsgs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_delmsgs.c' object='sbr/sbr_libmh_a-folder_delmsgs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_delmsgs.o `test -f 'sbr/folder_delmsgs.c' || echo '$(srcdir)/'`sbr/folder_delmsgs.c sbr/sbr_libmh_a-folder_delmsgs.obj: sbr/folder_delmsgs.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_delmsgs.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_delmsgs.Tpo -c -o sbr/sbr_libmh_a-folder_delmsgs.obj `if test -f 'sbr/folder_delmsgs.c'; then $(CYGPATH_W) 'sbr/folder_delmsgs.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_delmsgs.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_delmsgs.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_delmsgs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_delmsgs.c' object='sbr/sbr_libmh_a-folder_delmsgs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_delmsgs.obj `if test -f 'sbr/folder_delmsgs.c'; then $(CYGPATH_W) 'sbr/folder_delmsgs.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_delmsgs.c'; fi` sbr/sbr_libmh_a-folder_free.o: sbr/folder_free.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_free.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_free.Tpo -c -o sbr/sbr_libmh_a-folder_free.o `test -f 'sbr/folder_free.c' || echo '$(srcdir)/'`sbr/folder_free.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_free.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_free.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_free.c' object='sbr/sbr_libmh_a-folder_free.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_free.o `test -f 'sbr/folder_free.c' || echo '$(srcdir)/'`sbr/folder_free.c sbr/sbr_libmh_a-folder_free.obj: sbr/folder_free.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_free.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_free.Tpo -c -o sbr/sbr_libmh_a-folder_free.obj `if test -f 'sbr/folder_free.c'; then $(CYGPATH_W) 'sbr/folder_free.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_free.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_free.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_free.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_free.c' object='sbr/sbr_libmh_a-folder_free.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_free.obj `if test -f 'sbr/folder_free.c'; then $(CYGPATH_W) 'sbr/folder_free.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_free.c'; fi` sbr/sbr_libmh_a-folder_pack.o: sbr/folder_pack.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_pack.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_pack.Tpo -c -o sbr/sbr_libmh_a-folder_pack.o `test -f 'sbr/folder_pack.c' || echo '$(srcdir)/'`sbr/folder_pack.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_pack.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_pack.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_pack.c' object='sbr/sbr_libmh_a-folder_pack.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_pack.o `test -f 'sbr/folder_pack.c' || echo '$(srcdir)/'`sbr/folder_pack.c sbr/sbr_libmh_a-folder_pack.obj: sbr/folder_pack.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_pack.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_pack.Tpo -c -o sbr/sbr_libmh_a-folder_pack.obj `if test -f 'sbr/folder_pack.c'; then $(CYGPATH_W) 'sbr/folder_pack.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_pack.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_pack.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_pack.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_pack.c' object='sbr/sbr_libmh_a-folder_pack.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_pack.obj `if test -f 'sbr/folder_pack.c'; then $(CYGPATH_W) 'sbr/folder_pack.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_pack.c'; fi` sbr/sbr_libmh_a-folder_read.o: sbr/folder_read.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_read.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_read.Tpo -c -o sbr/sbr_libmh_a-folder_read.o `test -f 'sbr/folder_read.c' || echo '$(srcdir)/'`sbr/folder_read.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_read.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_read.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_read.c' object='sbr/sbr_libmh_a-folder_read.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_read.o `test -f 'sbr/folder_read.c' || echo '$(srcdir)/'`sbr/folder_read.c sbr/sbr_libmh_a-folder_read.obj: sbr/folder_read.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_read.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_read.Tpo -c -o sbr/sbr_libmh_a-folder_read.obj `if test -f 'sbr/folder_read.c'; then $(CYGPATH_W) 'sbr/folder_read.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_read.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_read.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_read.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_read.c' object='sbr/sbr_libmh_a-folder_read.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_read.obj `if test -f 'sbr/folder_read.c'; then $(CYGPATH_W) 'sbr/folder_read.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_read.c'; fi` sbr/sbr_libmh_a-folder_realloc.o: sbr/folder_realloc.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_realloc.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_realloc.Tpo -c -o sbr/sbr_libmh_a-folder_realloc.o `test -f 'sbr/folder_realloc.c' || echo '$(srcdir)/'`sbr/folder_realloc.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_realloc.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_realloc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_realloc.c' object='sbr/sbr_libmh_a-folder_realloc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_realloc.o `test -f 'sbr/folder_realloc.c' || echo '$(srcdir)/'`sbr/folder_realloc.c sbr/sbr_libmh_a-folder_realloc.obj: sbr/folder_realloc.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-folder_realloc.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-folder_realloc.Tpo -c -o sbr/sbr_libmh_a-folder_realloc.obj `if test -f 'sbr/folder_realloc.c'; then $(CYGPATH_W) 'sbr/folder_realloc.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_realloc.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-folder_realloc.Tpo sbr/$(DEPDIR)/sbr_libmh_a-folder_realloc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/folder_realloc.c' object='sbr/sbr_libmh_a-folder_realloc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-folder_realloc.obj `if test -f 'sbr/folder_realloc.c'; then $(CYGPATH_W) 'sbr/folder_realloc.c'; else $(CYGPATH_W) '$(srcdir)/sbr/folder_realloc.c'; fi` sbr/sbr_libmh_a-gans.o: sbr/gans.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-gans.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-gans.Tpo -c -o sbr/sbr_libmh_a-gans.o `test -f 'sbr/gans.c' || echo '$(srcdir)/'`sbr/gans.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-gans.Tpo sbr/$(DEPDIR)/sbr_libmh_a-gans.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/gans.c' object='sbr/sbr_libmh_a-gans.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-gans.o `test -f 'sbr/gans.c' || echo '$(srcdir)/'`sbr/gans.c sbr/sbr_libmh_a-gans.obj: sbr/gans.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-gans.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-gans.Tpo -c -o sbr/sbr_libmh_a-gans.obj `if test -f 'sbr/gans.c'; then $(CYGPATH_W) 'sbr/gans.c'; else $(CYGPATH_W) '$(srcdir)/sbr/gans.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-gans.Tpo sbr/$(DEPDIR)/sbr_libmh_a-gans.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/gans.c' object='sbr/sbr_libmh_a-gans.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-gans.obj `if test -f 'sbr/gans.c'; then $(CYGPATH_W) 'sbr/gans.c'; else $(CYGPATH_W) '$(srcdir)/sbr/gans.c'; fi` sbr/sbr_libmh_a-getans.o: sbr/getans.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getans.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getans.Tpo -c -o sbr/sbr_libmh_a-getans.o `test -f 'sbr/getans.c' || echo '$(srcdir)/'`sbr/getans.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getans.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getans.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getans.c' object='sbr/sbr_libmh_a-getans.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getans.o `test -f 'sbr/getans.c' || echo '$(srcdir)/'`sbr/getans.c sbr/sbr_libmh_a-getans.obj: sbr/getans.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getans.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getans.Tpo -c -o sbr/sbr_libmh_a-getans.obj `if test -f 'sbr/getans.c'; then $(CYGPATH_W) 'sbr/getans.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getans.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getans.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getans.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getans.c' object='sbr/sbr_libmh_a-getans.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getans.obj `if test -f 'sbr/getans.c'; then $(CYGPATH_W) 'sbr/getans.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getans.c'; fi` sbr/sbr_libmh_a-getanswer.o: sbr/getanswer.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getanswer.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getanswer.Tpo -c -o sbr/sbr_libmh_a-getanswer.o `test -f 'sbr/getanswer.c' || echo '$(srcdir)/'`sbr/getanswer.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getanswer.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getanswer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getanswer.c' object='sbr/sbr_libmh_a-getanswer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getanswer.o `test -f 'sbr/getanswer.c' || echo '$(srcdir)/'`sbr/getanswer.c sbr/sbr_libmh_a-getanswer.obj: sbr/getanswer.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getanswer.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getanswer.Tpo -c -o sbr/sbr_libmh_a-getanswer.obj `if test -f 'sbr/getanswer.c'; then $(CYGPATH_W) 'sbr/getanswer.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getanswer.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getanswer.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getanswer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getanswer.c' object='sbr/sbr_libmh_a-getanswer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getanswer.obj `if test -f 'sbr/getanswer.c'; then $(CYGPATH_W) 'sbr/getanswer.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getanswer.c'; fi` sbr/sbr_libmh_a-getarguments.o: sbr/getarguments.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getarguments.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getarguments.Tpo -c -o sbr/sbr_libmh_a-getarguments.o `test -f 'sbr/getarguments.c' || echo '$(srcdir)/'`sbr/getarguments.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getarguments.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getarguments.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getarguments.c' object='sbr/sbr_libmh_a-getarguments.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getarguments.o `test -f 'sbr/getarguments.c' || echo '$(srcdir)/'`sbr/getarguments.c sbr/sbr_libmh_a-getarguments.obj: sbr/getarguments.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getarguments.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getarguments.Tpo -c -o sbr/sbr_libmh_a-getarguments.obj `if test -f 'sbr/getarguments.c'; then $(CYGPATH_W) 'sbr/getarguments.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getarguments.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getarguments.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getarguments.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getarguments.c' object='sbr/sbr_libmh_a-getarguments.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getarguments.obj `if test -f 'sbr/getarguments.c'; then $(CYGPATH_W) 'sbr/getarguments.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getarguments.c'; fi` sbr/sbr_libmh_a-getcpy.o: sbr/getcpy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getcpy.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getcpy.Tpo -c -o sbr/sbr_libmh_a-getcpy.o `test -f 'sbr/getcpy.c' || echo '$(srcdir)/'`sbr/getcpy.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getcpy.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getcpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getcpy.c' object='sbr/sbr_libmh_a-getcpy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getcpy.o `test -f 'sbr/getcpy.c' || echo '$(srcdir)/'`sbr/getcpy.c sbr/sbr_libmh_a-getcpy.obj: sbr/getcpy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getcpy.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getcpy.Tpo -c -o sbr/sbr_libmh_a-getcpy.obj `if test -f 'sbr/getcpy.c'; then $(CYGPATH_W) 'sbr/getcpy.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getcpy.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getcpy.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getcpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getcpy.c' object='sbr/sbr_libmh_a-getcpy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getcpy.obj `if test -f 'sbr/getcpy.c'; then $(CYGPATH_W) 'sbr/getcpy.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getcpy.c'; fi` sbr/sbr_libmh_a-getfolder.o: sbr/getfolder.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getfolder.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getfolder.Tpo -c -o sbr/sbr_libmh_a-getfolder.o `test -f 'sbr/getfolder.c' || echo '$(srcdir)/'`sbr/getfolder.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getfolder.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getfolder.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getfolder.c' object='sbr/sbr_libmh_a-getfolder.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getfolder.o `test -f 'sbr/getfolder.c' || echo '$(srcdir)/'`sbr/getfolder.c sbr/sbr_libmh_a-getfolder.obj: sbr/getfolder.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getfolder.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getfolder.Tpo -c -o sbr/sbr_libmh_a-getfolder.obj `if test -f 'sbr/getfolder.c'; then $(CYGPATH_W) 'sbr/getfolder.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getfolder.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getfolder.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getfolder.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getfolder.c' object='sbr/sbr_libmh_a-getfolder.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getfolder.obj `if test -f 'sbr/getfolder.c'; then $(CYGPATH_W) 'sbr/getfolder.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getfolder.c'; fi` sbr/sbr_libmh_a-getpass.o: sbr/getpass.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getpass.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getpass.Tpo -c -o sbr/sbr_libmh_a-getpass.o `test -f 'sbr/getpass.c' || echo '$(srcdir)/'`sbr/getpass.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getpass.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getpass.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getpass.c' object='sbr/sbr_libmh_a-getpass.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getpass.o `test -f 'sbr/getpass.c' || echo '$(srcdir)/'`sbr/getpass.c sbr/sbr_libmh_a-getpass.obj: sbr/getpass.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getpass.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getpass.Tpo -c -o sbr/sbr_libmh_a-getpass.obj `if test -f 'sbr/getpass.c'; then $(CYGPATH_W) 'sbr/getpass.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getpass.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getpass.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getpass.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getpass.c' object='sbr/sbr_libmh_a-getpass.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getpass.obj `if test -f 'sbr/getpass.c'; then $(CYGPATH_W) 'sbr/getpass.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getpass.c'; fi` sbr/sbr_libmh_a-fmt_addr.o: sbr/fmt_addr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_addr.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_addr.Tpo -c -o sbr/sbr_libmh_a-fmt_addr.o `test -f 'sbr/fmt_addr.c' || echo '$(srcdir)/'`sbr/fmt_addr.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_addr.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_addr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_addr.c' object='sbr/sbr_libmh_a-fmt_addr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_addr.o `test -f 'sbr/fmt_addr.c' || echo '$(srcdir)/'`sbr/fmt_addr.c sbr/sbr_libmh_a-fmt_addr.obj: sbr/fmt_addr.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_addr.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_addr.Tpo -c -o sbr/sbr_libmh_a-fmt_addr.obj `if test -f 'sbr/fmt_addr.c'; then $(CYGPATH_W) 'sbr/fmt_addr.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_addr.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_addr.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_addr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_addr.c' object='sbr/sbr_libmh_a-fmt_addr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_addr.obj `if test -f 'sbr/fmt_addr.c'; then $(CYGPATH_W) 'sbr/fmt_addr.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_addr.c'; fi` sbr/sbr_libmh_a-fmt_compile.o: sbr/fmt_compile.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_compile.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_compile.Tpo -c -o sbr/sbr_libmh_a-fmt_compile.o `test -f 'sbr/fmt_compile.c' || echo '$(srcdir)/'`sbr/fmt_compile.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_compile.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_compile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_compile.c' object='sbr/sbr_libmh_a-fmt_compile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_compile.o `test -f 'sbr/fmt_compile.c' || echo '$(srcdir)/'`sbr/fmt_compile.c sbr/sbr_libmh_a-fmt_compile.obj: sbr/fmt_compile.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_compile.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_compile.Tpo -c -o sbr/sbr_libmh_a-fmt_compile.obj `if test -f 'sbr/fmt_compile.c'; then $(CYGPATH_W) 'sbr/fmt_compile.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_compile.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_compile.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_compile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_compile.c' object='sbr/sbr_libmh_a-fmt_compile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_compile.obj `if test -f 'sbr/fmt_compile.c'; then $(CYGPATH_W) 'sbr/fmt_compile.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_compile.c'; fi` sbr/sbr_libmh_a-fmt_new.o: sbr/fmt_new.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_new.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_new.Tpo -c -o sbr/sbr_libmh_a-fmt_new.o `test -f 'sbr/fmt_new.c' || echo '$(srcdir)/'`sbr/fmt_new.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_new.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_new.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_new.c' object='sbr/sbr_libmh_a-fmt_new.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_new.o `test -f 'sbr/fmt_new.c' || echo '$(srcdir)/'`sbr/fmt_new.c sbr/sbr_libmh_a-fmt_new.obj: sbr/fmt_new.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_new.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_new.Tpo -c -o sbr/sbr_libmh_a-fmt_new.obj `if test -f 'sbr/fmt_new.c'; then $(CYGPATH_W) 'sbr/fmt_new.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_new.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_new.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_new.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_new.c' object='sbr/sbr_libmh_a-fmt_new.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_new.obj `if test -f 'sbr/fmt_new.c'; then $(CYGPATH_W) 'sbr/fmt_new.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_new.c'; fi` sbr/sbr_libmh_a-fmt_rfc2047.o: sbr/fmt_rfc2047.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_rfc2047.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_rfc2047.Tpo -c -o sbr/sbr_libmh_a-fmt_rfc2047.o `test -f 'sbr/fmt_rfc2047.c' || echo '$(srcdir)/'`sbr/fmt_rfc2047.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_rfc2047.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_rfc2047.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_rfc2047.c' object='sbr/sbr_libmh_a-fmt_rfc2047.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_rfc2047.o `test -f 'sbr/fmt_rfc2047.c' || echo '$(srcdir)/'`sbr/fmt_rfc2047.c sbr/sbr_libmh_a-fmt_rfc2047.obj: sbr/fmt_rfc2047.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_rfc2047.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_rfc2047.Tpo -c -o sbr/sbr_libmh_a-fmt_rfc2047.obj `if test -f 'sbr/fmt_rfc2047.c'; then $(CYGPATH_W) 'sbr/fmt_rfc2047.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_rfc2047.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_rfc2047.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_rfc2047.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_rfc2047.c' object='sbr/sbr_libmh_a-fmt_rfc2047.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_rfc2047.obj `if test -f 'sbr/fmt_rfc2047.c'; then $(CYGPATH_W) 'sbr/fmt_rfc2047.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_rfc2047.c'; fi` sbr/sbr_libmh_a-fmt_scan.o: sbr/fmt_scan.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_scan.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_scan.Tpo -c -o sbr/sbr_libmh_a-fmt_scan.o `test -f 'sbr/fmt_scan.c' || echo '$(srcdir)/'`sbr/fmt_scan.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_scan.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_scan.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_scan.c' object='sbr/sbr_libmh_a-fmt_scan.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_scan.o `test -f 'sbr/fmt_scan.c' || echo '$(srcdir)/'`sbr/fmt_scan.c sbr/sbr_libmh_a-fmt_scan.obj: sbr/fmt_scan.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_scan.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_scan.Tpo -c -o sbr/sbr_libmh_a-fmt_scan.obj `if test -f 'sbr/fmt_scan.c'; then $(CYGPATH_W) 'sbr/fmt_scan.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_scan.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_scan.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_scan.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_scan.c' object='sbr/sbr_libmh_a-fmt_scan.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_scan.obj `if test -f 'sbr/fmt_scan.c'; then $(CYGPATH_W) 'sbr/fmt_scan.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_scan.c'; fi` sbr/sbr_libmh_a-lock_file.o: sbr/lock_file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-lock_file.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-lock_file.Tpo -c -o sbr/sbr_libmh_a-lock_file.o `test -f 'sbr/lock_file.c' || echo '$(srcdir)/'`sbr/lock_file.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-lock_file.Tpo sbr/$(DEPDIR)/sbr_libmh_a-lock_file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/lock_file.c' object='sbr/sbr_libmh_a-lock_file.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-lock_file.o `test -f 'sbr/lock_file.c' || echo '$(srcdir)/'`sbr/lock_file.c sbr/sbr_libmh_a-lock_file.obj: sbr/lock_file.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-lock_file.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-lock_file.Tpo -c -o sbr/sbr_libmh_a-lock_file.obj `if test -f 'sbr/lock_file.c'; then $(CYGPATH_W) 'sbr/lock_file.c'; else $(CYGPATH_W) '$(srcdir)/sbr/lock_file.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-lock_file.Tpo sbr/$(DEPDIR)/sbr_libmh_a-lock_file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/lock_file.c' object='sbr/sbr_libmh_a-lock_file.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-lock_file.obj `if test -f 'sbr/lock_file.c'; then $(CYGPATH_W) 'sbr/lock_file.c'; else $(CYGPATH_W) '$(srcdir)/sbr/lock_file.c'; fi` sbr/sbr_libmh_a-m_atoi.o: sbr/m_atoi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_atoi.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_atoi.Tpo -c -o sbr/sbr_libmh_a-m_atoi.o `test -f 'sbr/m_atoi.c' || echo '$(srcdir)/'`sbr/m_atoi.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_atoi.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_atoi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_atoi.c' object='sbr/sbr_libmh_a-m_atoi.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_atoi.o `test -f 'sbr/m_atoi.c' || echo '$(srcdir)/'`sbr/m_atoi.c sbr/sbr_libmh_a-m_atoi.obj: sbr/m_atoi.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_atoi.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_atoi.Tpo -c -o sbr/sbr_libmh_a-m_atoi.obj `if test -f 'sbr/m_atoi.c'; then $(CYGPATH_W) 'sbr/m_atoi.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_atoi.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_atoi.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_atoi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_atoi.c' object='sbr/sbr_libmh_a-m_atoi.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_atoi.obj `if test -f 'sbr/m_atoi.c'; then $(CYGPATH_W) 'sbr/m_atoi.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_atoi.c'; fi` sbr/sbr_libmh_a-m_backup.o: sbr/m_backup.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_backup.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_backup.Tpo -c -o sbr/sbr_libmh_a-m_backup.o `test -f 'sbr/m_backup.c' || echo '$(srcdir)/'`sbr/m_backup.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_backup.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_backup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_backup.c' object='sbr/sbr_libmh_a-m_backup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_backup.o `test -f 'sbr/m_backup.c' || echo '$(srcdir)/'`sbr/m_backup.c sbr/sbr_libmh_a-m_backup.obj: sbr/m_backup.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_backup.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_backup.Tpo -c -o sbr/sbr_libmh_a-m_backup.obj `if test -f 'sbr/m_backup.c'; then $(CYGPATH_W) 'sbr/m_backup.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_backup.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_backup.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_backup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_backup.c' object='sbr/sbr_libmh_a-m_backup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_backup.obj `if test -f 'sbr/m_backup.c'; then $(CYGPATH_W) 'sbr/m_backup.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_backup.c'; fi` sbr/sbr_libmh_a-m_convert.o: sbr/m_convert.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_convert.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_convert.Tpo -c -o sbr/sbr_libmh_a-m_convert.o `test -f 'sbr/m_convert.c' || echo '$(srcdir)/'`sbr/m_convert.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_convert.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_convert.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_convert.c' object='sbr/sbr_libmh_a-m_convert.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_convert.o `test -f 'sbr/m_convert.c' || echo '$(srcdir)/'`sbr/m_convert.c sbr/sbr_libmh_a-m_convert.obj: sbr/m_convert.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_convert.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_convert.Tpo -c -o sbr/sbr_libmh_a-m_convert.obj `if test -f 'sbr/m_convert.c'; then $(CYGPATH_W) 'sbr/m_convert.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_convert.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_convert.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_convert.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_convert.c' object='sbr/sbr_libmh_a-m_convert.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_convert.obj `if test -f 'sbr/m_convert.c'; then $(CYGPATH_W) 'sbr/m_convert.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_convert.c'; fi` sbr/sbr_libmh_a-m_draft.o: sbr/m_draft.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_draft.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_draft.Tpo -c -o sbr/sbr_libmh_a-m_draft.o `test -f 'sbr/m_draft.c' || echo '$(srcdir)/'`sbr/m_draft.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_draft.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_draft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_draft.c' object='sbr/sbr_libmh_a-m_draft.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_draft.o `test -f 'sbr/m_draft.c' || echo '$(srcdir)/'`sbr/m_draft.c sbr/sbr_libmh_a-m_draft.obj: sbr/m_draft.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_draft.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_draft.Tpo -c -o sbr/sbr_libmh_a-m_draft.obj `if test -f 'sbr/m_draft.c'; then $(CYGPATH_W) 'sbr/m_draft.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_draft.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_draft.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_draft.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_draft.c' object='sbr/sbr_libmh_a-m_draft.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_draft.obj `if test -f 'sbr/m_draft.c'; then $(CYGPATH_W) 'sbr/m_draft.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_draft.c'; fi` sbr/sbr_libmh_a-m_getfld.o: sbr/m_getfld.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_getfld.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_getfld.Tpo -c -o sbr/sbr_libmh_a-m_getfld.o `test -f 'sbr/m_getfld.c' || echo '$(srcdir)/'`sbr/m_getfld.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_getfld.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_getfld.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_getfld.c' object='sbr/sbr_libmh_a-m_getfld.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_getfld.o `test -f 'sbr/m_getfld.c' || echo '$(srcdir)/'`sbr/m_getfld.c sbr/sbr_libmh_a-m_getfld.obj: sbr/m_getfld.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_getfld.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_getfld.Tpo -c -o sbr/sbr_libmh_a-m_getfld.obj `if test -f 'sbr/m_getfld.c'; then $(CYGPATH_W) 'sbr/m_getfld.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_getfld.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_getfld.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_getfld.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_getfld.c' object='sbr/sbr_libmh_a-m_getfld.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_getfld.obj `if test -f 'sbr/m_getfld.c'; then $(CYGPATH_W) 'sbr/m_getfld.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_getfld.c'; fi` sbr/sbr_libmh_a-m_gmprot.o: sbr/m_gmprot.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_gmprot.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_gmprot.Tpo -c -o sbr/sbr_libmh_a-m_gmprot.o `test -f 'sbr/m_gmprot.c' || echo '$(srcdir)/'`sbr/m_gmprot.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_gmprot.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_gmprot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_gmprot.c' object='sbr/sbr_libmh_a-m_gmprot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_gmprot.o `test -f 'sbr/m_gmprot.c' || echo '$(srcdir)/'`sbr/m_gmprot.c sbr/sbr_libmh_a-m_gmprot.obj: sbr/m_gmprot.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_gmprot.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_gmprot.Tpo -c -o sbr/sbr_libmh_a-m_gmprot.obj `if test -f 'sbr/m_gmprot.c'; then $(CYGPATH_W) 'sbr/m_gmprot.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_gmprot.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_gmprot.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_gmprot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_gmprot.c' object='sbr/sbr_libmh_a-m_gmprot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_gmprot.obj `if test -f 'sbr/m_gmprot.c'; then $(CYGPATH_W) 'sbr/m_gmprot.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_gmprot.c'; fi` sbr/sbr_libmh_a-m_maildir.o: sbr/m_maildir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_maildir.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_maildir.Tpo -c -o sbr/sbr_libmh_a-m_maildir.o `test -f 'sbr/m_maildir.c' || echo '$(srcdir)/'`sbr/m_maildir.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_maildir.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_maildir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_maildir.c' object='sbr/sbr_libmh_a-m_maildir.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_maildir.o `test -f 'sbr/m_maildir.c' || echo '$(srcdir)/'`sbr/m_maildir.c sbr/sbr_libmh_a-m_maildir.obj: sbr/m_maildir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_maildir.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_maildir.Tpo -c -o sbr/sbr_libmh_a-m_maildir.obj `if test -f 'sbr/m_maildir.c'; then $(CYGPATH_W) 'sbr/m_maildir.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_maildir.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_maildir.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_maildir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_maildir.c' object='sbr/sbr_libmh_a-m_maildir.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_maildir.obj `if test -f 'sbr/m_maildir.c'; then $(CYGPATH_W) 'sbr/m_maildir.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_maildir.c'; fi` sbr/sbr_libmh_a-m_name.o: sbr/m_name.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_name.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_name.Tpo -c -o sbr/sbr_libmh_a-m_name.o `test -f 'sbr/m_name.c' || echo '$(srcdir)/'`sbr/m_name.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_name.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_name.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_name.c' object='sbr/sbr_libmh_a-m_name.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_name.o `test -f 'sbr/m_name.c' || echo '$(srcdir)/'`sbr/m_name.c sbr/sbr_libmh_a-m_name.obj: sbr/m_name.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_name.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_name.Tpo -c -o sbr/sbr_libmh_a-m_name.obj `if test -f 'sbr/m_name.c'; then $(CYGPATH_W) 'sbr/m_name.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_name.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_name.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_name.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_name.c' object='sbr/sbr_libmh_a-m_name.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_name.obj `if test -f 'sbr/m_name.c'; then $(CYGPATH_W) 'sbr/m_name.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_name.c'; fi` sbr/sbr_libmh_a-makedir.o: sbr/makedir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-makedir.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-makedir.Tpo -c -o sbr/sbr_libmh_a-makedir.o `test -f 'sbr/makedir.c' || echo '$(srcdir)/'`sbr/makedir.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-makedir.Tpo sbr/$(DEPDIR)/sbr_libmh_a-makedir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/makedir.c' object='sbr/sbr_libmh_a-makedir.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-makedir.o `test -f 'sbr/makedir.c' || echo '$(srcdir)/'`sbr/makedir.c sbr/sbr_libmh_a-makedir.obj: sbr/makedir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-makedir.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-makedir.Tpo -c -o sbr/sbr_libmh_a-makedir.obj `if test -f 'sbr/makedir.c'; then $(CYGPATH_W) 'sbr/makedir.c'; else $(CYGPATH_W) '$(srcdir)/sbr/makedir.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-makedir.Tpo sbr/$(DEPDIR)/sbr_libmh_a-makedir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/makedir.c' object='sbr/sbr_libmh_a-makedir.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-makedir.obj `if test -f 'sbr/makedir.c'; then $(CYGPATH_W) 'sbr/makedir.c'; else $(CYGPATH_W) '$(srcdir)/sbr/makedir.c'; fi` sbr/sbr_libmh_a-mts.o: sbr/mts.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-mts.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-mts.Tpo -c -o sbr/sbr_libmh_a-mts.o `test -f 'sbr/mts.c' || echo '$(srcdir)/'`sbr/mts.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-mts.Tpo sbr/$(DEPDIR)/sbr_libmh_a-mts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/mts.c' object='sbr/sbr_libmh_a-mts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-mts.o `test -f 'sbr/mts.c' || echo '$(srcdir)/'`sbr/mts.c sbr/sbr_libmh_a-mts.obj: sbr/mts.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-mts.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-mts.Tpo -c -o sbr/sbr_libmh_a-mts.obj `if test -f 'sbr/mts.c'; then $(CYGPATH_W) 'sbr/mts.c'; else $(CYGPATH_W) '$(srcdir)/sbr/mts.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-mts.Tpo sbr/$(DEPDIR)/sbr_libmh_a-mts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/mts.c' object='sbr/sbr_libmh_a-mts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-mts.obj `if test -f 'sbr/mts.c'; then $(CYGPATH_W) 'sbr/mts.c'; else $(CYGPATH_W) '$(srcdir)/sbr/mts.c'; fi` sbr/sbr_libmh_a-norm_charmap.o: sbr/norm_charmap.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-norm_charmap.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-norm_charmap.Tpo -c -o sbr/sbr_libmh_a-norm_charmap.o `test -f 'sbr/norm_charmap.c' || echo '$(srcdir)/'`sbr/norm_charmap.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-norm_charmap.Tpo sbr/$(DEPDIR)/sbr_libmh_a-norm_charmap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/norm_charmap.c' object='sbr/sbr_libmh_a-norm_charmap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-norm_charmap.o `test -f 'sbr/norm_charmap.c' || echo '$(srcdir)/'`sbr/norm_charmap.c sbr/sbr_libmh_a-norm_charmap.obj: sbr/norm_charmap.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-norm_charmap.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-norm_charmap.Tpo -c -o sbr/sbr_libmh_a-norm_charmap.obj `if test -f 'sbr/norm_charmap.c'; then $(CYGPATH_W) 'sbr/norm_charmap.c'; else $(CYGPATH_W) '$(srcdir)/sbr/norm_charmap.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-norm_charmap.Tpo sbr/$(DEPDIR)/sbr_libmh_a-norm_charmap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/norm_charmap.c' object='sbr/sbr_libmh_a-norm_charmap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-norm_charmap.obj `if test -f 'sbr/norm_charmap.c'; then $(CYGPATH_W) 'sbr/norm_charmap.c'; else $(CYGPATH_W) '$(srcdir)/sbr/norm_charmap.c'; fi` sbr/sbr_libmh_a-path.o: sbr/path.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-path.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-path.Tpo -c -o sbr/sbr_libmh_a-path.o `test -f 'sbr/path.c' || echo '$(srcdir)/'`sbr/path.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-path.Tpo sbr/$(DEPDIR)/sbr_libmh_a-path.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/path.c' object='sbr/sbr_libmh_a-path.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-path.o `test -f 'sbr/path.c' || echo '$(srcdir)/'`sbr/path.c sbr/sbr_libmh_a-path.obj: sbr/path.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-path.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-path.Tpo -c -o sbr/sbr_libmh_a-path.obj `if test -f 'sbr/path.c'; then $(CYGPATH_W) 'sbr/path.c'; else $(CYGPATH_W) '$(srcdir)/sbr/path.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-path.Tpo sbr/$(DEPDIR)/sbr_libmh_a-path.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/path.c' object='sbr/sbr_libmh_a-path.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-path.obj `if test -f 'sbr/path.c'; then $(CYGPATH_W) 'sbr/path.c'; else $(CYGPATH_W) '$(srcdir)/sbr/path.c'; fi` sbr/sbr_libmh_a-peekc.o: sbr/peekc.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-peekc.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-peekc.Tpo -c -o sbr/sbr_libmh_a-peekc.o `test -f 'sbr/peekc.c' || echo '$(srcdir)/'`sbr/peekc.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-peekc.Tpo sbr/$(DEPDIR)/sbr_libmh_a-peekc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/peekc.c' object='sbr/sbr_libmh_a-peekc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-peekc.o `test -f 'sbr/peekc.c' || echo '$(srcdir)/'`sbr/peekc.c sbr/sbr_libmh_a-peekc.obj: sbr/peekc.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-peekc.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-peekc.Tpo -c -o sbr/sbr_libmh_a-peekc.obj `if test -f 'sbr/peekc.c'; then $(CYGPATH_W) 'sbr/peekc.c'; else $(CYGPATH_W) '$(srcdir)/sbr/peekc.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-peekc.Tpo sbr/$(DEPDIR)/sbr_libmh_a-peekc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/peekc.c' object='sbr/sbr_libmh_a-peekc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-peekc.obj `if test -f 'sbr/peekc.c'; then $(CYGPATH_W) 'sbr/peekc.c'; else $(CYGPATH_W) '$(srcdir)/sbr/peekc.c'; fi` sbr/sbr_libmh_a-pidwait.o: sbr/pidwait.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-pidwait.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-pidwait.Tpo -c -o sbr/sbr_libmh_a-pidwait.o `test -f 'sbr/pidwait.c' || echo '$(srcdir)/'`sbr/pidwait.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-pidwait.Tpo sbr/$(DEPDIR)/sbr_libmh_a-pidwait.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/pidwait.c' object='sbr/sbr_libmh_a-pidwait.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-pidwait.o `test -f 'sbr/pidwait.c' || echo '$(srcdir)/'`sbr/pidwait.c sbr/sbr_libmh_a-pidwait.obj: sbr/pidwait.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-pidwait.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-pidwait.Tpo -c -o sbr/sbr_libmh_a-pidwait.obj `if test -f 'sbr/pidwait.c'; then $(CYGPATH_W) 'sbr/pidwait.c'; else $(CYGPATH_W) '$(srcdir)/sbr/pidwait.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-pidwait.Tpo sbr/$(DEPDIR)/sbr_libmh_a-pidwait.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/pidwait.c' object='sbr/sbr_libmh_a-pidwait.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-pidwait.obj `if test -f 'sbr/pidwait.c'; then $(CYGPATH_W) 'sbr/pidwait.c'; else $(CYGPATH_W) '$(srcdir)/sbr/pidwait.c'; fi` sbr/sbr_libmh_a-pidstatus.o: sbr/pidstatus.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-pidstatus.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-pidstatus.Tpo -c -o sbr/sbr_libmh_a-pidstatus.o `test -f 'sbr/pidstatus.c' || echo '$(srcdir)/'`sbr/pidstatus.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-pidstatus.Tpo sbr/$(DEPDIR)/sbr_libmh_a-pidstatus.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/pidstatus.c' object='sbr/sbr_libmh_a-pidstatus.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-pidstatus.o `test -f 'sbr/pidstatus.c' || echo '$(srcdir)/'`sbr/pidstatus.c sbr/sbr_libmh_a-pidstatus.obj: sbr/pidstatus.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-pidstatus.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-pidstatus.Tpo -c -o sbr/sbr_libmh_a-pidstatus.obj `if test -f 'sbr/pidstatus.c'; then $(CYGPATH_W) 'sbr/pidstatus.c'; else $(CYGPATH_W) '$(srcdir)/sbr/pidstatus.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-pidstatus.Tpo sbr/$(DEPDIR)/sbr_libmh_a-pidstatus.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/pidstatus.c' object='sbr/sbr_libmh_a-pidstatus.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-pidstatus.obj `if test -f 'sbr/pidstatus.c'; then $(CYGPATH_W) 'sbr/pidstatus.c'; else $(CYGPATH_W) '$(srcdir)/sbr/pidstatus.c'; fi` sbr/sbr_libmh_a-print_help.o: sbr/print_help.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-print_help.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-print_help.Tpo -c -o sbr/sbr_libmh_a-print_help.o `test -f 'sbr/print_help.c' || echo '$(srcdir)/'`sbr/print_help.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-print_help.Tpo sbr/$(DEPDIR)/sbr_libmh_a-print_help.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/print_help.c' object='sbr/sbr_libmh_a-print_help.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-print_help.o `test -f 'sbr/print_help.c' || echo '$(srcdir)/'`sbr/print_help.c sbr/sbr_libmh_a-print_help.obj: sbr/print_help.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-print_help.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-print_help.Tpo -c -o sbr/sbr_libmh_a-print_help.obj `if test -f 'sbr/print_help.c'; then $(CYGPATH_W) 'sbr/print_help.c'; else $(CYGPATH_W) '$(srcdir)/sbr/print_help.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-print_help.Tpo sbr/$(DEPDIR)/sbr_libmh_a-print_help.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/print_help.c' object='sbr/sbr_libmh_a-print_help.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-print_help.obj `if test -f 'sbr/print_help.c'; then $(CYGPATH_W) 'sbr/print_help.c'; else $(CYGPATH_W) '$(srcdir)/sbr/print_help.c'; fi` sbr/sbr_libmh_a-print_sw.o: sbr/print_sw.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-print_sw.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-print_sw.Tpo -c -o sbr/sbr_libmh_a-print_sw.o `test -f 'sbr/print_sw.c' || echo '$(srcdir)/'`sbr/print_sw.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-print_sw.Tpo sbr/$(DEPDIR)/sbr_libmh_a-print_sw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/print_sw.c' object='sbr/sbr_libmh_a-print_sw.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-print_sw.o `test -f 'sbr/print_sw.c' || echo '$(srcdir)/'`sbr/print_sw.c sbr/sbr_libmh_a-print_sw.obj: sbr/print_sw.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-print_sw.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-print_sw.Tpo -c -o sbr/sbr_libmh_a-print_sw.obj `if test -f 'sbr/print_sw.c'; then $(CYGPATH_W) 'sbr/print_sw.c'; else $(CYGPATH_W) '$(srcdir)/sbr/print_sw.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-print_sw.Tpo sbr/$(DEPDIR)/sbr_libmh_a-print_sw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/print_sw.c' object='sbr/sbr_libmh_a-print_sw.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-print_sw.obj `if test -f 'sbr/print_sw.c'; then $(CYGPATH_W) 'sbr/print_sw.c'; else $(CYGPATH_W) '$(srcdir)/sbr/print_sw.c'; fi` sbr/sbr_libmh_a-print_version.o: sbr/print_version.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-print_version.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-print_version.Tpo -c -o sbr/sbr_libmh_a-print_version.o `test -f 'sbr/print_version.c' || echo '$(srcdir)/'`sbr/print_version.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-print_version.Tpo sbr/$(DEPDIR)/sbr_libmh_a-print_version.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/print_version.c' object='sbr/sbr_libmh_a-print_version.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-print_version.o `test -f 'sbr/print_version.c' || echo '$(srcdir)/'`sbr/print_version.c sbr/sbr_libmh_a-print_version.obj: sbr/print_version.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-print_version.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-print_version.Tpo -c -o sbr/sbr_libmh_a-print_version.obj `if test -f 'sbr/print_version.c'; then $(CYGPATH_W) 'sbr/print_version.c'; else $(CYGPATH_W) '$(srcdir)/sbr/print_version.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-print_version.Tpo sbr/$(DEPDIR)/sbr_libmh_a-print_version.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/print_version.c' object='sbr/sbr_libmh_a-print_version.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-print_version.obj `if test -f 'sbr/print_version.c'; then $(CYGPATH_W) 'sbr/print_version.c'; else $(CYGPATH_W) '$(srcdir)/sbr/print_version.c'; fi` sbr/sbr_libmh_a-push.o: sbr/push.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-push.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-push.Tpo -c -o sbr/sbr_libmh_a-push.o `test -f 'sbr/push.c' || echo '$(srcdir)/'`sbr/push.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-push.Tpo sbr/$(DEPDIR)/sbr_libmh_a-push.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/push.c' object='sbr/sbr_libmh_a-push.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-push.o `test -f 'sbr/push.c' || echo '$(srcdir)/'`sbr/push.c sbr/sbr_libmh_a-push.obj: sbr/push.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-push.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-push.Tpo -c -o sbr/sbr_libmh_a-push.obj `if test -f 'sbr/push.c'; then $(CYGPATH_W) 'sbr/push.c'; else $(CYGPATH_W) '$(srcdir)/sbr/push.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-push.Tpo sbr/$(DEPDIR)/sbr_libmh_a-push.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/push.c' object='sbr/sbr_libmh_a-push.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-push.obj `if test -f 'sbr/push.c'; then $(CYGPATH_W) 'sbr/push.c'; else $(CYGPATH_W) '$(srcdir)/sbr/push.c'; fi` sbr/sbr_libmh_a-putenv.o: sbr/putenv.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-putenv.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-putenv.Tpo -c -o sbr/sbr_libmh_a-putenv.o `test -f 'sbr/putenv.c' || echo '$(srcdir)/'`sbr/putenv.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-putenv.Tpo sbr/$(DEPDIR)/sbr_libmh_a-putenv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/putenv.c' object='sbr/sbr_libmh_a-putenv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-putenv.o `test -f 'sbr/putenv.c' || echo '$(srcdir)/'`sbr/putenv.c sbr/sbr_libmh_a-putenv.obj: sbr/putenv.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-putenv.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-putenv.Tpo -c -o sbr/sbr_libmh_a-putenv.obj `if test -f 'sbr/putenv.c'; then $(CYGPATH_W) 'sbr/putenv.c'; else $(CYGPATH_W) '$(srcdir)/sbr/putenv.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-putenv.Tpo sbr/$(DEPDIR)/sbr_libmh_a-putenv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/putenv.c' object='sbr/sbr_libmh_a-putenv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-putenv.obj `if test -f 'sbr/putenv.c'; then $(CYGPATH_W) 'sbr/putenv.c'; else $(CYGPATH_W) '$(srcdir)/sbr/putenv.c'; fi` sbr/sbr_libmh_a-refile.o: sbr/refile.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-refile.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-refile.Tpo -c -o sbr/sbr_libmh_a-refile.o `test -f 'sbr/refile.c' || echo '$(srcdir)/'`sbr/refile.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-refile.Tpo sbr/$(DEPDIR)/sbr_libmh_a-refile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/refile.c' object='sbr/sbr_libmh_a-refile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-refile.o `test -f 'sbr/refile.c' || echo '$(srcdir)/'`sbr/refile.c sbr/sbr_libmh_a-refile.obj: sbr/refile.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-refile.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-refile.Tpo -c -o sbr/sbr_libmh_a-refile.obj `if test -f 'sbr/refile.c'; then $(CYGPATH_W) 'sbr/refile.c'; else $(CYGPATH_W) '$(srcdir)/sbr/refile.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-refile.Tpo sbr/$(DEPDIR)/sbr_libmh_a-refile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/refile.c' object='sbr/sbr_libmh_a-refile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-refile.obj `if test -f 'sbr/refile.c'; then $(CYGPATH_W) 'sbr/refile.c'; else $(CYGPATH_W) '$(srcdir)/sbr/refile.c'; fi` sbr/sbr_libmh_a-remdir.o: sbr/remdir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-remdir.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-remdir.Tpo -c -o sbr/sbr_libmh_a-remdir.o `test -f 'sbr/remdir.c' || echo '$(srcdir)/'`sbr/remdir.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-remdir.Tpo sbr/$(DEPDIR)/sbr_libmh_a-remdir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/remdir.c' object='sbr/sbr_libmh_a-remdir.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-remdir.o `test -f 'sbr/remdir.c' || echo '$(srcdir)/'`sbr/remdir.c sbr/sbr_libmh_a-remdir.obj: sbr/remdir.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-remdir.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-remdir.Tpo -c -o sbr/sbr_libmh_a-remdir.obj `if test -f 'sbr/remdir.c'; then $(CYGPATH_W) 'sbr/remdir.c'; else $(CYGPATH_W) '$(srcdir)/sbr/remdir.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-remdir.Tpo sbr/$(DEPDIR)/sbr_libmh_a-remdir.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/remdir.c' object='sbr/sbr_libmh_a-remdir.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-remdir.obj `if test -f 'sbr/remdir.c'; then $(CYGPATH_W) 'sbr/remdir.c'; else $(CYGPATH_W) '$(srcdir)/sbr/remdir.c'; fi` sbr/sbr_libmh_a-r1bindex.o: sbr/r1bindex.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-r1bindex.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-r1bindex.Tpo -c -o sbr/sbr_libmh_a-r1bindex.o `test -f 'sbr/r1bindex.c' || echo '$(srcdir)/'`sbr/r1bindex.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-r1bindex.Tpo sbr/$(DEPDIR)/sbr_libmh_a-r1bindex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/r1bindex.c' object='sbr/sbr_libmh_a-r1bindex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-r1bindex.o `test -f 'sbr/r1bindex.c' || echo '$(srcdir)/'`sbr/r1bindex.c sbr/sbr_libmh_a-r1bindex.obj: sbr/r1bindex.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-r1bindex.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-r1bindex.Tpo -c -o sbr/sbr_libmh_a-r1bindex.obj `if test -f 'sbr/r1bindex.c'; then $(CYGPATH_W) 'sbr/r1bindex.c'; else $(CYGPATH_W) '$(srcdir)/sbr/r1bindex.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-r1bindex.Tpo sbr/$(DEPDIR)/sbr_libmh_a-r1bindex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/r1bindex.c' object='sbr/sbr_libmh_a-r1bindex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-r1bindex.obj `if test -f 'sbr/r1bindex.c'; then $(CYGPATH_W) 'sbr/r1bindex.c'; else $(CYGPATH_W) '$(srcdir)/sbr/r1bindex.c'; fi` sbr/sbr_libmh_a-readconfig.o: sbr/readconfig.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-readconfig.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-readconfig.Tpo -c -o sbr/sbr_libmh_a-readconfig.o `test -f 'sbr/readconfig.c' || echo '$(srcdir)/'`sbr/readconfig.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-readconfig.Tpo sbr/$(DEPDIR)/sbr_libmh_a-readconfig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/readconfig.c' object='sbr/sbr_libmh_a-readconfig.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-readconfig.o `test -f 'sbr/readconfig.c' || echo '$(srcdir)/'`sbr/readconfig.c sbr/sbr_libmh_a-readconfig.obj: sbr/readconfig.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-readconfig.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-readconfig.Tpo -c -o sbr/sbr_libmh_a-readconfig.obj `if test -f 'sbr/readconfig.c'; then $(CYGPATH_W) 'sbr/readconfig.c'; else $(CYGPATH_W) '$(srcdir)/sbr/readconfig.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-readconfig.Tpo sbr/$(DEPDIR)/sbr_libmh_a-readconfig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/readconfig.c' object='sbr/sbr_libmh_a-readconfig.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-readconfig.obj `if test -f 'sbr/readconfig.c'; then $(CYGPATH_W) 'sbr/readconfig.c'; else $(CYGPATH_W) '$(srcdir)/sbr/readconfig.c'; fi` sbr/sbr_libmh_a-ruserpass.o: sbr/ruserpass.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-ruserpass.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-ruserpass.Tpo -c -o sbr/sbr_libmh_a-ruserpass.o `test -f 'sbr/ruserpass.c' || echo '$(srcdir)/'`sbr/ruserpass.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-ruserpass.Tpo sbr/$(DEPDIR)/sbr_libmh_a-ruserpass.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/ruserpass.c' object='sbr/sbr_libmh_a-ruserpass.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-ruserpass.o `test -f 'sbr/ruserpass.c' || echo '$(srcdir)/'`sbr/ruserpass.c sbr/sbr_libmh_a-ruserpass.obj: sbr/ruserpass.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-ruserpass.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-ruserpass.Tpo -c -o sbr/sbr_libmh_a-ruserpass.obj `if test -f 'sbr/ruserpass.c'; then $(CYGPATH_W) 'sbr/ruserpass.c'; else $(CYGPATH_W) '$(srcdir)/sbr/ruserpass.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-ruserpass.Tpo sbr/$(DEPDIR)/sbr_libmh_a-ruserpass.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/ruserpass.c' object='sbr/sbr_libmh_a-ruserpass.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-ruserpass.obj `if test -f 'sbr/ruserpass.c'; then $(CYGPATH_W) 'sbr/ruserpass.c'; else $(CYGPATH_W) '$(srcdir)/sbr/ruserpass.c'; fi` sbr/sbr_libmh_a-seq_add.o: sbr/seq_add.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_add.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_add.Tpo -c -o sbr/sbr_libmh_a-seq_add.o `test -f 'sbr/seq_add.c' || echo '$(srcdir)/'`sbr/seq_add.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_add.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_add.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_add.c' object='sbr/sbr_libmh_a-seq_add.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_add.o `test -f 'sbr/seq_add.c' || echo '$(srcdir)/'`sbr/seq_add.c sbr/sbr_libmh_a-seq_add.obj: sbr/seq_add.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_add.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_add.Tpo -c -o sbr/sbr_libmh_a-seq_add.obj `if test -f 'sbr/seq_add.c'; then $(CYGPATH_W) 'sbr/seq_add.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_add.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_add.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_add.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_add.c' object='sbr/sbr_libmh_a-seq_add.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_add.obj `if test -f 'sbr/seq_add.c'; then $(CYGPATH_W) 'sbr/seq_add.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_add.c'; fi` sbr/sbr_libmh_a-seq_bits.o: sbr/seq_bits.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_bits.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_bits.Tpo -c -o sbr/sbr_libmh_a-seq_bits.o `test -f 'sbr/seq_bits.c' || echo '$(srcdir)/'`sbr/seq_bits.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_bits.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_bits.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_bits.c' object='sbr/sbr_libmh_a-seq_bits.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_bits.o `test -f 'sbr/seq_bits.c' || echo '$(srcdir)/'`sbr/seq_bits.c sbr/sbr_libmh_a-seq_bits.obj: sbr/seq_bits.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_bits.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_bits.Tpo -c -o sbr/sbr_libmh_a-seq_bits.obj `if test -f 'sbr/seq_bits.c'; then $(CYGPATH_W) 'sbr/seq_bits.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_bits.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_bits.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_bits.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_bits.c' object='sbr/sbr_libmh_a-seq_bits.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_bits.obj `if test -f 'sbr/seq_bits.c'; then $(CYGPATH_W) 'sbr/seq_bits.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_bits.c'; fi` sbr/sbr_libmh_a-seq_del.o: sbr/seq_del.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_del.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_del.Tpo -c -o sbr/sbr_libmh_a-seq_del.o `test -f 'sbr/seq_del.c' || echo '$(srcdir)/'`sbr/seq_del.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_del.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_del.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_del.c' object='sbr/sbr_libmh_a-seq_del.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_del.o `test -f 'sbr/seq_del.c' || echo '$(srcdir)/'`sbr/seq_del.c sbr/sbr_libmh_a-seq_del.obj: sbr/seq_del.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_del.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_del.Tpo -c -o sbr/sbr_libmh_a-seq_del.obj `if test -f 'sbr/seq_del.c'; then $(CYGPATH_W) 'sbr/seq_del.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_del.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_del.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_del.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_del.c' object='sbr/sbr_libmh_a-seq_del.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_del.obj `if test -f 'sbr/seq_del.c'; then $(CYGPATH_W) 'sbr/seq_del.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_del.c'; fi` sbr/sbr_libmh_a-seq_getnum.o: sbr/seq_getnum.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_getnum.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_getnum.Tpo -c -o sbr/sbr_libmh_a-seq_getnum.o `test -f 'sbr/seq_getnum.c' || echo '$(srcdir)/'`sbr/seq_getnum.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_getnum.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_getnum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_getnum.c' object='sbr/sbr_libmh_a-seq_getnum.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_getnum.o `test -f 'sbr/seq_getnum.c' || echo '$(srcdir)/'`sbr/seq_getnum.c sbr/sbr_libmh_a-seq_getnum.obj: sbr/seq_getnum.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_getnum.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_getnum.Tpo -c -o sbr/sbr_libmh_a-seq_getnum.obj `if test -f 'sbr/seq_getnum.c'; then $(CYGPATH_W) 'sbr/seq_getnum.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_getnum.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_getnum.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_getnum.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_getnum.c' object='sbr/sbr_libmh_a-seq_getnum.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_getnum.obj `if test -f 'sbr/seq_getnum.c'; then $(CYGPATH_W) 'sbr/seq_getnum.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_getnum.c'; fi` sbr/sbr_libmh_a-seq_list.o: sbr/seq_list.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_list.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_list.Tpo -c -o sbr/sbr_libmh_a-seq_list.o `test -f 'sbr/seq_list.c' || echo '$(srcdir)/'`sbr/seq_list.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_list.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_list.c' object='sbr/sbr_libmh_a-seq_list.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_list.o `test -f 'sbr/seq_list.c' || echo '$(srcdir)/'`sbr/seq_list.c sbr/sbr_libmh_a-seq_list.obj: sbr/seq_list.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_list.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_list.Tpo -c -o sbr/sbr_libmh_a-seq_list.obj `if test -f 'sbr/seq_list.c'; then $(CYGPATH_W) 'sbr/seq_list.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_list.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_list.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_list.c' object='sbr/sbr_libmh_a-seq_list.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_list.obj `if test -f 'sbr/seq_list.c'; then $(CYGPATH_W) 'sbr/seq_list.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_list.c'; fi` sbr/sbr_libmh_a-seq_nameok.o: sbr/seq_nameok.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_nameok.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_nameok.Tpo -c -o sbr/sbr_libmh_a-seq_nameok.o `test -f 'sbr/seq_nameok.c' || echo '$(srcdir)/'`sbr/seq_nameok.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_nameok.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_nameok.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_nameok.c' object='sbr/sbr_libmh_a-seq_nameok.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_nameok.o `test -f 'sbr/seq_nameok.c' || echo '$(srcdir)/'`sbr/seq_nameok.c sbr/sbr_libmh_a-seq_nameok.obj: sbr/seq_nameok.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_nameok.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_nameok.Tpo -c -o sbr/sbr_libmh_a-seq_nameok.obj `if test -f 'sbr/seq_nameok.c'; then $(CYGPATH_W) 'sbr/seq_nameok.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_nameok.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_nameok.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_nameok.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_nameok.c' object='sbr/sbr_libmh_a-seq_nameok.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_nameok.obj `if test -f 'sbr/seq_nameok.c'; then $(CYGPATH_W) 'sbr/seq_nameok.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_nameok.c'; fi` sbr/sbr_libmh_a-seq_print.o: sbr/seq_print.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_print.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_print.Tpo -c -o sbr/sbr_libmh_a-seq_print.o `test -f 'sbr/seq_print.c' || echo '$(srcdir)/'`sbr/seq_print.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_print.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_print.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_print.c' object='sbr/sbr_libmh_a-seq_print.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_print.o `test -f 'sbr/seq_print.c' || echo '$(srcdir)/'`sbr/seq_print.c sbr/sbr_libmh_a-seq_print.obj: sbr/seq_print.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_print.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_print.Tpo -c -o sbr/sbr_libmh_a-seq_print.obj `if test -f 'sbr/seq_print.c'; then $(CYGPATH_W) 'sbr/seq_print.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_print.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_print.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_print.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_print.c' object='sbr/sbr_libmh_a-seq_print.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_print.obj `if test -f 'sbr/seq_print.c'; then $(CYGPATH_W) 'sbr/seq_print.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_print.c'; fi` sbr/sbr_libmh_a-seq_read.o: sbr/seq_read.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_read.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_read.Tpo -c -o sbr/sbr_libmh_a-seq_read.o `test -f 'sbr/seq_read.c' || echo '$(srcdir)/'`sbr/seq_read.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_read.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_read.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_read.c' object='sbr/sbr_libmh_a-seq_read.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_read.o `test -f 'sbr/seq_read.c' || echo '$(srcdir)/'`sbr/seq_read.c sbr/sbr_libmh_a-seq_read.obj: sbr/seq_read.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_read.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_read.Tpo -c -o sbr/sbr_libmh_a-seq_read.obj `if test -f 'sbr/seq_read.c'; then $(CYGPATH_W) 'sbr/seq_read.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_read.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_read.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_read.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_read.c' object='sbr/sbr_libmh_a-seq_read.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_read.obj `if test -f 'sbr/seq_read.c'; then $(CYGPATH_W) 'sbr/seq_read.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_read.c'; fi` sbr/sbr_libmh_a-seq_save.o: sbr/seq_save.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_save.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_save.Tpo -c -o sbr/sbr_libmh_a-seq_save.o `test -f 'sbr/seq_save.c' || echo '$(srcdir)/'`sbr/seq_save.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_save.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_save.c' object='sbr/sbr_libmh_a-seq_save.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_save.o `test -f 'sbr/seq_save.c' || echo '$(srcdir)/'`sbr/seq_save.c sbr/sbr_libmh_a-seq_save.obj: sbr/seq_save.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_save.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_save.Tpo -c -o sbr/sbr_libmh_a-seq_save.obj `if test -f 'sbr/seq_save.c'; then $(CYGPATH_W) 'sbr/seq_save.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_save.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_save.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_save.c' object='sbr/sbr_libmh_a-seq_save.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_save.obj `if test -f 'sbr/seq_save.c'; then $(CYGPATH_W) 'sbr/seq_save.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_save.c'; fi` sbr/sbr_libmh_a-seq_setcur.o: sbr/seq_setcur.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_setcur.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_setcur.Tpo -c -o sbr/sbr_libmh_a-seq_setcur.o `test -f 'sbr/seq_setcur.c' || echo '$(srcdir)/'`sbr/seq_setcur.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_setcur.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_setcur.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_setcur.c' object='sbr/sbr_libmh_a-seq_setcur.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_setcur.o `test -f 'sbr/seq_setcur.c' || echo '$(srcdir)/'`sbr/seq_setcur.c sbr/sbr_libmh_a-seq_setcur.obj: sbr/seq_setcur.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_setcur.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_setcur.Tpo -c -o sbr/sbr_libmh_a-seq_setcur.obj `if test -f 'sbr/seq_setcur.c'; then $(CYGPATH_W) 'sbr/seq_setcur.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_setcur.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_setcur.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_setcur.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_setcur.c' object='sbr/sbr_libmh_a-seq_setcur.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_setcur.obj `if test -f 'sbr/seq_setcur.c'; then $(CYGPATH_W) 'sbr/seq_setcur.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_setcur.c'; fi` sbr/sbr_libmh_a-seq_setprev.o: sbr/seq_setprev.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_setprev.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_setprev.Tpo -c -o sbr/sbr_libmh_a-seq_setprev.o `test -f 'sbr/seq_setprev.c' || echo '$(srcdir)/'`sbr/seq_setprev.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_setprev.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_setprev.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_setprev.c' object='sbr/sbr_libmh_a-seq_setprev.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_setprev.o `test -f 'sbr/seq_setprev.c' || echo '$(srcdir)/'`sbr/seq_setprev.c sbr/sbr_libmh_a-seq_setprev.obj: sbr/seq_setprev.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_setprev.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_setprev.Tpo -c -o sbr/sbr_libmh_a-seq_setprev.obj `if test -f 'sbr/seq_setprev.c'; then $(CYGPATH_W) 'sbr/seq_setprev.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_setprev.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_setprev.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_setprev.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_setprev.c' object='sbr/sbr_libmh_a-seq_setprev.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_setprev.obj `if test -f 'sbr/seq_setprev.c'; then $(CYGPATH_W) 'sbr/seq_setprev.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_setprev.c'; fi` sbr/sbr_libmh_a-seq_setunseen.o: sbr/seq_setunseen.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_setunseen.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_setunseen.Tpo -c -o sbr/sbr_libmh_a-seq_setunseen.o `test -f 'sbr/seq_setunseen.c' || echo '$(srcdir)/'`sbr/seq_setunseen.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_setunseen.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_setunseen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_setunseen.c' object='sbr/sbr_libmh_a-seq_setunseen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_setunseen.o `test -f 'sbr/seq_setunseen.c' || echo '$(srcdir)/'`sbr/seq_setunseen.c sbr/sbr_libmh_a-seq_setunseen.obj: sbr/seq_setunseen.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-seq_setunseen.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-seq_setunseen.Tpo -c -o sbr/sbr_libmh_a-seq_setunseen.obj `if test -f 'sbr/seq_setunseen.c'; then $(CYGPATH_W) 'sbr/seq_setunseen.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_setunseen.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-seq_setunseen.Tpo sbr/$(DEPDIR)/sbr_libmh_a-seq_setunseen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/seq_setunseen.c' object='sbr/sbr_libmh_a-seq_setunseen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-seq_setunseen.obj `if test -f 'sbr/seq_setunseen.c'; then $(CYGPATH_W) 'sbr/seq_setunseen.c'; else $(CYGPATH_W) '$(srcdir)/sbr/seq_setunseen.c'; fi` sbr/sbr_libmh_a-showfile.o: sbr/showfile.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-showfile.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-showfile.Tpo -c -o sbr/sbr_libmh_a-showfile.o `test -f 'sbr/showfile.c' || echo '$(srcdir)/'`sbr/showfile.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-showfile.Tpo sbr/$(DEPDIR)/sbr_libmh_a-showfile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/showfile.c' object='sbr/sbr_libmh_a-showfile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-showfile.o `test -f 'sbr/showfile.c' || echo '$(srcdir)/'`sbr/showfile.c sbr/sbr_libmh_a-showfile.obj: sbr/showfile.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-showfile.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-showfile.Tpo -c -o sbr/sbr_libmh_a-showfile.obj `if test -f 'sbr/showfile.c'; then $(CYGPATH_W) 'sbr/showfile.c'; else $(CYGPATH_W) '$(srcdir)/sbr/showfile.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-showfile.Tpo sbr/$(DEPDIR)/sbr_libmh_a-showfile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/showfile.c' object='sbr/sbr_libmh_a-showfile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-showfile.obj `if test -f 'sbr/showfile.c'; then $(CYGPATH_W) 'sbr/showfile.c'; else $(CYGPATH_W) '$(srcdir)/sbr/showfile.c'; fi` sbr/sbr_libmh_a-signals.o: sbr/signals.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-signals.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-signals.Tpo -c -o sbr/sbr_libmh_a-signals.o `test -f 'sbr/signals.c' || echo '$(srcdir)/'`sbr/signals.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-signals.Tpo sbr/$(DEPDIR)/sbr_libmh_a-signals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/signals.c' object='sbr/sbr_libmh_a-signals.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-signals.o `test -f 'sbr/signals.c' || echo '$(srcdir)/'`sbr/signals.c sbr/sbr_libmh_a-signals.obj: sbr/signals.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-signals.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-signals.Tpo -c -o sbr/sbr_libmh_a-signals.obj `if test -f 'sbr/signals.c'; then $(CYGPATH_W) 'sbr/signals.c'; else $(CYGPATH_W) '$(srcdir)/sbr/signals.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-signals.Tpo sbr/$(DEPDIR)/sbr_libmh_a-signals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/signals.c' object='sbr/sbr_libmh_a-signals.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-signals.obj `if test -f 'sbr/signals.c'; then $(CYGPATH_W) 'sbr/signals.c'; else $(CYGPATH_W) '$(srcdir)/sbr/signals.c'; fi` sbr/sbr_libmh_a-smatch.o: sbr/smatch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-smatch.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-smatch.Tpo -c -o sbr/sbr_libmh_a-smatch.o `test -f 'sbr/smatch.c' || echo '$(srcdir)/'`sbr/smatch.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-smatch.Tpo sbr/$(DEPDIR)/sbr_libmh_a-smatch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/smatch.c' object='sbr/sbr_libmh_a-smatch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-smatch.o `test -f 'sbr/smatch.c' || echo '$(srcdir)/'`sbr/smatch.c sbr/sbr_libmh_a-smatch.obj: sbr/smatch.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-smatch.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-smatch.Tpo -c -o sbr/sbr_libmh_a-smatch.obj `if test -f 'sbr/smatch.c'; then $(CYGPATH_W) 'sbr/smatch.c'; else $(CYGPATH_W) '$(srcdir)/sbr/smatch.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-smatch.Tpo sbr/$(DEPDIR)/sbr_libmh_a-smatch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/smatch.c' object='sbr/sbr_libmh_a-smatch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-smatch.obj `if test -f 'sbr/smatch.c'; then $(CYGPATH_W) 'sbr/smatch.c'; else $(CYGPATH_W) '$(srcdir)/sbr/smatch.c'; fi` sbr/sbr_libmh_a-snprintb.o: sbr/snprintb.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-snprintb.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-snprintb.Tpo -c -o sbr/sbr_libmh_a-snprintb.o `test -f 'sbr/snprintb.c' || echo '$(srcdir)/'`sbr/snprintb.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-snprintb.Tpo sbr/$(DEPDIR)/sbr_libmh_a-snprintb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/snprintb.c' object='sbr/sbr_libmh_a-snprintb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-snprintb.o `test -f 'sbr/snprintb.c' || echo '$(srcdir)/'`sbr/snprintb.c sbr/sbr_libmh_a-snprintb.obj: sbr/snprintb.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-snprintb.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-snprintb.Tpo -c -o sbr/sbr_libmh_a-snprintb.obj `if test -f 'sbr/snprintb.c'; then $(CYGPATH_W) 'sbr/snprintb.c'; else $(CYGPATH_W) '$(srcdir)/sbr/snprintb.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-snprintb.Tpo sbr/$(DEPDIR)/sbr_libmh_a-snprintb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/snprintb.c' object='sbr/sbr_libmh_a-snprintb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-snprintb.obj `if test -f 'sbr/snprintb.c'; then $(CYGPATH_W) 'sbr/snprintb.c'; else $(CYGPATH_W) '$(srcdir)/sbr/snprintb.c'; fi` sbr/sbr_libmh_a-ssequal.o: sbr/ssequal.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-ssequal.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-ssequal.Tpo -c -o sbr/sbr_libmh_a-ssequal.o `test -f 'sbr/ssequal.c' || echo '$(srcdir)/'`sbr/ssequal.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-ssequal.Tpo sbr/$(DEPDIR)/sbr_libmh_a-ssequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/ssequal.c' object='sbr/sbr_libmh_a-ssequal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-ssequal.o `test -f 'sbr/ssequal.c' || echo '$(srcdir)/'`sbr/ssequal.c sbr/sbr_libmh_a-ssequal.obj: sbr/ssequal.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-ssequal.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-ssequal.Tpo -c -o sbr/sbr_libmh_a-ssequal.obj `if test -f 'sbr/ssequal.c'; then $(CYGPATH_W) 'sbr/ssequal.c'; else $(CYGPATH_W) '$(srcdir)/sbr/ssequal.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-ssequal.Tpo sbr/$(DEPDIR)/sbr_libmh_a-ssequal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/ssequal.c' object='sbr/sbr_libmh_a-ssequal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-ssequal.obj `if test -f 'sbr/ssequal.c'; then $(CYGPATH_W) 'sbr/ssequal.c'; else $(CYGPATH_W) '$(srcdir)/sbr/ssequal.c'; fi` sbr/sbr_libmh_a-strcasecmp.o: sbr/strcasecmp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-strcasecmp.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-strcasecmp.Tpo -c -o sbr/sbr_libmh_a-strcasecmp.o `test -f 'sbr/strcasecmp.c' || echo '$(srcdir)/'`sbr/strcasecmp.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-strcasecmp.Tpo sbr/$(DEPDIR)/sbr_libmh_a-strcasecmp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/strcasecmp.c' object='sbr/sbr_libmh_a-strcasecmp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-strcasecmp.o `test -f 'sbr/strcasecmp.c' || echo '$(srcdir)/'`sbr/strcasecmp.c sbr/sbr_libmh_a-strcasecmp.obj: sbr/strcasecmp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-strcasecmp.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-strcasecmp.Tpo -c -o sbr/sbr_libmh_a-strcasecmp.obj `if test -f 'sbr/strcasecmp.c'; then $(CYGPATH_W) 'sbr/strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/sbr/strcasecmp.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-strcasecmp.Tpo sbr/$(DEPDIR)/sbr_libmh_a-strcasecmp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/strcasecmp.c' object='sbr/sbr_libmh_a-strcasecmp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-strcasecmp.obj `if test -f 'sbr/strcasecmp.c'; then $(CYGPATH_W) 'sbr/strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/sbr/strcasecmp.c'; fi` sbr/sbr_libmh_a-strindex.o: sbr/strindex.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-strindex.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-strindex.Tpo -c -o sbr/sbr_libmh_a-strindex.o `test -f 'sbr/strindex.c' || echo '$(srcdir)/'`sbr/strindex.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-strindex.Tpo sbr/$(DEPDIR)/sbr_libmh_a-strindex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/strindex.c' object='sbr/sbr_libmh_a-strindex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-strindex.o `test -f 'sbr/strindex.c' || echo '$(srcdir)/'`sbr/strindex.c sbr/sbr_libmh_a-strindex.obj: sbr/strindex.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-strindex.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-strindex.Tpo -c -o sbr/sbr_libmh_a-strindex.obj `if test -f 'sbr/strindex.c'; then $(CYGPATH_W) 'sbr/strindex.c'; else $(CYGPATH_W) '$(srcdir)/sbr/strindex.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-strindex.Tpo sbr/$(DEPDIR)/sbr_libmh_a-strindex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/strindex.c' object='sbr/sbr_libmh_a-strindex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-strindex.obj `if test -f 'sbr/strindex.c'; then $(CYGPATH_W) 'sbr/strindex.c'; else $(CYGPATH_W) '$(srcdir)/sbr/strindex.c'; fi` sbr/sbr_libmh_a-trimcpy.o: sbr/trimcpy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-trimcpy.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-trimcpy.Tpo -c -o sbr/sbr_libmh_a-trimcpy.o `test -f 'sbr/trimcpy.c' || echo '$(srcdir)/'`sbr/trimcpy.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-trimcpy.Tpo sbr/$(DEPDIR)/sbr_libmh_a-trimcpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/trimcpy.c' object='sbr/sbr_libmh_a-trimcpy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-trimcpy.o `test -f 'sbr/trimcpy.c' || echo '$(srcdir)/'`sbr/trimcpy.c sbr/sbr_libmh_a-trimcpy.obj: sbr/trimcpy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-trimcpy.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-trimcpy.Tpo -c -o sbr/sbr_libmh_a-trimcpy.obj `if test -f 'sbr/trimcpy.c'; then $(CYGPATH_W) 'sbr/trimcpy.c'; else $(CYGPATH_W) '$(srcdir)/sbr/trimcpy.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-trimcpy.Tpo sbr/$(DEPDIR)/sbr_libmh_a-trimcpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/trimcpy.c' object='sbr/sbr_libmh_a-trimcpy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-trimcpy.obj `if test -f 'sbr/trimcpy.c'; then $(CYGPATH_W) 'sbr/trimcpy.c'; else $(CYGPATH_W) '$(srcdir)/sbr/trimcpy.c'; fi` sbr/sbr_libmh_a-uprf.o: sbr/uprf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-uprf.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-uprf.Tpo -c -o sbr/sbr_libmh_a-uprf.o `test -f 'sbr/uprf.c' || echo '$(srcdir)/'`sbr/uprf.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-uprf.Tpo sbr/$(DEPDIR)/sbr_libmh_a-uprf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/uprf.c' object='sbr/sbr_libmh_a-uprf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-uprf.o `test -f 'sbr/uprf.c' || echo '$(srcdir)/'`sbr/uprf.c sbr/sbr_libmh_a-uprf.obj: sbr/uprf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-uprf.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-uprf.Tpo -c -o sbr/sbr_libmh_a-uprf.obj `if test -f 'sbr/uprf.c'; then $(CYGPATH_W) 'sbr/uprf.c'; else $(CYGPATH_W) '$(srcdir)/sbr/uprf.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-uprf.Tpo sbr/$(DEPDIR)/sbr_libmh_a-uprf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/uprf.c' object='sbr/sbr_libmh_a-uprf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-uprf.obj `if test -f 'sbr/uprf.c'; then $(CYGPATH_W) 'sbr/uprf.c'; else $(CYGPATH_W) '$(srcdir)/sbr/uprf.c'; fi` sbr/sbr_libmh_a-vfgets.o: sbr/vfgets.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-vfgets.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-vfgets.Tpo -c -o sbr/sbr_libmh_a-vfgets.o `test -f 'sbr/vfgets.c' || echo '$(srcdir)/'`sbr/vfgets.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-vfgets.Tpo sbr/$(DEPDIR)/sbr_libmh_a-vfgets.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/vfgets.c' object='sbr/sbr_libmh_a-vfgets.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-vfgets.o `test -f 'sbr/vfgets.c' || echo '$(srcdir)/'`sbr/vfgets.c sbr/sbr_libmh_a-vfgets.obj: sbr/vfgets.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-vfgets.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-vfgets.Tpo -c -o sbr/sbr_libmh_a-vfgets.obj `if test -f 'sbr/vfgets.c'; then $(CYGPATH_W) 'sbr/vfgets.c'; else $(CYGPATH_W) '$(srcdir)/sbr/vfgets.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-vfgets.Tpo sbr/$(DEPDIR)/sbr_libmh_a-vfgets.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/vfgets.c' object='sbr/sbr_libmh_a-vfgets.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-vfgets.obj `if test -f 'sbr/vfgets.c'; then $(CYGPATH_W) 'sbr/vfgets.c'; else $(CYGPATH_W) '$(srcdir)/sbr/vfgets.c'; fi` sbr/sbr_libmh_a-fmt_def.o: sbr/fmt_def.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_def.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_def.Tpo -c -o sbr/sbr_libmh_a-fmt_def.o `test -f 'sbr/fmt_def.c' || echo '$(srcdir)/'`sbr/fmt_def.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_def.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_def.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_def.c' object='sbr/sbr_libmh_a-fmt_def.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_def.o `test -f 'sbr/fmt_def.c' || echo '$(srcdir)/'`sbr/fmt_def.c sbr/sbr_libmh_a-fmt_def.obj: sbr/fmt_def.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-fmt_def.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-fmt_def.Tpo -c -o sbr/sbr_libmh_a-fmt_def.obj `if test -f 'sbr/fmt_def.c'; then $(CYGPATH_W) 'sbr/fmt_def.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_def.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-fmt_def.Tpo sbr/$(DEPDIR)/sbr_libmh_a-fmt_def.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/fmt_def.c' object='sbr/sbr_libmh_a-fmt_def.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-fmt_def.obj `if test -f 'sbr/fmt_def.c'; then $(CYGPATH_W) 'sbr/fmt_def.c'; else $(CYGPATH_W) '$(srcdir)/sbr/fmt_def.c'; fi` sbr/sbr_libmh_a-m_msgdef.o: sbr/m_msgdef.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_msgdef.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_msgdef.Tpo -c -o sbr/sbr_libmh_a-m_msgdef.o `test -f 'sbr/m_msgdef.c' || echo '$(srcdir)/'`sbr/m_msgdef.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_msgdef.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_msgdef.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_msgdef.c' object='sbr/sbr_libmh_a-m_msgdef.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_msgdef.o `test -f 'sbr/m_msgdef.c' || echo '$(srcdir)/'`sbr/m_msgdef.c sbr/sbr_libmh_a-m_msgdef.obj: sbr/m_msgdef.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_msgdef.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_msgdef.Tpo -c -o sbr/sbr_libmh_a-m_msgdef.obj `if test -f 'sbr/m_msgdef.c'; then $(CYGPATH_W) 'sbr/m_msgdef.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_msgdef.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_msgdef.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_msgdef.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_msgdef.c' object='sbr/sbr_libmh_a-m_msgdef.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_msgdef.obj `if test -f 'sbr/m_msgdef.c'; then $(CYGPATH_W) 'sbr/m_msgdef.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_msgdef.c'; fi` sbr/sbr_libmh_a-mf.o: sbr/mf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-mf.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-mf.Tpo -c -o sbr/sbr_libmh_a-mf.o `test -f 'sbr/mf.c' || echo '$(srcdir)/'`sbr/mf.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-mf.Tpo sbr/$(DEPDIR)/sbr_libmh_a-mf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/mf.c' object='sbr/sbr_libmh_a-mf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-mf.o `test -f 'sbr/mf.c' || echo '$(srcdir)/'`sbr/mf.c sbr/sbr_libmh_a-mf.obj: sbr/mf.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-mf.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-mf.Tpo -c -o sbr/sbr_libmh_a-mf.obj `if test -f 'sbr/mf.c'; then $(CYGPATH_W) 'sbr/mf.c'; else $(CYGPATH_W) '$(srcdir)/sbr/mf.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-mf.Tpo sbr/$(DEPDIR)/sbr_libmh_a-mf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/mf.c' object='sbr/sbr_libmh_a-mf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-mf.obj `if test -f 'sbr/mf.c'; then $(CYGPATH_W) 'sbr/mf.c'; else $(CYGPATH_W) '$(srcdir)/sbr/mf.c'; fi` sbr/sbr_libmh_a-utils.o: sbr/utils.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-utils.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-utils.Tpo -c -o sbr/sbr_libmh_a-utils.o `test -f 'sbr/utils.c' || echo '$(srcdir)/'`sbr/utils.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-utils.Tpo sbr/$(DEPDIR)/sbr_libmh_a-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/utils.c' object='sbr/sbr_libmh_a-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-utils.o `test -f 'sbr/utils.c' || echo '$(srcdir)/'`sbr/utils.c sbr/sbr_libmh_a-utils.obj: sbr/utils.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-utils.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-utils.Tpo -c -o sbr/sbr_libmh_a-utils.obj `if test -f 'sbr/utils.c'; then $(CYGPATH_W) 'sbr/utils.c'; else $(CYGPATH_W) '$(srcdir)/sbr/utils.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-utils.Tpo sbr/$(DEPDIR)/sbr_libmh_a-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/utils.c' object='sbr/sbr_libmh_a-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-utils.obj `if test -f 'sbr/utils.c'; then $(CYGPATH_W) 'sbr/utils.c'; else $(CYGPATH_W) '$(srcdir)/sbr/utils.c'; fi` sbr/sbr_libmh_a-m_mktemp.o: sbr/m_mktemp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_mktemp.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_mktemp.Tpo -c -o sbr/sbr_libmh_a-m_mktemp.o `test -f 'sbr/m_mktemp.c' || echo '$(srcdir)/'`sbr/m_mktemp.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_mktemp.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_mktemp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_mktemp.c' object='sbr/sbr_libmh_a-m_mktemp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_mktemp.o `test -f 'sbr/m_mktemp.c' || echo '$(srcdir)/'`sbr/m_mktemp.c sbr/sbr_libmh_a-m_mktemp.obj: sbr/m_mktemp.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-m_mktemp.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-m_mktemp.Tpo -c -o sbr/sbr_libmh_a-m_mktemp.obj `if test -f 'sbr/m_mktemp.c'; then $(CYGPATH_W) 'sbr/m_mktemp.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_mktemp.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-m_mktemp.Tpo sbr/$(DEPDIR)/sbr_libmh_a-m_mktemp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/m_mktemp.c' object='sbr/sbr_libmh_a-m_mktemp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-m_mktemp.obj `if test -f 'sbr/m_mktemp.c'; then $(CYGPATH_W) 'sbr/m_mktemp.c'; else $(CYGPATH_W) '$(srcdir)/sbr/m_mktemp.c'; fi` sbr/sbr_libmh_a-getansreadline.o: sbr/getansreadline.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getansreadline.o -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getansreadline.Tpo -c -o sbr/sbr_libmh_a-getansreadline.o `test -f 'sbr/getansreadline.c' || echo '$(srcdir)/'`sbr/getansreadline.c @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getansreadline.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getansreadline.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getansreadline.c' object='sbr/sbr_libmh_a-getansreadline.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getansreadline.o `test -f 'sbr/getansreadline.c' || echo '$(srcdir)/'`sbr/getansreadline.c sbr/sbr_libmh_a-getansreadline.obj: sbr/getansreadline.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sbr/sbr_libmh_a-getansreadline.obj -MD -MP -MF sbr/$(DEPDIR)/sbr_libmh_a-getansreadline.Tpo -c -o sbr/sbr_libmh_a-getansreadline.obj `if test -f 'sbr/getansreadline.c'; then $(CYGPATH_W) 'sbr/getansreadline.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getansreadline.c'; fi` @am__fastdepCC_TRUE@ mv -f sbr/$(DEPDIR)/sbr_libmh_a-getansreadline.Tpo sbr/$(DEPDIR)/sbr_libmh_a-getansreadline.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sbr/getansreadline.c' object='sbr/sbr_libmh_a-getansreadline.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sbr/sbr_libmh_a-getansreadline.obj `if test -f 'sbr/getansreadline.c'; then $(CYGPATH_W) 'sbr/getansreadline.c'; else $(CYGPATH_W) '$(srcdir)/sbr/getansreadline.c'; fi` config/sbr_libmh_a-config.o: config/config.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT config/sbr_libmh_a-config.o -MD -MP -MF config/$(DEPDIR)/sbr_libmh_a-config.Tpo -c -o config/sbr_libmh_a-config.o `test -f 'config/config.c' || echo '$(srcdir)/'`config/config.c @am__fastdepCC_TRUE@ mv -f config/$(DEPDIR)/sbr_libmh_a-config.Tpo config/$(DEPDIR)/sbr_libmh_a-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/config.c' object='config/sbr_libmh_a-config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o config/sbr_libmh_a-config.o `test -f 'config/config.c' || echo '$(srcdir)/'`config/config.c config/sbr_libmh_a-config.obj: config/config.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT config/sbr_libmh_a-config.obj -MD -MP -MF config/$(DEPDIR)/sbr_libmh_a-config.Tpo -c -o config/sbr_libmh_a-config.obj `if test -f 'config/config.c'; then $(CYGPATH_W) 'config/config.c'; else $(CYGPATH_W) '$(srcdir)/config/config.c'; fi` @am__fastdepCC_TRUE@ mv -f config/$(DEPDIR)/sbr_libmh_a-config.Tpo config/$(DEPDIR)/sbr_libmh_a-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/config.c' object='config/sbr_libmh_a-config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o config/sbr_libmh_a-config.obj `if test -f 'config/config.c'; then $(CYGPATH_W) 'config/config.c'; else $(CYGPATH_W) '$(srcdir)/config/config.c'; fi` config/sbr_libmh_a-version.o: config/version.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT config/sbr_libmh_a-version.o -MD -MP -MF config/$(DEPDIR)/sbr_libmh_a-version.Tpo -c -o config/sbr_libmh_a-version.o `test -f 'config/version.c' || echo '$(srcdir)/'`config/version.c @am__fastdepCC_TRUE@ mv -f config/$(DEPDIR)/sbr_libmh_a-version.Tpo config/$(DEPDIR)/sbr_libmh_a-version.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/version.c' object='config/sbr_libmh_a-version.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o config/sbr_libmh_a-version.o `test -f 'config/version.c' || echo '$(srcdir)/'`config/version.c config/sbr_libmh_a-version.obj: config/version.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT config/sbr_libmh_a-version.obj -MD -MP -MF config/$(DEPDIR)/sbr_libmh_a-version.Tpo -c -o config/sbr_libmh_a-version.obj `if test -f 'config/version.c'; then $(CYGPATH_W) 'config/version.c'; else $(CYGPATH_W) '$(srcdir)/config/version.c'; fi` @am__fastdepCC_TRUE@ mv -f config/$(DEPDIR)/sbr_libmh_a-version.Tpo config/$(DEPDIR)/sbr_libmh_a-version.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/version.c' object='config/sbr_libmh_a-version.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sbr_libmh_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o config/sbr_libmh_a-version.obj `if test -f 'config/version.c'; then $(CYGPATH_W) 'config/version.c'; else $(CYGPATH_W) '$(srcdir)/config/version.c'; fi` .l.c: $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_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/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_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/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-man5: $(man5_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_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/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ done uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_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/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ done install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) 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/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ done install-dist_contribDATA: $(dist_contrib_DATA) @$(NORMAL_INSTALL) test -z "$(contribdir)" || $(MKDIR_P) "$(DESTDIR)$(contribdir)" @list='$(dist_contrib_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_contribDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(contribdir)/$$f'"; \ $(dist_contribDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(contribdir)/$$f"; \ done uninstall-dist_contribDATA: @$(NORMAL_UNINSTALL) @list='$(dist_contrib_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(contribdir)/$$f'"; \ rm -f "$(DESTDIR)$(contribdir)/$$f"; \ done install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" @list='$(dist_doc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \ $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ rm -f "$(DESTDIR)$(docdir)/$$f"; \ done install-dist_sysconfDATA: $(dist_sysconf_DATA) @$(NORMAL_INSTALL) test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" @list='$(dist_sysconf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ $(dist_sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ done uninstall-dist_sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(dist_sysconf_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ done install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" @list='$(sysconf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ $(sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *$$ws$$tst$$ws*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(auxexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(contribdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -rm -f config/$(DEPDIR)/$(am__dirstamp) -rm -f config/$(am__dirstamp) -rm -f mts/$(am__dirstamp) -rm -f mts/smtp/$(DEPDIR)/$(am__dirstamp) -rm -f mts/smtp/$(am__dirstamp) -rm -f sbr/$(DEPDIR)/$(am__dirstamp) -rm -f sbr/$(am__dirstamp) -rm -f test/$(DEPDIR)/$(am__dirstamp) -rm -f test/$(am__dirstamp) -rm -f uip/$(DEPDIR)/$(am__dirstamp) -rm -f uip/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f sbr/dtimep.c -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-auxexecPROGRAMS clean-binPROGRAMS clean-checkPROGRAMS \ clean-generic clean-local clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf config/$(DEPDIR) mts/smtp/$(DEPDIR) sbr/$(DEPDIR) test/$(DEPDIR) uip/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dist_contribDATA install-dist_docDATA \ install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-exec-am: install-auxexecPROGRAMS install-binPROGRAMS \ install-binSCRIPTS install-dist_sysconfDATA \ install-sysconfDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-man1 install-man5 install-man8 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf config/$(DEPDIR) mts/smtp/$(DEPDIR) sbr/$(DEPDIR) test/$(DEPDIR) uip/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-auxexecPROGRAMS uninstall-binPROGRAMS \ uninstall-binSCRIPTS uninstall-dist_contribDATA \ uninstall-dist_docDATA uninstall-dist_sysconfDATA \ uninstall-man uninstall-sysconfDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 .MAKE: install-am install-data-am install-exec-am install-strip \ uninstall-am .PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \ clean clean-auxexecPROGRAMS clean-binPROGRAMS \ clean-checkPROGRAMS clean-generic clean-local \ clean-noinstLIBRARIES ctags dist dist-all dist-bzip2 dist-gzip \ dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-auxexecPROGRAMS install-binPROGRAMS install-binSCRIPTS \ install-data install-data-am install-data-hook \ install-dist_contribDATA install-dist_docDATA \ install-dist_sysconfDATA install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-man5 install-man8 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-sysconfDATA installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-auxexecPROGRAMS \ uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-dist_contribDATA uninstall-dist_docDATA \ uninstall-dist_sysconfDATA uninstall-hook uninstall-man \ uninstall-man1 uninstall-man5 uninstall-man8 \ uninstall-sysconfDATA clean-local: @rm -rf RPM a.out.DSYM uip/a.out.DSYM @rm -rf test/testdir superclean: maintainer-clean @rm -f $(SUPERCLEANFILES) .PHONY: superclean config/version.c: Makefile sh $(srcdir)/config/version.sh $(VERSION) > $@ sbr/sigmsg.h: $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) $(AWK) -f $(srcdir)/sbr/sigmsg.awk $(SIGNAL_H) > $@ etc/mts.conf: $(srcdir)/etc/mts.conf.in Makefile rm -f $@ $(SED) -e 's,%mts%,$(MTS),' \ -e 's,%mailspool%,$(mailspool),' \ -e 's,%smtpservers%,$(smtpservers),' \ < $(srcdir)/etc/mts.conf.in > $@ etc/mhn.defaults: $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPROG) rm -f $@ $(srcdir)/etc/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@ etc/sendfiles: $(srcdir)/etc/sendfiles.in Makefile rm -f $@ $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/etc/sendfiles.in > $@ install-exec-hook: rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT) rm -f $(DESTDIR)$(bindir)/folders$(EXEEXT) rm -f $(DESTDIR)$(bindir)/fnext$(EXEEXT) rm -f $(DESTDIR)$(bindir)/fprev$(EXEEXT) rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT) rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT) rm -f $(DESTDIR)$(bindir)/next$(EXEEXT) ln $(DESTDIR)$(bindir)/flist$(EXEEXT) $(DESTDIR)$(bindir)/flists$(EXEEXT) ln $(DESTDIR)$(bindir)/folder$(EXEEXT) $(DESTDIR)$(bindir)/folders$(EXEEXT) ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fnext$(EXEEXT) ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fprev$(EXEEXT) ln $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/unseen$(EXEEXT) ln $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/prev$(EXEEXT) ln $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/next$(EXEEXT) if test x$(SETGID_MAIL) != x; then \ chgrp $(MAIL_SPOOL_GRP) $(DESTDIR)$(bindir)/inc$(EXEEXT) && \ chmod 2755 $(DESTDIR)$(bindir)/inc$(EXEEXT); \ fi install-data-hook: rm -f $(DESTDIR)$(man5dir)/mh_profile.5 ln $(DESTDIR)$(man5dir)/mh-profile.5 $(DESTDIR)$(man5dir)/mh_profile.5 uninstall-hook: rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT) rm -f $(DESTDIR)$(bindir)/folders$(EXEEXT) rm -f $(DESTDIR)$(bindir)/fnext$(EXEEXT) rm -f $(DESTDIR)$(bindir)/fprev$(EXEEXT) rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT) rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT) rm -f $(DESTDIR)$(bindir)/next$(EXEEXT) rm -f $(DESTDIR)$(man5dir)/mh_profile.5 $(man_MANS): man/man.sed man/man.sed: Makefile @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@ @echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@ @echo 's,%nmhdate%,$(DATE),g' >> $@ @echo 's,%bindir%,$(bindir),g' >> $@ @echo 's,%etcdir%,$(sysconfdir),g' >> $@ @echo 's,%libdir%,$(libdir),g' >> $@ @echo 's,%mandir%,$(mandir),g' >> $@ @echo 's,%mailspool%,$(mailspool),g' >> $@ @echo 's,%sendmailpath%,$(sendmailpath),g' >> $@ @echo 's,%default_editor%,$(editorpath),g' >> $@ @echo 's,%default_pager%,$(pagerpath),g' >> $@ @echo 's,%manext1%,$(manext1),g' >> $@ @echo 's,%manext5%,$(manext5),g' >> $@ @echo 's,%manext8%,$(manext8),g' >> $@ @echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@ @echo ' s,%mhl_forward%,,g' >> $@ @echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@ @echo ' s,%mhl_format%,,g' >> $@ @echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@ @echo ' s,%mhl_reply%,,g' >> $@ man/mh-chart.man: @$(srcdir)/man/mh-chart-gen.sh > $@ .man.$(manext1): @$(SED) -f man/man.sed $< > $@ .man.$(manext5): @$(SED) -f man/man.sed $< > $@ .man.$(manext8): @$(SED) -f man/man.sed $< > $@ ChangeLog: @[ -d .git ] && git --no-pager log --abbrev-commit | \ egrep -v '^commit [0-9a-f]+$$' > $@ || true .PHONY: ChangeLog rpm: dist @test -d $(rpmdir)/SOURCES || $(MKDIR_P) $(rpmdir)/SOURCES @test -d $(rpmdir)/SPECS || $(MKDIR_P) $(rpmdir)/SPECS @mv -f $(DIST_ARCHIVES) $(rpmdir)/SOURCES @cp -p VERSION $(rpmdir)/SOURCES @cp -p docs/contrib/nmh.spec $(rpmdir)/SPECS @rpmbuild --define '_topdir $(rpmdir)' \ --define '_tmppath %{_topdir}/TMP' \ --define "_sysconfdir $(DESTDIR)$(sysconfdir)" \ -ba $(rpmdir)/SPECS/nmh.spec .PHONY: rpm cscope: echo "-I $(srcdir)/h -I $(srcdir)/sbr -I $(srcdir)/uip -I $(srcdir)/mts/smtp" > cscope.files find $(srcdir) \( -name docs -prune \) -o \( -name \*.c -o -name \*.l \) -print | grep -v dtimep.c >> cscope.files .PHONY: cscope gcov: @if ./config.status --config | grep -e --enable-debug >/dev/null; then \ echo For best results with gcov, configure without --enable-debug; \ fi @echo rebuilding with AM_CFLAGS=--coverage . . . @(make clean && make AM_CFLAGS=--coverage) > /dev/null && \ make check AM_CFLAGS=--coverage @for i in `find . -name '*.gcda'`; do \ gcov -p -o `echo $$i | $(SED) 's%\\(.*\\)/%\\1 %'`; \ done @for i in `find . -name '*.gcno'`; do \ if ! test -f `echo $$i | sed 's%\.gcno%.gcda%'`; then \ echo untested: $$i; \ fi; \ done gcov-mostlyclean: @find . -name '*.gcno' -o -name '*.gcda' | xargs rm gcov-clean: gcov-mostlyclean @find . -name '*.gcov' | xargs rm .PHONY: gcov gcov-mostlyclean gcov-clean upload: dist @if test -z "$(SAVANNAH_USERNAME)"; then \ echo "You need to set SAVANNAH_USERNAME to the your username on savannah.gnu.org." ;\ echo "You can set it either in your environment or on the make command line."; \ false; \ fi @echo "Did you run 'make distcheck' already?" @if test -z "$(SKIP_GPG_SIG)"; then \ echo "Creating GPG signature (set SKIP_GPG_SIG to bypass this step)"; \ gpg --output $(DIST_ARCHIVES).sig --detatch-sig $(DIST_ARCHIVES); \ fi @echo "Setting permissions for savannah.gnu.org" chmod 664 $(DIST_ARCHIVES) if test -f $(DIST_ARCHIVES).sig; then \ chmod 664 $(DIST_ARCHIVES).sig; \ fi @echo "Uploading to savannah" scp -p $(DIST_ARCHIVES)* $(SAVANNAH_USERNAME)@dl.sv.nongnu.org:/releases/nmh .PHONY: upload # 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: nmh-1.5/man/000777 007761 000765 00000000000 11765271327 012664 5ustar00kenhkenh000000 000000 nmh-1.5/missing000755 007761 000765 00000025577 11765270216 013520 0ustar00kenhkenh000000 000000 #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: nmh-1.5/mts/000777 007761 000765 00000000000 11765271326 012713 5ustar00kenhkenh000000 000000 nmh-1.5/NEWS000644 007761 000765 00000015566 11762736344 012623 0ustar00kenhkenh000000 000000 # # NEWS - Release notes for nmh 1.5 # Welcome to nmh, the new version of the classic MH mail handling system. Long-time MH and nmh users should read carefully the NOTABLE CHANGES section, as there are some subtle but significant changes to the way nmh now behaves. Otherwise, please see the README and INSTALL files for help on getting started with nmh. ------------ NEW FEATURES ------------ The following are new features for the 1.5 release of nmh. - Improved performance for TLS encryption of the SMTP protocol. - MH-E and POP support are now always compiled in. - The selection of a locking directory for dot-locking files is now controllable via configure. - fileproc and mhlproc mh-profile are now obeyed by send, rcvdist, and whatnow. - New mh-format instructions have been implemented: %(putlit), %(concataddr), %(myhost), %(myname), %(localmbox). See mh-format(5) for more details. - Nmh's idea of the local mailbox is now configurable via a new profile entry, Local-Mailbox. See mh-profile(5) for more details. - comp, forw, and dist now process all component templates through mh-format(5), and now all support new command line arguments -from, -to, -cc, -fcc, and -subject. - burst(1) now supports any valid message delimiter according to RFC 934. - post(8) now requires a From: header in all drafts that it processes; see NOTABLE CHANGES below for more details. - post(8) can now explicitly control the SMTP envelope address either via the Sender: header or the new Envelope-From: header. - The -attach option is now the default for send (using the header Nmh-Attachment) and -attachformat 1 is the default attachment type. - repl and dist now support new switches -atfile and -noatfile to control the creation of the ./@ link to the message being replied or redistributed. The current default is -atfile. - Support (if available) for readline editing and filename completion at the WhatNow? prompt. - Support for using an external command to filter the body of a message through in mhl. See mhl(1) for more details, specifically, the "format" keyword, the "formatproc" entry in mh-profile(5), and the -fmtproc switch for mhl and repl. - Preliminary support for improved MIME handling when replying to messages! Yes, a long requested feature has a solution. A perl script called replyfilter is available; it is designed to act as a mhl external filter to process MIME messages in a more logical way. It is available in $(srcdir)/docs/contrib/replyfilter or is typically installed as $(prefix)/share/doc/nmh/contrib/replyfilter. See the comments at the top of replyfilter for usage information; it will likely require some adjustment for your site. replyfilter requires the MIME-Tools and MailTools perl modules. ---------------------------- OBSOLETE/DEPRECATED FEATURES ---------------------------- The following features have either been removed completely or marked as officially deprecated for removal in a future release of nmh. - The creation of the ./@ link to the message being replied or redistributed is deprecated; -noatfile will be the default in the next release. If there are no requests to maintain -atfile it will be removed in a future release. - Old code enabled by the UCI preprocessor definition has been removed. - All configuration options that were formerly only adjustable by editing config.h have either been moved into configure or removed completely. - Support for the built-in ftp client (used when dealing with external-body message parts in MIME messages) has been removed. - The following environment variables are marked as obsolete/deprecated. Support for them will be removed from the next nmh release: MHPOPDEBUG (use -snoop command line switch instead) MM_NOASK (use -nolist and -nopause command line switches instead) NOMHNPROC (use -nocheckmime command line switch instead) FACEPROC (undocumented faceproc feature to be removed) - The hostable option of mts.conf is no longer needed and has been removed. --------------- NOTABLE CHANGES --------------- The largest change is that post(8) now requires a From: header in all drafts that it processes. The impetus for this change has been the evolution of email and client systems. When MH was first developed the norm was to have tightly managed clients that were part of the same domain as a user's email address. This is no longer a valid assumption, and the algorithm used by nmh to determine the user's local mailbox is no longer a reasonable default. Unfortunately, the way that nmh uses the user's local mailbox used to happen very late in the message process; it was handled by post during message submission. If no From: header exists in the current draft post would insert one based on it's idea of the local mailbox, which was frequently wrong. After a long discussion within the nmh development community, it was decided that the only reasonable way forward was to move the local mailbox handling up a level and place it under more direct control of the end user. post(8) no longer will try to determine the local mailbox name; it will take that information from the draft message. Thus a From: header is now required in all drafts. As part of these changes, all message composition utilities now process their component files using mh-format. All of the default component files have been modified to include a From: header in them; this will give the user a chance to see nmh's idea of the local mailbox and modify it if desired. The new mh-profile(5) entry Local-Mailbox can be used to adjust the local mailbox name if the system default is not appropriate. So how should end-users adapt to these changes? Here are some suggestions: 1) If you use the default component files, everything should basically work the same for you. You should see a From: header in the drafts of your messages. If the address you see in the From: header is incorrect you can change it via the Local-Mailbox profile entry. You can also use the -from switch to change it on a per-command basis. 2) If you have custom component files that include a From: header or you perform custom processing on drafts that end up placing a From: header in the draft message, everything should work as before. 3) If you have custom component files that do NOT include a From: header then you will have to adapt then to include a From: header. You can either simply hard-code the correct From: header or use the default component files as a guide (see mh-format(5) for more details, specifically the %(localmbox) function). The other significant change is the support for filters in mhl. Included in the distribution is replyfilter, a filter designed for sane processing of MIME messages during replies. Since this isn't as integrated into nmh as we would prefer, it's included in the contrib directory as an optional component. Please try it out and give us feedback. -- The nmh team nmh-workers@nongnu.org nmh-1.5/README000644 007761 000765 00000002470 11762736344 012772 0ustar00kenhkenh000000 000000 Installing ---------- Please read the INSTALL file. Copying ------- nmh uses a BSD-style license, which should be in the top-level of the distribution in a file named COPYRIGHT. Developers ---------- Information of interest to nmh developers can be found in the README.developers file in the docs subdirectory of this distribution. If you're hacking on the code, you should also definitely subscribe to the nmh-workers mailing list. To do so, please visit the nmh-workers info page at . If you're interested in working on nmh, but aren't sure what to do, see the TODO file in the docs subdirectory. There's plenty of work there. Working with your shell ----------------------- The files COMPLETION-BASH, COMPLETION-TCSH and COMPLETION-ZSH in the docs subdirectory give cookbook examples of how to use the enhanced features of these shells with nmh. There is also a section in Jerry Peek's book covering nmh/MH and working with the shell. The section is available online at . For More information -------------------- There is more information, including a FAQ and a bit of historical information in the docs subdirectory. There are also links to further documentation on the nmh website located at . nmh-1.5/sbr/000777 007761 000765 00000000000 11765271326 012676 5ustar00kenhkenh000000 000000 nmh-1.5/test/000777 007761 000765 00000000000 11765271327 013070 5ustar00kenhkenh000000 000000 nmh-1.5/uip/000777 007761 000765 00000000000 11765271326 012705 5ustar00kenhkenh000000 000000 nmh-1.5/VERSION000644 007761 000765 00000000004 11765267306 013151 0ustar00kenhkenh000000 000000 1.5 nmh-1.5/ylwrap000755 007761 000765 00000014061 11765270216 013347 0ustar00kenhkenh000000 000000 #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2005-05-14.22 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) $prog "$input" ;; *) $prog "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: nmh-1.5/uip/ali.c000644 007761 000765 00000012006 11765267273 013617 0ustar00kenhkenh000000 000000 /* * ali.c -- list nmh mail aliases * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include /* * maximum number of names */ #define NVEC 50 static struct swit switches[] = { #define ALIASW 0 { "alias aliasfile", 0 }, #define NALIASW 1 { "noalias", -7 }, #define LISTSW 2 { "list", 0 }, #define NLISTSW 3 { "nolist", 0 }, #define NORMSW 4 { "normalize", 0 }, #define NNORMSW 5 { "nonormalize", 0 }, #define USERSW 6 { "user", 0 }, #define NUSERSW 7 { "nouser", 0 }, #define VERSIONSW 8 { "version", 0 }, #define HELPSW 9 { "help", 0 }, { NULL, 0 } }; static int pos = 1; extern struct aka *akahead; /* * prototypes */ static void print_aka (char *, int, int); static void print_usr (char *, int, int); int main (int argc, char **argv) { int i, vecp = 0, inverted = 0, list = 0; int noalias = 0, normalize = AD_NHST; char *cp, **ap, **argp, buf[BUFSIZ]; char *vec[NVEC], **arguments; struct aka *ak; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] aliases ...", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version (invo_name); done (1); case ALIASW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((i = alias (cp)) != AK_OK) adios (NULL, "aliasing error in %s - %s", cp, akerror (i)); continue; case NALIASW: noalias++; continue; case LISTSW: list++; continue; case NLISTSW: list = 0; continue; case NORMSW: normalize = AD_HOST; continue; case NNORMSW: normalize = AD_NHST; continue; case USERSW: inverted++; continue; case NUSERSW: inverted = 0; continue; } } vec[vecp++] = cp; } if (!noalias) { /* allow Aliasfile: profile entry */ if ((cp = context_find ("Aliasfile"))) { char *dp = NULL; for (ap = brkstring(dp = getcpy(cp), " ", "\n"); ap && *ap; ap++) if ((i = alias (*ap)) != AK_OK) adios (NULL, "aliasing error in %s - %s", *ap, akerror (i)); if (dp) free(dp); } alias (AliasFile); } /* * If -user is specified */ if (inverted) { if (vecp == 0) adios (NULL, "usage: %s -user addresses ... (you forgot the addresses)", invo_name); for (i = 0; i < vecp; i++) print_usr (vec[i], list, normalize); done (0); } if (vecp) { /* print specified aliases */ for (i = 0; i < vecp; i++) print_aka (akvalue (vec[i]), list, 0); } else { /* print them all */ for (ak = akahead; ak; ak = ak->ak_next) { printf ("%s: ", ak->ak_name); pos += strlen (ak->ak_name) + 1; print_aka (akresult (ak), list, pos); } } done (0); return 1; } static void print_aka (char *p, int list, int margin) { char c; if (p == NULL) { printf ("\n"); return; } while ((c = *p++)) { switch (c) { case ',': if (*p) { if (list) printf ("\n%*s", margin, ""); else { if (pos >= 68) { printf (",\n "); pos = 2; } else { printf (", "); pos += 2; } } } case 0: break; default: pos++; putchar (c); } } putchar ('\n'); pos = 1; } static void print_usr (char *s, int list, int norm) { register char *cp, *pp, *vp; register struct aka *ak; register struct mailname *mp, *np; if ((pp = getname (s)) == NULL) adios (NULL, "no address in \"%s\"", s); if ((mp = getm (pp, NULL, 0, norm, NULL)) == NULL) adios (NULL, "bad address \"%s\"", s); while (getname ("")) continue; vp = NULL; for (ak = akahead; ak; ak = ak->ak_next) { pp = akresult (ak); while ((cp = getname (pp))) { if ((np = getm (cp, NULL, 0, norm, NULL)) == NULL) continue; if (!mh_strcasecmp (mp->m_host, np->m_host) && !mh_strcasecmp (mp->m_mbox, np->m_mbox)) { vp = vp ? add (ak->ak_name, add (",", vp)) : getcpy (ak->ak_name); mnfree (np); while (getname ("")) continue; break; } mnfree (np); } } mnfree (mp); #if 0 printf ("%s: ", s); print_aka (vp ? vp : s, list, pos += strlen (s) + 1); #else print_aka (vp ? vp : s, list, 0); #endif if (vp) free (vp); } nmh-1.5/uip/aliasbr.c000644 007761 000765 00000023274 11762736346 014477 0ustar00kenhkenh000000 000000 /* * aliasbr.c -- new aliasing mechanism * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include static int akvis; static char *akerrst; struct aka *akahead = NULL; struct aka *akatail = NULL; struct home *homehead = NULL; struct home *hometail = NULL; /* * prototypes */ int alias (char *); int akvisible (void); void init_pw (void); char *akresult (struct aka *); char *akvalue (char *); char *akerror (int); static char *akval (struct aka *, char *); static int aleq (char *, char *); static char *scanp (unsigned char *); static char *getp (char *); static char *seekp (char *, char *, char **); static int addfile (struct aka *, char *); static int addgroup (struct aka *, char *); static int addmember (struct aka *, char *); static int addall (struct aka *); static char *getalias (char *); static void add_aka (struct aka *, char *); static struct aka *akalloc (char *); static struct home *hmalloc (struct passwd *); struct home *seek_home (char *); /* Do mh alias substitution on 's' and return the results. */ char * akvalue (char *s) { register char *v; if (akahead == NULL) alias (AliasFile); akvis = -1; v = akval (akahead, s); if (akvis == -1) akvis = 0; return v; } int akvisible (void) { return akvis; } char * akresult (struct aka *ak) { register char *cp = NULL, *dp, *pp; register struct adr *ad; for (ad = ak->ak_addr; ad; ad = ad->ad_next) { pp = ad->ad_local ? akval (ak->ak_next, ad->ad_text) : getcpy (ad->ad_text); if (cp) { dp = cp; cp = concat (cp, ",", pp, NULL); free (dp); free (pp); } else cp = pp; } if (akvis == -1) akvis = ak->ak_visible; return cp; } static char * akval (struct aka *ak, char *s) { if (!s) return s; /* XXX */ for (; ak; ak = ak->ak_next) if (aleq (s, ak->ak_name)) return akresult (ak); return getcpy (s); } static int aleq (char *string, char *aliasent) { register char c; while ((c = *string++)) if (*aliasent == '*') return 1; else if ((c | 040) != (*aliasent | 040)) return 0; else aliasent++; return (*aliasent == 0 || *aliasent == '*'); } int alias (char *file) { int i; register char *bp, *cp, *pp; char lc, *ap; register struct aka *ak = NULL; register FILE *fp; if (*file != '/' && (strncmp (file, "./", 2) && strncmp (file, "../", 3))) file = etcpath (file); if ((fp = fopen (file, "r")) == NULL) { akerrst = file; return AK_NOFILE; } while (vfgets (fp, &ap) == OK) { bp = ap; switch (*(pp = scanp (bp))) { case '<': /* recurse a level */ if (!*(cp = getp (pp + 1))) { akerrst = "'<' without alias-file"; fclose (fp); return AK_ERROR; } if ((i = alias (cp)) != AK_OK) { fclose (fp); return i; } case ':': /* comment */ case ';': case '#': case 0: continue; } akerrst = bp; if (!*(cp = seekp (pp, &lc, &ap))) { fclose (fp); return AK_ERROR; } if (!(ak = akalloc (cp))) { fclose (fp); return AK_LIMIT; } switch (lc) { case ':': ak->ak_visible = 0; break; case ';': ak->ak_visible = 1; break; default: fclose (fp); return AK_ERROR; } switch (*(pp = scanp (ap))) { case 0: /* EOL */ fclose (fp); return AK_ERROR; case '<': /* read values from file */ if (!*(cp = getp (pp + 1))) { fclose (fp); return AK_ERROR; } if (!addfile (ak, cp)) { fclose (fp); return AK_NOFILE; } break; case '=': /* UNIX group */ if (!*(cp = getp (pp + 1))) { fclose (fp); return AK_ERROR; } if (!addgroup (ak, cp)) { fclose (fp); return AK_NOGROUP; } break; case '+': /* UNIX group members */ if (!*(cp = getp (pp + 1))) { fclose (fp); return AK_ERROR; } if (!addmember (ak, cp)) { fclose (fp); return AK_NOGROUP; } break; case '*': /* Everyone */ addall (ak); break; default: /* list */ while ((cp = getalias (pp))) add_aka (ak, cp); break; } } fclose (fp); return AK_OK; } char * akerror (int i) { static char buffer[BUFSIZ]; switch (i) { case AK_NOFILE: snprintf (buffer, sizeof(buffer), "unable to read '%s'", akerrst); break; case AK_ERROR: snprintf (buffer, sizeof(buffer), "error in line '%s'", akerrst); break; case AK_LIMIT: snprintf (buffer, sizeof(buffer), "out of memory while on '%s'", akerrst); break; case AK_NOGROUP: snprintf (buffer, sizeof(buffer), "no such group as '%s'", akerrst); break; default: snprintf (buffer, sizeof(buffer), "unknown error (%d)", i); break; } return buffer; } static char * scanp (unsigned char *p) { while (isspace (*p)) p++; return p; } static char * getp (char *p) { register unsigned char *cp = scanp (p); p = cp; while (!isspace (*cp) && *cp) cp++; *cp = 0; return p; } static char * seekp (char *p, char *c, char **a) { register unsigned char *cp; p = cp = scanp (p); while (!isspace (*cp) && *cp && *cp != ':' && *cp != ';') cp++; *c = *cp; *cp++ = 0; *a = cp; return p; } static int addfile (struct aka *ak, char *file) { register char *cp; char buffer[BUFSIZ]; register FILE *fp; if (!(fp = fopen (etcpath (file), "r"))) { akerrst = file; return 0; } while (fgets (buffer, sizeof buffer, fp)) while ((cp = getalias (buffer))) add_aka (ak, cp); fclose (fp); return 1; } static int addgroup (struct aka *ak, char *grp) { register char *gp; register struct group *gr = getgrnam (grp); register struct home *hm = NULL; if (!gr) gr = getgrgid (atoi (grp)); if (!gr) { akerrst = grp; return 0; } while ((gp = *gr->gr_mem++)) { struct passwd *pw; for (hm = homehead; hm; hm = hm->h_next) if (!strcmp (hm->h_name, gp)) { add_aka (ak, hm->h_name); break; } if ((pw = getpwnam(gp))) { hmalloc(pw); add_aka (ak, gp); } } return 1; } static int addmember (struct aka *ak, char *grp) { gid_t gid; register struct group *gr = getgrnam (grp); register struct home *hm = NULL; if (gr) gid = gr->gr_gid; else { gid = atoi (grp); gr = getgrgid (gid); } if (!gr) { akerrst = grp; return 0; } init_pw (); for (hm = homehead; hm; hm = hm->h_next) if (hm->h_gid == gid) add_aka (ak, hm->h_name); return 1; } static int addall (struct aka *ak) { int noshell = NoShell == NULL || *NoShell == 0; register struct home *hm; init_pw (); if (Everyone < 0) Everyone = EVERYONE; for (hm = homehead; hm; hm = hm->h_next) if ((int) hm->h_uid > Everyone && (noshell || strcmp (hm->h_shell, NoShell))) add_aka (ak, hm->h_name); return homehead != NULL; } static char * getalias (char *addrs) { register unsigned char *pp, *qp; static char *cp = NULL; if (cp == NULL) cp = addrs; else if (*cp == 0) return (cp = NULL); for (pp = cp; isspace (*pp); pp++) continue; if (*pp == 0) return (cp = NULL); for (qp = pp; *qp != 0 && *qp != ','; qp++) continue; if (*qp == ',') *qp++ = 0; for (cp = qp, qp--; qp > pp; qp--) if (*qp != 0) { if (isspace (*qp)) *qp = 0; else break; } return pp; } static void add_aka (struct aka *ak, char *pp) { register struct adr *ad, *ld; for (ad = ak->ak_addr, ld = NULL; ad; ld = ad, ad = ad->ad_next) if (!strcmp (pp, ad->ad_text)) return; ad = (struct adr *) mh_xmalloc (sizeof(*ad)); ad->ad_text = getcpy (pp); ad->ad_local = strchr(pp, '@') == NULL && strchr(pp, '!') == NULL; ad->ad_next = NULL; if (ak->ak_addr) ld->ad_next = ad; else ak->ak_addr = ad; } void init_pw (void) { register struct passwd *pw; static int init; if (!init) { /* if the list has yet to be initialized */ /* zap the list, and rebuild from scratch */ homehead=NULL; hometail=NULL; init++; setpwent (); while ((pw = getpwent ())) if (!hmalloc (pw)) break; endpwent (); } } static struct aka * akalloc (char *id) { register struct aka *p; p = (struct aka *) mh_xmalloc (sizeof(*p)); p->ak_name = getcpy (id); p->ak_visible = 0; p->ak_addr = NULL; p->ak_next = NULL; if (akatail != NULL) akatail->ak_next = p; if (akahead == NULL) akahead = p; akatail = p; return p; } static struct home * hmalloc (struct passwd *pw) { register struct home *p; p = (struct home *) mh_xmalloc (sizeof(*p)); p->h_name = getcpy (pw->pw_name); p->h_uid = pw->pw_uid; p->h_gid = pw->pw_gid; p->h_home = getcpy (pw->pw_dir); p->h_shell = getcpy (pw->pw_shell); p->h_ngrps = 0; p->h_next = NULL; if (hometail != NULL) hometail->h_next = p; if (homehead == NULL) homehead = p; hometail = p; return p; } struct home * seek_home (char *name) { register struct home *hp; struct passwd *pw; char lname[32]; unsigned char *c; char *c1; for (hp = homehead; hp; hp = hp->h_next) if (!mh_strcasecmp (name, hp->h_name)) return hp; /* * The only place where there might be problems. * This assumes that ALL usernames are kept in lowercase. */ for (c = name, c1 = lname; *c && (c1 - lname < (int) sizeof(lname) - 1); c++, c1++) { if (isalpha(*c) && isupper(*c)) *c1 = tolower (*c); else *c1 = *c; } *c1 = '\0'; if ((pw = getpwnam(lname))) return(hmalloc(pw)); return NULL; } nmh-1.5/uip/anno.c000644 007761 000765 00000021153 11765267273 014010 0ustar00kenhkenh000000 000000 /* * anno.c -- annotate messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. * * Four new options have been added: delete, list, number, and draft. * Message header fields are used by the new MIME attachment code in * the send command. Adding features to generalize the anno command * seemed to be a better approach than the creation of a new command * whose features would overlap with those of the anno command. * * The -draft option causes anno to operate on the current draft file * instead of on a message sequence. * * The -delete option deletes header elements that match the -component * field name. If -delete is used without the -text option, the first * header field whose field name matches the component name is deleted. * If the -delete is used with the -text option, and the -text argument * begins with a /, the first header field whose field name matches the * component name and whose field body matches the text is deleted. If * the -text argument does not begin with a /, then the text is assumed * to be the last component of a path name, and the first header field * whose field name matches the component name and a field body whose * last path name component matches the text is deleted. If the -delete * option is used with the new -number option described below, the nth * header field whose field name matches the component name is deleted. * No header fields are deleted if none of the above conditions are met. * * The -list option outputs the field bodies from each header field whose * field name matches the component name, one per line. If no -text * option is specified, only the last path name component of each field * body is output. The entire field body is output if the -text option * is used; the contents of the -text argument are ignored. If the -list * option is used in conjuction with the new -number option described * below, each line is numbered starting with 1. A tab separates the * number from the field body. * * The -number option works with both the -delete and -list options as * described above. The -number option takes an optional argument. A * value of 1 is assumed if this argument is absent. */ #include #include static struct swit switches[] = { #define COMPSW 0 { "component field", 0 }, #define INPLSW 1 { "inplace", 0 }, #define NINPLSW 2 { "noinplace", 0 }, #define DATESW 3 { "date", 0 }, #define NDATESW 4 { "nodate", 0 }, #define TEXTSW 5 { "text body", 0 }, #define VERSIONSW 6 { "version", 0 }, #define HELPSW 7 { "help", 0 }, #define DRFTSW 8 { "draft", 2 }, #define LISTSW 9 { "list", 1 }, #define DELETESW 10 { "delete", 2 }, #define NUMBERSW 11 { "number", 2 }, #define APPENDSW 12 { "append", 1 }, #define PRESERVESW 13 { "preserve", 1 }, #define NOPRESERVESW 14 { "nopreserve", 3 }, { NULL, 0 } }; /* * static prototypes */ static void make_comp (unsigned char **); int main (int argc, char **argv) { int inplace = 1, datesw = 1; int msgnum; char *cp, *maildir; unsigned char *comp = NULL; char *text = NULL, *folder = NULL, buf[BUFSIZ]; char **argp, **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; int append = 0; /* append annotations instead of default prepend */ int delete = -2; /* delete header element if set */ char *draft = (char *)0; /* draft file name */ int isdf = 0; /* return needed for m_draft() */ int list = 0; /* list header elements if set */ int number = 0; /* delete specific number of like elements if set */ #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case COMPSW: if (comp) adios (NULL, "only one component at a time!"); if (!(comp = *argp++) || *comp == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case DATESW: datesw++; continue; case NDATESW: datesw = 0; continue; case INPLSW: inplace++; continue; case NINPLSW: inplace = 0; continue; case TEXTSW: if (text) adios (NULL, "only one body at a time!"); if (!(text = *argp++) || *text == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case DELETESW: /* delete annotations */ delete = 0; continue; case DRFTSW: /* draft message specified */ draft = ""; continue; case LISTSW: /* produce a listing */ list = 1; continue; case NUMBERSW: /* number listing or delete by number */ if (number != 0) adios (NULL, "only one number at a time!"); if (argp - arguments == argc - 1 || **argp == '-') number = 1; else { if (strcmp(*argp, "all") == 0) number = -1; else if (!(number = atoi(*argp))) adios (NULL, "missing argument to %s", argp[-2]); argp++; } delete = number; continue; case APPENDSW: /* append annotations instead of default prepend */ append = 1; continue; case PRESERVESW: /* preserve access and modification times on annotated message */ annopreserve(1); continue; case NOPRESERVESW: /* don't preserve access and modification times on annotated message (default) */ annopreserve(0); continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } /* * We're dealing with the draft message instead of message numbers. * Get the name of the draft and deal with it just as we do with * message numbers below. */ if (draft != (char *)0) { if (msgs.size != 0) adios(NULL, "can only have message numbers or -draft."); draft = getcpy(m_draft(folder, (char *)0, 1, &isdf)); make_comp(&comp); if (list) annolist(draft, comp, text, number); else annotate (draft, comp, text, inplace, datesw, delete, append); done(0); return 1; } if (!context_find ("path")) free (path ("./", TFOLDER)); if (!msgs.size) app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); make_comp (&comp); /* annotate all the SELECTED messages */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { if (list) annolist(m_name(msgnum), comp, text, number); else annotate (m_name (msgnum), comp, text, inplace, datesw, delete, append); } } context_replace (pfolder, folder); /* update current folder */ seq_setcur (mp, mp->lowsel); /* update current message */ seq_save (mp); /* synchronize message sequences */ folder_free (mp); /* free folder/message structure */ context_save (); /* save the context file */ done (0); return 1; } static void make_comp (unsigned char **ap) { register unsigned char *cp; char buffer[BUFSIZ]; if (*ap == NULL) { printf ("Enter component name: "); fflush (stdout); if (fgets (buffer, sizeof buffer, stdin) == NULL) done (1); *ap = trimcpy (buffer); } if ((cp = *ap + strlen (*ap) - 1) > *ap && *cp == ':') *cp = 0; if (strlen (*ap) == 0) adios (NULL, "null component name"); if (**ap == '-') adios (NULL, "invalid component name %s", *ap); if (strlen (*ap) >= NAMESZ) adios (NULL, "too large component name %s", *ap); for (cp = *ap; *cp; cp++) if (!isalnum (*cp) && *cp != '-') adios (NULL, "invalid component name %s", *ap); } nmh-1.5/uip/annosbr.c000644 007761 000765 00000027776 11762736346 014537 0ustar00kenhkenh000000 000000 /* * annosbr.c -- prepend annotation to messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include /* * static prototypes */ static int annosbr (int, char *, char *, char *, int, int, int, int); /* * This "local" global and the annopreserve() function are a hack that allows additional * functionality to be added to anno without piling on yet another annotate() argument. */ static int preserve_actime_and_modtime = 0; /* set to preserve access and modification times on annotated message */ int annotate (char *file, char *comp, char *text, int inplace, int datesw, int delete, int append) { int i, fd; struct utimbuf b; struct stat s; /* open and lock the file to be annotated */ if ((fd = lkopen (file, O_RDWR, 0)) == NOTOK) { switch (errno) { case ENOENT: break; default: admonish (file, "unable to lock and open"); break; } return 1; } if (stat(file, &s) == -1) { advise("can't get access and modification times for %s", file); preserve_actime_and_modtime = 0; } b.actime = s.st_atime; b.modtime = s.st_mtime; i = annosbr (fd, file, comp, text, inplace, datesw, delete, append); if (preserve_actime_and_modtime && utime(file, &b) == -1) advise("can't set access and modification times for %s", file); lkclose (fd, file); return i; } /* * Produce a listing of all header fields (annotations) whose field name matches * comp. Number the listing if number is set. Treate the field bodies as path * names and just output the last component unless text is non-NULL. We don't * care what text is set to. */ void annolist(char *file, char *comp, char *text, int number) { int c; /* current character */ int count; /* header field (annotation) counter */ char *cp; /* miscellaneous character pointer */ char *field; /* buffer for header field */ int field_size; /* size of field buffer */ FILE *fp; /* file pointer made from locked file descriptor */ int length; /* length of field name */ int n; /* number of bytes written */ char *sp; /* another miscellaneous character pointer */ if ((fp = fopen(file, "r")) == (FILE *)0) adios(file, "unable to open"); /* * Allocate a buffer to hold the header components as they're read in. * This buffer might need to be quite large, so we grow it as needed. */ field = (char *)mh_xmalloc(field_size = 256); /* * Get the length of the field name since we use it often. */ length = strlen(comp); count = 0; do { /* * Get a line from the input file, growing the field buffer as needed. We do this * so that we can fit an entire line in the buffer making it easy to do a string * comparison on both the field name and the field body which might be a long path * name. */ for (n = 0, cp = field; (c = getc(fp)) != EOF; *cp++ = c) { if (c == '\n' && (c = getc(fp)) != ' ' && c != '\t') { (void)ungetc(c, fp); c = '\n'; break; } if (++n >= field_size - 1) { field = (char *) mh_xrealloc((void *)field, field_size += 256); cp = field + n - 1; } } /* * NUL-terminate the field.. */ *cp = '\0'; if (strncasecmp(field, comp, length) == 0 && field[length] == ':') { for (cp = field + length + 1; *cp == ' ' || *cp == '\t'; cp++) ; if (number) (void)printf("%d\t", ++count); if (text == (char *)0 && (sp = strrchr(cp, '/')) != (char *)0) cp = sp + 1; (void)printf("%s\n", cp); } } while (*field != '\0' && *field != '-'); /* * Clean up. */ free(field); (void)fclose(fp); return; } /* * Set the preserve-times flag. This hack eliminates the need for an additional argument to annotate(). */ void annopreserve(int preserve) { preserve_actime_and_modtime = preserve; return; } static int annosbr (int fd, char *file, char *comp, char *text, int inplace, int datesw, int delete, int append) { int mode, tmpfd; char *cp, *sp; char buffer[BUFSIZ], tmpfil[BUFSIZ]; struct stat st; FILE *tmp; int c; /* current character */ int count; /* header field (annotation) counter */ char *field = NULL; /* buffer for header field */ int field_size = 0; /* size of field buffer */ FILE *fp = NULL; /* file pointer made from locked file descriptor */ int length; /* length of field name */ int n; /* number of bytes written */ mode = fstat (fd, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot (); strncpy (tmpfil, m_mktemp2(file, "annotate", NULL, &tmp), sizeof(tmpfil)); chmod (tmpfil, mode); /* * We're going to need to copy some of the message file to the temporary * file while examining the contents. Convert the message file descriptor * to a file pointer since it's a lot easier and more efficient to use * stdio for this. Also allocate a buffer to hold the header components * as they're read in. This buffer is grown as needed later. */ if (delete >= -1 || append != 0) { if ((fp = fdopen(fd, "r")) == (FILE *)0) adios(NULL, "unable to fdopen file."); field = (char *)mh_xmalloc(field_size = 256); } /* * We're trying to delete a header field (annotation )if the delete flag is * not -2 or less. A value greater than zero means that we're deleting the * nth header field that matches the field (component) name. A value of * zero means that we're deleting the first field in which both the field * name matches the component name and the field body matches the text. * The text is matched in its entirety if it begins with a slash; otherwise * the text is matched against whatever portion of the field body follows * the last slash. This allows matching of both absolute and relative path * names. This is because this functionality was added to support attachments. * It might be worth having a separate flag to indicate path name matching to * make it more general. A value of -1 means to delete all matching fields. */ if (delete >= -1) { /* * Get the length of the field name since we use it often. */ length = strlen(comp); /* * Initialize the field counter. This is only used if we're deleting by * number. */ count = 0; /* * Copy lines from the input file to the temporary file until we either find the one * that we're looking for (which we don't copy) or we reach the end of the headers. * Both a blank line and a line beginning with a - terminate the headers so that we * can handle both drafts and RFC-2822 format messages. */ do { /* * Get a line from the input file, growing the field buffer as needed. We do this * so that we can fit an entire line in the buffer making it easy to do a string * comparison on both the field name and the field body which might be a long path * name. */ for (n = 0, cp = field; (c = getc(fp)) != EOF; *cp++ = c) { if (c == '\n' && (c = getc(fp)) != ' ' && c != '\t') { (void)ungetc(c, fp); c = '\n'; break; } if (++n >= field_size - 1) { field = (char *) mh_xrealloc((void *)field, field_size *= 2); cp = field + n - 1; } } /* * NUL-terminate the field.. */ *cp = '\0'; /* * Check for a match on the field name. We delete the line by not copying it to the * temporary file if * * o The delete flag is 0, meaning that we're going to delete the first matching * field, and the text is NULL meaning that we don't care about the field body. * * o The delete flag is 0, meaning that we're going to delete the first matching * field, and the text begins with a / meaning that we're looking for a full * path name, and the text matches the field body. * * o The delete flag is 0, meaning that we're going to delete the first matching * field, the text does not begin with a / meaning that we're looking for the * last path name component, and the last path name component matches the text. * * o The delete flag is positive meaning that we're going to delete the nth field * with a matching field name, and this is the nth matching field name. * * o The delete flag is -1 meaning that we're going to delete all fields with a * matching field name. */ if (strncasecmp(field, comp, length) == 0 && field[length] == ':') { if (delete == 0) { if (text == (char *)0) break; for (cp = field + length + 1; *cp == ' ' || *cp == '\t'; cp++) ; if (*text == '/') { if (strcmp(cp, text) == 0) break; } else { if ((sp = strrchr(cp, '/')) != (char *)0) cp = sp + 1; if (strcmp(cp, text) == 0) break; } } else if (delete == -1) continue; else if (++count == delete) break; } /* * This line wasn't a match so copy it to the temporary file. */ if ((n = fputs(field, tmp)) == EOF || (c == '\n' && fputc('\n', tmp) == EOF)) adios(NULL, "unable to write temporary file."); } while (*field != '\0' && *field != '-'); /* * Get rid of the field buffer because we're done with it. */ free((void *)field); } else { /* * Find the end of the headers before adding the annotations if we're * appending instead of the default prepending. A special check for * no headers is needed if appending. */ if (append) { /* * Copy lines from the input file to the temporary file until we * reach the end of the headers. */ if ((c = getc(fp)) == '\n') rewind(fp); else { (void)putc(c, tmp); while ((c = getc(fp)) != EOF) { (void)putc(c, tmp); if (c == '\n') { (void)ungetc(c = getc(fp), fp); if (c == '\n' || c == '-') break; } } } } if (datesw) fprintf (tmp, "%s: %s\n", comp, dtimenow (0)); if ((cp = text)) { do { while (*cp == ' ' || *cp == '\t') cp++; sp = cp; while (*cp && *cp++ != '\n') continue; if (cp - sp) fprintf (tmp, "%s: %*.*s", comp, (int)(cp - sp), (int)(cp - sp), sp); } while (*cp); if (cp[-1] != '\n' && cp != text) putc ('\n', tmp); } } fflush (tmp); /* * We've been messing with the input file position. Move the input file * descriptor to the current place in the file because the stock data * copying routine uses the descriptor, not the pointer. */ if (append || delete >= -1) { if (lseek(fd, (off_t)ftell(fp), SEEK_SET) == (off_t)-1) adios(NULL, "can't seek."); } cpydata (fd, fileno (tmp), file, tmpfil); fclose (tmp); if (inplace) { if ((tmpfd = open (tmpfil, O_RDONLY)) == NOTOK) adios (tmpfil, "unable to open for re-reading"); lseek (fd, (off_t) 0, SEEK_SET); /* * We're making the file shorter if we're deleting a header field * so the file has to be truncated or it will contain garbage. */ if (delete >= -1 && ftruncate(fd, 0) == -1) adios(tmpfil, "unable to truncate."); cpydata (tmpfd, fd, tmpfil, file); close (tmpfd); unlink (tmpfil); } else { strncpy (buffer, m_backup (file), sizeof(buffer)); if (rename (file, buffer) == NOTOK) { switch (errno) { case ENOENT: /* unlinked early - no annotations */ unlink (tmpfil); break; default: admonish (buffer, "unable to rename %s to", file); break; } return 1; } if (rename (tmpfil, file) == NOTOK) { admonish (file, "unable to rename %s to", tmpfil); return 1; } } /* * Close the delete file so that we don't run out of file pointers if * we're doing piles of files. Note that this will make the close() in * lkclose() fail, but that failure is ignored so it's not a problem. */ if (delete >= -1) (void)fclose(fp); return 0; } nmh-1.5/uip/ap.c000644 007761 000765 00000010247 11765267273 013457 0ustar00kenhkenh000000 000000 /* * ap.c -- parse addresses 822-style * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #define NADDRS 100 #define WIDTH 78 #define WBUFSIZ BUFSIZ #define FORMAT "%<{error}%{error}: %{text}%|%(putstr(proper{text}))%>" static struct swit switches[] = { #define FORMSW 0 { "form formatfile", 0 }, #define FMTSW 1 { "format string", 5 }, #define NORMSW 2 { "normalize", 0 }, #define NNORMSW 3 { "nonormalize", 0 }, #define WIDTHSW 4 { "width columns", 0 }, #define VERSIONSW 5 { "version", 0 }, #define HELPSW 6 { "help", 0 }, { NULL, 0 } }; static struct format *fmt; static int dat[5]; /* * static prototypes */ static int process (char *, int, int); int main (int argc, char **argv) { int addrp = 0, normalize = AD_HOST; int width = 0, status = 0; char *cp, *form = NULL, *format = NULL, *nfs; char buf[BUFSIZ], **argp; char **arguments, *addrs[NADDRS]; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] addrs ...", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version (invo_name); done (1); case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') adios (NULL, "missing argument to %s", argp[-2]); form = NULL; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); width = atoi (cp); continue; case NORMSW: normalize = AD_HOST; continue; case NNORMSW: normalize = AD_NHST; continue; } } if (addrp > NADDRS) adios (NULL, "more than %d addresses", NADDRS); else addrs[addrp++] = cp; } addrs[addrp] = NULL; if (addrp == 0) adios (NULL, "usage: %s [switches] addrs ...", invo_name); /* get new format string */ nfs = new_fs (form, format, FORMAT); if (width == 0) { if ((width = sc_width ()) < WIDTH / 2) width = WIDTH / 2; width -= 2; } if (width > WBUFSIZ) width = WBUFSIZ; fmt_norm = normalize; fmt_compile (nfs, &fmt); dat[0] = 0; dat[1] = 0; dat[2] = 0; dat[3] = width; dat[4] = 0; for (addrp = 0; addrs[addrp]; addrp++) status += process (addrs[addrp], width, normalize); done (status); return 1; } struct pqpair { char *pq_text; char *pq_error; struct pqpair *pq_next; }; static int process (char *arg, int length, int norm) { int status = 0; register char *cp; char buffer[WBUFSIZ + 1], error[BUFSIZ]; register struct comp *cptr; register struct pqpair *p, *q; struct pqpair pq; register struct mailname *mp; (q = &pq)->pq_next = NULL; while ((cp = getname (arg))) { if ((p = (struct pqpair *) calloc ((size_t) 1, sizeof(*p))) == NULL) adios (NULL, "unable to allocate pqpair memory"); if ((mp = getm (cp, NULL, 0, norm, error)) == NULL) { p->pq_text = getcpy (cp); p->pq_error = getcpy (error); status++; } else { p->pq_text = getcpy (mp->m_text); mnfree (mp); } q = (q->pq_next = p); } for (p = pq.pq_next; p; p = q) { FINDCOMP (cptr, "text"); if (cptr) cptr->c_text = p->pq_text; FINDCOMP (cptr, "error"); if (cptr) cptr->c_text = p->pq_error; fmt_scan (fmt, buffer, length, dat); fputs (buffer, stdout); free (p->pq_text); if (p->pq_error) free (p->pq_error); q = p->pq_next; free ((char *) p); } return status; } nmh-1.5/uip/burst.c000644 007761 000765 00000027331 11765267273 014220 0ustar00kenhkenh000000 000000 /* * burst.c -- explode digests into individual messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include static struct swit switches[] = { #define INPLSW 0 { "inplace", 0 }, #define NINPLSW 1 { "noinplace", 0 }, #define QIETSW 2 { "quiet", 0 }, #define NQIETSW 3 { "noquiet", 0 }, #define VERBSW 4 { "verbose", 0 }, #define NVERBSW 5 { "noverbose", 0 }, #define VERSIONSW 6 { "version", 0 }, #define HELPSW 7 { "help", 0 }, { NULL, 0 } }; struct smsg { off_t s_start; off_t s_stop; }; /* * static prototypes */ static int find_delim (int, struct smsg *); static void burst (struct msgs **, int, struct smsg *, int, int, int, char *); static void cpybrst (FILE *, FILE *, char *, char *, int); /* * A macro to check to see if we have reached a message delimiter * (an encapsulation boundary, EB, in RFC 934 parlance). * * According to RFC 934, an EB is simply a line which starts with * a "-" and is NOT followed by a space. So even a single "-" on a line * by itself would be an EB. */ #define CHECKDELIM(buffer) (buffer[0] == '-' && buffer[1] != ' ') int main (int argc, char **argv) { int inplace = 0, quietsw = 0, verbosw = 0; int msgp = 0, hi, msgnum, numburst; char *cp, *maildir, *folder = NULL, buf[BUFSIZ]; char **argp, **arguments, *msgs[MAXARGS]; struct smsg *smsgs; struct msgs *mp; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case INPLSW: inplace++; continue; case NINPLSW: inplace = 0; continue; case QIETSW: quietsw++; continue; case NQIETSW: quietsw = 0; continue; case VERBSW: verbosw++; continue; case NVERBSW: verbosw = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { msgs[msgp++] = cp; } } if (!context_find ("path")) free (path ("./", TFOLDER)); if (!msgp) msgs[msgp++] = "cur"; if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ smsgs = (struct smsg *) calloc ((size_t) (MAXFOLDER + 2), sizeof(*smsgs)); if (smsgs == NULL) adios (NULL, "unable to allocate burst storage"); hi = mp->hghmsg + 1; /* burst all the SELECTED messages */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) { if ((numburst = find_delim (msgnum, smsgs)) >= 1) { if (verbosw) printf ("%d message%s exploded from digest %d\n", numburst, numburst > 1 ? "s" : "", msgnum); burst (&mp, msgnum, smsgs, numburst, inplace, verbosw, maildir); } else { if (numburst == 0) { if (!quietsw) admonish (NULL, "message %d not in digest format", msgnum); } /* this pair of braces was missing before 1999-07-15 */ else adios (NULL, "burst() botch -- you lose big"); } } } free ((char *) smsgs); context_replace (pfolder, folder); /* update current folder */ /* * If -inplace is given, then the first message burst becomes * the current message (which will now show a table of contents). * Otherwise, the first message extracted from the first digest * becomes the current message. */ if (inplace) { if (mp->lowsel != mp->curmsg) seq_setcur (mp, mp->lowsel); } else { if (hi <= mp->hghmsg) seq_setcur (mp, hi); } seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ done (0); return 1; } /* * Scan the message and find the beginning and * end of all the messages in the digest. */ static int find_delim (int msgnum, struct smsg *smsgs) { int wasdlm = 0, msgp; off_t pos; char c, *msgnam; char buffer[BUFSIZ]; FILE *in; if ((in = fopen (msgnam = m_name (msgnum), "r")) == NULL) adios (msgnam, "unable to read message"); for (msgp = 0, pos = 0L; msgp <= MAXFOLDER;) { /* * We're either at the beginning of the whole message, or * we're just past the delimiter of the last message. * Swallow lines until we get to something that's not a newline */ while (fgets (buffer, sizeof(buffer), in) && buffer[0] == '\n') pos += (long) strlen (buffer); if (feof (in)) break; /* * Reset to the beginning of the last non-blank line, and save our * starting position. This is where the encapsulated message * starts. */ fseeko (in, pos, SEEK_SET); smsgs[msgp].s_start = pos; /* * Read in lines until we get to a message delimiter. * * Previously we checked to make sure the preceeding line and * next line was a newline. That actually does not comply with * RFC 934, so make sure we break on a message delimiter even * if the previous character was NOT a newline. */ for (c = 0; fgets (buffer, sizeof(buffer), in); c = buffer[0]) { if ((wasdlm = CHECKDELIM(buffer))) break; else pos += (long) strlen (buffer); } /* * Only count as a new message if we got the message delimiter. * Swallow a blank line if it was right before the message delimiter. */ if (smsgs[msgp].s_start != pos && wasdlm) smsgs[msgp++].s_stop = (c == '\n' && wasdlm) ? pos - 1 : pos; if (feof (in)) { #if 0 if (wasdlm) { smsgs[msgp - 1].s_stop -= ((long) strlen (buffer) + 1); msgp++; /* fake "End of XXX Digest" */ } #endif break; } pos += (long) strlen (buffer); } fclose (in); return (msgp - 1); /* return the number of messages burst */ } /* * Burst out the messages in the digest into the folder */ static void burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst, int inplace, int verbosw, char *maildir) { int i, j, mode; char *msgnam; char f1[BUFSIZ], f2[BUFSIZ], f3[BUFSIZ]; FILE *in, *out; struct stat st; struct msgs *mp; if ((in = fopen (msgnam = m_name (msgnum), "r")) == NULL) adios (msgnam, "unable to read message"); mode = fstat (fileno(in), &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot(); mp = *mpp; /* * See if we have enough space in the folder * structure for all the new messages. */ if ((mp->hghmsg + numburst > mp->hghoff) && !(mp = folder_realloc (mp, mp->lowoff, mp->hghmsg + numburst))) adios (NULL, "unable to allocate folder storage"); *mpp = mp; j = mp->hghmsg; /* old value */ mp->hghmsg += numburst; mp->nummsg += numburst; /* * If this is not the highest SELECTED message, then * increment mp->hghsel by numburst, since the highest * SELECTED is about to be slid down by that amount. */ if (msgnum < mp->hghsel) mp->hghsel += numburst; /* * If -inplace is given, renumber the messages after the * source message, to make room for each of the messages * contained within the digest. * * This is equivalent to refiling a message from the point * of view of the external hooks. */ if (inplace) { for (i = mp->hghmsg; j > msgnum; i--, j--) { strncpy (f1, m_name (i), sizeof(f1)); strncpy (f2, m_name (j), sizeof(f2)); if (does_exist (mp, j)) { if (verbosw) printf ("message %d becomes message %d\n", j, i); if (rename (f2, f1) == NOTOK) admonish (f1, "unable to rename %s to", f2); (void)snprintf(f1, sizeof (f1), "%s/%d", maildir, i); (void)snprintf(f2, sizeof (f2), "%s/%d", maildir, j); ext_hook("ref-hook", f1, f2); copy_msg_flags (mp, i, j); clear_msg_flags (mp, j); mp->msgflags |= SEQMOD; } } } unset_selected (mp, msgnum); /* new hghmsg is hghmsg + numburst * * At this point, there is an array of numburst smsgs, each element of * which contains the starting and stopping offsets (seeks) of the message * in the digest. The inplace flag is set if the original digest is replaced * by a message containing the table of contents. smsgs[0] is that table of * contents. Go through the message numbers in reverse order (high to low). * * Set f1 to the name of the destination message, f2 to the name of a scratch * file. Extract a message from the digest to the scratch file. Move the * original message to a backup file if the destination message number is the * same as the number of the original message, which only happens if the * inplace flag is set. Then move the scratch file to the destination message. * * Moving the original message to the backup file is equivalent to deleting the * message from the point of view of the external hooks. And bursting each * message is equivalent to adding a new message. */ i = inplace ? msgnum + numburst : mp->hghmsg; for (j = numburst; j >= (inplace ? 0 : 1); i--, j--) { strncpy (f1, m_name (i), sizeof(f1)); strncpy (f2, m_mktemp(invo_name, NULL, &out), sizeof(f2)); if (verbosw && i != msgnum) printf ("message %d of digest %d becomes message %d\n", j, msgnum, i); chmod (f2, mode); fseeko (in, smsgs[j].s_start, SEEK_SET); cpybrst (in, out, msgnam, f2, (int) (smsgs[j].s_stop - smsgs[j].s_start)); fclose (out); if (i == msgnum) { strncpy (f3, m_backup (f1), sizeof(f3)); if (rename (f1, f3) == NOTOK) admonish (f3, "unable to rename %s to", f1); (void)snprintf(f3, sizeof (f3), "%s/%d", maildir, i); ext_hook("del-hook", f3, (char *)0); } if (rename (f2, f1) == NOTOK) admonish (f1, "unable to rename %s to", f2); (void)snprintf(f3, sizeof (f3), "%s/%d", maildir, i); ext_hook("add-hook", f3, (char *)0); copy_msg_flags (mp, i, msgnum); mp->msgflags |= SEQMOD; } fclose (in); } #define S1 0 #define S2 1 #define S3 2 /* * Copy a mesage which is being burst out of a digest. * It will remove any "dashstuffing" in the message. */ static void cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len) { register int c, state; for (state = S1; (c = fgetc (in)) != EOF && len > 0; len--) { if (c == 0) continue; switch (state) { case S1: switch (c) { case '-': state = S3; break; default: state = S2; case '\n': fputc (c, out); break; } break; case S2: switch (c) { case '\n': state = S1; default: fputc (c, out); break; } break; case S3: switch (c) { case ' ': state = S2; break; default: state = (c == '\n') ? S1 : S2; fputc ('-', out); fputc (c, out); break; } break; } } if (ferror (in) && !feof (in)) adios (ifile, "error reading"); if (ferror (out)) adios (ofile, "error writing"); } nmh-1.5/uip/comp.c000644 007761 000765 00000022652 11765267273 014020 0ustar00kenhkenh000000 000000 /* * comp.c -- compose a message * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include static struct swit switches[] = { #define DFOLDSW 0 { "draftfolder +folder", 0 }, #define DMSGSW 1 { "draftmessage msg", 0 }, #define NDFLDSW 2 { "nodraftfolder", 0 }, #define EDITRSW 3 { "editor editor", 0 }, #define NEDITSW 4 { "noedit", 0 }, #define FILESW 5 { "file file", 0 }, #define FORMSW 6 { "form formfile", 0 }, #define USESW 7 { "use", 0 }, #define NUSESW 8 { "nouse", 0 }, #define WHATSW 9 { "whatnowproc program", 0 }, #define NWHATSW 10 { "nowhatnowproc", 0 }, #define VERSIONSW 11 { "version", 0 }, #define HELPSW 12 { "help", 0 }, #define TOSW 13 { "to address", 0 }, #define CCSW 14 { "cc address", 0 }, #define FROMSW 15 { "from address", 0 }, #define FCCSW 16 { "fcc mailbox", 0 }, #define WIDTHSW 17 { "width colums", 0 }, #define SUBJECTSW 18 { "subject text", 0 }, { NULL, 0 } }; static struct swit aqrunl[] = { #define NOSW 0 { "quit", 0 }, #define YESW 1 { "replace", 0 }, #define USELSW 2 { "use", 0 }, #define LISTDSW 3 { "list", 0 }, #define REFILSW 4 { "refile +folder", 0 }, #define NEWSW 5 { "new", 0 }, { NULL, 0 } }; static struct swit aqrul[] = { { "quit", 0 }, { "replace", 0 }, { "use", 0 }, { "list", 0 }, { "refile", 0 }, { NULL, 0 } }; int main (int argc, char **argv) { int use = NOUSE, nedit = 0, nwhat = 0; int i, in = NOTOK, isdf = 0, out, dat[5], format_len = 0; int outputlinelen = OUTPUTLINELEN; char *cp, *cwd, *maildir, *dfolder = NULL; char *ed = NULL, *file = NULL, *form = NULL; char *folder = NULL, *msg = NULL, buf[BUFSIZ]; char *to = NULL, *from = NULL, *cc = NULL, *fcc = NULL, *dp; char *subject = NULL; char drft[BUFSIZ], **argp, **arguments; struct msgs *mp = NULL; struct format *fmt; struct stat st; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case EDITRSW: if (!(ed = *argp++) || *ed == '-') adios (NULL, "missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: nedit++; continue; case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') adios (NULL, "missing argument to %s", argp[-2]); nwhat = 0; continue; case NWHATSW: nwhat++; continue; case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case USESW: use++; continue; case NUSESW: use = NOUSE; continue; case FILESW: /* compatibility */ if (file) adios (NULL, "only one file at a time!"); if (!(file = *argp++) || *file == '-') adios (NULL, "missing argument to %s", argp[-2]); isdf = NOTOK; continue; case DFOLDSW: if (dfolder) adios (NULL, "only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (file) adios (NULL, "only one draft message at a time!"); if (!(file = *argp++) || *file == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; isdf = NOTOK; continue; case TOSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); to = addlist(to, cp); continue; case CCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); cc = addlist(cc, cp); continue; case FROMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); from = addlist(from, cp); continue; case FCCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dp = NULL; if (*cp == '@') cp = dp = path(cp + 1, TSUBCWF); fcc = addlist(fcc, cp); if (dp) free(dp); continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((outputlinelen = atoi(cp)) < 10) adios (NULL, "impossible width %d", outputlinelen); continue; case SUBJECTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); subject = cp; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { if (msg) adios (NULL, "only one message at a time!"); else msg = cp; } } cwd = getcpy (pwd ()); if (!context_find ("path")) free (path ("./", TFOLDER)); /* * Check if we are using a draft folder * and have specified a message in it. */ if ((dfolder || context_find ("Draft-Folder")) && !folder && msg && !file) { file = msg; msg = NULL; } if (form && (folder || msg)) adios (NULL, "can't mix forms and folders/msgs"); cp = NULL; if (folder || msg) { /* * Use a message as the "form" for the new message. */ if (!msg) msg = "cur"; if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse the message range/sequence/name and set SELECTED */ if (!m_convert (mp, msg)) done (1); seq_setprev (mp); /* set the previous-sequence */ if (mp->numsel > 1) adios (NULL, "only one message at a time!"); if ((in = open (form = getcpy (m_name (mp->lowsel)), O_RDONLY)) == NOTOK) adios (form, "unable to open message"); } else { struct comp *cptr; if (! form) form = components; cp = new_fs(form, NULL, NULL); format_len = strlen(cp); fmt_compile(cp, &fmt); /* * Set up any components that were fed to us on the command line */ if (from) { FINDCOMP(cptr, "from"); if (cptr) cptr->c_text = from; } if (to) { FINDCOMP(cptr, "to"); if (cptr) cptr->c_text = to; } if (cc) { FINDCOMP(cptr, "cc"); if (cptr) cptr->c_text = cc; } if (fcc) { FINDCOMP(cptr, "fcc"); if (cptr) cptr->c_text = fcc; } if (subject) { FINDCOMP(cptr, "subject"); if (cptr) cptr->c_text = subject; } } try_it_again: strncpy (drft, m_draft (dfolder, file, use, &isdf), sizeof(drft)); /* * Check if we have an existing draft */ if ((out = open (drft, O_RDONLY)) != NOTOK) { i = fdcompare (in, out); close (out); /* * If we have given -use flag, or if the * draft is just the same as the components * file, then no need to ask any questions. */ if (use || i) goto edit_it; if (stat (drft, &st) == NOTOK) adios (drft, "unable to stat"); printf ("Draft \"%s\" exists (%ld bytes).", drft, (long) st.st_size); for (i = LISTDSW; i != YESW;) { if (!(argp = getans ("\nDisposition? ", isdf ? aqrunl : aqrul))) done (1); switch (i = smatch (*argp, isdf ? aqrunl : aqrul)) { case NOSW: done (0); case NEWSW: file = NULL; use = NOUSE; goto try_it_again; case YESW: break; case USELSW: use++; goto edit_it; case LISTDSW: showfile (++argp, drft); break; case REFILSW: if (refile (++argp, drft) == 0) i = YESW; break; default: advise (NULL, "say what?"); break; } } } else { if (use) adios (drft, "unable to open"); } if ((out = creat (drft, m_gmprot ())) == NOTOK) adios (drft, "unable to create"); if (cp) { char *scanl; i = format_len + 1024; scanl = mh_xmalloc((size_t) i + 2); dat[0] = 0; dat[1] = 0; dat[2] = 0; dat[3] = outputlinelen; dat[4] = 0; fmt_scan(fmt, scanl, i, dat); write(out, scanl, strlen(scanl)); free(scanl); } else { cpydata (in, out, form, drft); close (in); } close (out); edit_it: context_save (); /* save the context file */ if (nwhat) done (0); what_now (ed, nedit, use, drft, NULL, 0, NULLMP, NULL, 0, cwd, 0); done (1); return 1; } nmh-1.5/uip/conflict.c000644 007761 000765 00000016456 11765267273 014670 0ustar00kenhkenh000000 000000 /* * conflict.c -- check for conflicts in mail system * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include /* * maximum number of directories that can * be specified using -search switch. */ #define NDIRS 100 /* * Add space for group names, 100 at a time */ #define NGRPS 100 static struct swit switches[] = { #define MAILSW 0 { "mail name", 0 }, #define SERCHSW 1 { "search directory", 0 }, #define VERSIONSW 2 { "version", 0 }, #define HELPSW 3 { "help", 0 }, { NULL, 0 } }; static char *mail = NULL; static char *dirs[NDIRS]; static FILE *out = NULL; extern struct aka *akahead; extern struct home *homehead; /* * prototypes */ void alias_files (int, char **); void pwd_names (void); void grp_names (void); void grp_members (void); void grp_ids (void); void maildrops (void); void mdrop(char *); int check (char *); void setup (void); int main (int argc, char **argv) { int akp = 0, dp = 0; char *cp, **argp, **arguments; char buf[BUFSIZ], *akv[50]; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* foil search of user profile/context */ if (context_foil (NULL) == -1) done (1); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 0); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [aliasfiles ...]", invo_name); print_help (buf, switches, 0); done (1); case VERSIONSW: print_version(invo_name); done (1); case MAILSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (mail) adios (NULL, "mail to one address only"); else mail = cp; continue; case SERCHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (dp >= NDIRS) adios (NULL, "more than %d directories", NDIRS); dirs[dp++] = cp; continue; } } akv[akp++] = cp; } if (akp == 0) akv[akp++] = AliasFile; if (!homehead) init_pw (); if (!mail) out = stdout; dirs[dp] = NULL; alias_files (akp, akv); pwd_names (); grp_names (); grp_members (); grp_ids (); maildrops (); done (0); return 1; } void alias_files (int akp, char **akv) { register int i, err; for (i = 0; i < akp; i++) if ((err = alias (akv[i])) != AK_OK) { setup (); fprintf (out, "aliasing error in %s - %s\n", akv[i], akerror (err)); } else if (out && !mail) fprintf (out, "alias file %s is ok\n", akv[i]); } void pwd_names (void) { int hit = 0; register struct home *hm, *lm; for (hm = homehead; hm; hm = hm->h_next) for (lm = hm->h_next; lm; lm = lm->h_next) if (strcmp (hm->h_name, lm->h_name) == 0) { setup (); fprintf (out, "duplicate user %s(uid=%d)\n", lm->h_name, (int) lm->h_uid); hit++; } if (!hit && out && !mail) fprintf (out, "no duplicate users\n"); } void grp_names (void) { int numgroups, maxgroups; int i, hit = 0; char **grps; struct group *gr; /* allocate space NGRPS at a time */ numgroups = 0; maxgroups = NGRPS; grps = (char **) mh_xmalloc((size_t) (maxgroups * sizeof(*grps))); setgrent (); while ((gr = getgrent ())) { for (i = 0; i < numgroups; i++) if (!strcmp (grps[i], gr->gr_name)) { setup (); fprintf (out, "duplicate group %s(gid=%d)\n", gr->gr_name, (int) gr->gr_gid); hit++; break; } if (i >= numgroups) { if (numgroups >= maxgroups) { maxgroups += NGRPS; grps = (char **) mh_xrealloc(grps, (size_t) (maxgroups * sizeof(*grps))); } grps[numgroups++] = getcpy (gr->gr_name); } } endgrent (); for (i = 0; i < numgroups; i++) free (grps[i]); free (grps); if (!hit && out && !mail) fprintf (out, "no duplicate groups\n"); } void grp_members (void) { register int hit = 0; register char **cp, **dp; register struct group *gr; register struct home *hm; setgrent (); while ((gr = getgrent ())) { for (cp = gr->gr_mem; *cp; cp++) { for (hm = homehead; hm; hm = hm->h_next) if (!strcmp (*cp, hm->h_name)) break; if (hm == NULL) { setup (); fprintf (out, "group %s(gid=%d) has unknown member %s\n", gr->gr_name, (int) gr->gr_gid, *cp); hit++; } else { hm->h_ngrps++; } for (dp = cp + 1; *dp; dp++) if (strcmp (*cp, *dp) == 0) { setup (); fprintf (out, "group %s(gid=%d) has duplicate member %s\n", gr->gr_name, (int) gr->gr_gid, *cp); hit++; } } } endgrent (); for (hm = homehead; hm; hm = hm->h_next) if (hm->h_ngrps > NGROUPS_MAX) { setup (); fprintf (out, "user %s is a member of %d groups (max %d)\n", hm->h_name, hm->h_ngrps, NGROUPS_MAX); hit++; } if (!hit && out && !mail) fprintf (out, "all group members accounted for\n"); } void grp_ids (void) { /* -DRAND not implemented at most places */ register int hit = 0; register struct home *hm; for (hm = homehead; hm; hm = hm->h_next) if (getgrgid (hm->h_gid) == NULL) { setup (); fprintf (out, "user %s(uid=%d) has unknown group-id %d\n", hm->h_name, (int) hm->h_uid, (int) hm->h_gid); hit++; } if (!hit && out && !mail) fprintf (out, "all group-id users accounted for\n"); } void maildrops (void) { register int i; if (mmdfldir && *mmdfldir) mdrop (mmdfldir); if (uucpldir && *uucpldir) mdrop (uucpldir); for (i = 0; dirs[i]; i++) mdrop (dirs[i]); } void mdrop(char *drop) { register int hit = 0; register struct dirent *dp; register DIR *dd = opendir (drop); if (!dd) { setup (); fprintf (out, "unable to open maildrop area %s\n", drop); return; } while ((dp = readdir (dd))) if (dp->d_name[0] != '.' && !check (dp->d_name)) { setup (); fprintf (out, "there is a maildrop for the unknown user %s in %s\n", dp->d_name, drop); hit++; } closedir (dd); if (!hit && out && !mail) fprintf (out, "all maildrops accounted for in %s\n", drop); } int check (char *s) { register struct home *hm; for (hm = homehead; hm; hm = hm->h_next) if (!strcmp (s, hm->h_name)) return 1; return 0; } void setup (void) { int fd, pd[2]; if (out) return; if (mail) { if (pipe (pd) == NOTOK) adios ("pipe", "unable to"); switch (fork ()) { case NOTOK: adios ("fork", "unable to"); case OK: close (pd[1]); if (pd[0] != 0) { dup2 (pd[0], 0); close (pd[0]); } if ((fd = open ("/dev/null", O_WRONLY)) != NOTOK) if (fd != 1) { dup2 (fd, 1); close (fd); } execlp (mailproc, r1bindex (mailproc, '/'), mail, "-subject", invo_name, NULL); adios (mailproc, "unable to exec "); default: close (pd[0]); out = fdopen (pd[1], "w"); fprintf (out, "%s: the following is suspicious\n\n", invo_name); } } } nmh-1.5/uip/dist.c000644 007761 000765 00000020107 11765267273 014016 0ustar00kenhkenh000000 000000 /* * dist.c -- re-distribute a message * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include static struct swit switches[] = { #define ANNOSW 0 { "annotate", 0 }, #define NANNOSW 1 { "noannotate", 0 }, #define DFOLDSW 2 { "draftfolder +folder", 0 }, #define DMSGSW 3 { "draftmessage msg", 0 }, #define NDFLDSW 4 { "nodraftfolder", 0 }, #define EDITRSW 5 { "editor editor", 0 }, #define NEDITSW 6 { "noedit", 0 }, #define FORMSW 7 { "form formfile", 0 }, #define INPLSW 8 { "inplace", 0 }, #define NINPLSW 9 { "noinplace", 0 }, #define WHATSW 10 { "whatnowproc program", 0 }, #define NWHATSW 11 { "nowhatnowproc", 0 }, #define VERSIONSW 12 { "version", 0 }, #define HELPSW 13 { "help", 0 }, #define FILESW 14 { "file file", -4 }, /* interface from msh */ #define FROMSW 15 { "from address", 0 }, #define TOSW 16 { "to address", 0 }, #define CCSW 17 { "cc address", 0 }, #define FCCSW 18 { "fcc mailbox", 0 }, #define WIDTHSW 19 { "width columns", 0 }, #define ATFILESW 20 { "atfile", 0 }, #define NOATFILESW 21 { "noatfile", 0 }, { NULL, 0 } }; static struct swit aqrnl[] = { #define NOSW 0 { "quit", 0 }, #define YESW 1 { "replace", 0 }, #define LISTDSW 2 { "list", 0 }, #define REFILSW 3 { "refile +folder", 0 }, #define NEWSW 4 { "new", 0 }, { NULL, 0 } }; static struct swit aqrl[] = { { "quit", 0 }, { "replace", 0 }, { "list", 0 }, { "refile +folder", 0 }, { NULL, 0 } }; int main (int argc, char **argv) { int anot = 0, inplace = 1, nedit = 0; int nwhat = 0, i, in, isdf = 0, out; int outputlinelen = OUTPUTLINELEN; int dat[5], atfile = 1; char *cp, *cwd, *maildir, *msgnam, *dfolder = NULL; char *dmsg = NULL, *ed = NULL, *file = NULL, *folder = NULL; char *form = NULL, *msg = NULL, buf[BUFSIZ], drft[BUFSIZ]; char *from = NULL, *to = NULL, *cc = NULL, *fcc = NULL; char **argp, **arguments; struct msgs *mp = NULL; struct stat st; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case ANNOSW: anot++; continue; case NANNOSW: anot = 0; continue; case EDITRSW: if (!(ed = *argp++) || *ed == '-') adios (NULL, "missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: nedit++; continue; case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') adios (NULL, "missing argument to %s", argp[-2]); nwhat = 0; continue; case NWHATSW: nwhat++; continue; case FILESW: if (file) adios (NULL, "only one file at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case INPLSW: inplace++; continue; case NINPLSW: inplace = 0; continue; case DFOLDSW: if (dfolder) adios (NULL, "only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) adios (NULL, "only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; isdf = NOTOK; continue; case FROMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); from = addlist(from, cp); continue; case TOSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); to = addlist(to, cp); continue; case CCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); cc = addlist(cc, cp); continue; case FCCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); fcc = addlist(fcc, cp); continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((outputlinelen = atoi(cp)) < 10) adios (NULL, "impossible width %d", outputlinelen); continue; case ATFILESW: atfile++; continue; case NOATFILESW: atfile = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { if (msg) adios (NULL, "only one message at a time!"); else msg = cp; } } cwd = getcpy (pwd ()); if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && (msg || folder)) adios (NULL, "can't mix files and folders/msgs"); try_it_again: strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft)); /* Check if draft already exists */ if (stat (drft, &st) != NOTOK) { printf ("Draft \"%s\" exists (%ld bytes).", drft, (long) st.st_size); for (i = LISTDSW; i != YESW;) { if (!(argp = getans ("\nDisposition? ", isdf ? aqrnl : aqrl))) done (1); switch (i = smatch (*argp, isdf ? aqrnl : aqrl)) { case NOSW: done (0); case NEWSW: dmsg = NULL; goto try_it_again; case YESW: break; case LISTDSW: showfile (++argp, drft); break; case REFILSW: if (refile (++argp, drft) == 0) i = YESW; break; default: advise (NULL, "say what?"); break; } } } if (file) { /* * Dist a file */ anot = 0; /* don't want to annotate a file */ } else { /* * Dist a message */ if (!msg) msg = "cur"; if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse the message range/sequence/name and set SELECTED */ if (!m_convert (mp, msg)) done (1); seq_setprev (mp); /* set the previous-sequence */ if (mp->numsel > 1) adios (NULL, "only one message at a time!"); } msgnam = file ? file : getcpy (m_name (mp->lowsel)); dat[0] = mp ? mp->lowsel : 0; dat[1] = 0; dat[2] = 0; dat[3] = outputlinelen; dat[4] = 0; if (!form) form = distcomps; in = build_form(form, NULL, dat, from, to, cc, fcc, NULL, msgnam); if ((out = creat (drft, m_gmprot ())) == NOTOK) adios (drft, "unable to create"); cpydata (in, out, form, drft); close (in); close (out); if ((in = open (msgnam, O_RDONLY)) == NOTOK) adios (msgnam, "unable to open message"); if (!file) { context_replace (pfolder, folder);/* update current folder */ seq_setcur (mp, mp->lowsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } if (nwhat) done (0); what_now (ed, nedit, NOUSE, drft, msgnam, 1, mp, anot ? "Resent" : NULL, inplace, cwd, atfile); done (1); return 1; } nmh-1.5/uip/distsbr.c000644 007761 000765 00000012037 11713401274 014510 0ustar00kenhkenh000000 000000 /* * distsbr.c -- routines to do additional "dist-style" processing * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include static int hdrfd = NOTOK; static int txtfd = NOTOK; #define BADHDR "please re-edit %s to remove the ``%s'' header!" #define BADTXT "please re-edit %s to consist of headers only!" #define BADMSG "please re-edit %s to include a ``Resent-To:''!" #define BADRFT "please re-edit %s and fix that header!" /* * static prototypes */ static void ready_msg(char *); int distout (char *drft, char *msgnam, char *backup) { int state; register unsigned char *dp; register char *resent; char name[NAMESZ], buffer[BUFSIZ]; register FILE *ifp, *ofp; if (rename (drft, strcpy (backup, m_backup (drft))) == NOTOK) adios (backup, "unable to rename %s to",drft); if ((ifp = fopen (backup, "r")) == NULL) adios (backup, "unable to read"); if ((ofp = fopen (drft, "w")) == NULL) adios (drft, "unable to create temporary file"); chmod (drft, m_gmprot ()); ready_msg (msgnam); lseek (hdrfd, (off_t) 0, SEEK_SET); /* msgnam not accurate */ cpydata (hdrfd, fileno (ofp), msgnam, drft); for (state = FLD, resent = NULL;;) switch (state = m_getfld (state, name, buffer, sizeof buffer, ifp)) { case FLD: case FLDPLUS: case FLDEOF: if (uprf (name, "distribute-")) snprintf (name, sizeof(name), "%s%s", "Resent", &name[10]); if (uprf (name, "distribution-")) snprintf (name, sizeof(name), "%s%s", "Resent", &name[12]); if (!uprf (name, "resent")) { advise (NULL, BADHDR, "draft", name); goto leave_bad; } if (state == FLD) resent = add (":", add (name, resent)); resent = add (buffer, resent); fprintf (ofp, "%s: %s", name, buffer); while (state == FLDPLUS) { state = m_getfld (state, name, buffer, sizeof buffer, ifp); resent = add (buffer, resent); fputs (buffer, ofp); } if (state == FLDEOF) goto process; break; case BODY: case BODYEOF: for (dp = buffer; *dp; dp++) if (!isspace (*dp)) { advise (NULL, BADTXT, "draft"); goto leave_bad; } case FILEEOF: goto process; case LENERR: case FMTERR: advise (NULL, BADRFT, "draft"); leave_bad: ; fclose (ifp); fclose (ofp); unlink (drft); if (rename (backup, drft) == NOTOK) adios (drft, "unable to rename %s to", backup); return NOTOK; default: adios (NULL, "getfld() returned %d", state); } process: ; fclose (ifp); fflush (ofp); if (!resent) { advise (NULL, BADMSG, "draft"); fclose (ofp); unlink (drft); if (rename (backup, drft) == NOTOK) adios (drft, "unable to rename %s to", backup); return NOTOK; } free (resent); if (txtfd != NOTOK) { lseek (txtfd, (off_t) 0, SEEK_SET); /* msgnam not accurate */ cpydata (txtfd, fileno (ofp), msgnam, drft); } fclose (ofp); return OK; } static void ready_msg (char *msgnam) { int state, out; char name[NAMESZ], buffer[BUFSIZ], tmpfil[BUFSIZ]; register FILE *ifp, *ofp; char *cp = NULL; if (hdrfd != NOTOK) close (hdrfd), hdrfd = NOTOK; if (txtfd != NOTOK) close (txtfd), txtfd = NOTOK; if ((ifp = fopen (msgnam, "r")) == NULL) adios (msgnam, "unable to open message"); cp = m_mktemp2(NULL, "dist", &hdrfd, NULL); if (cp == NULL) { adios("distsbr", "unable to create temporary file"); } fchmod(hdrfd, 0600); strncpy(tmpfil, cp, sizeof(tmpfil)); if ((out = dup (hdrfd)) == NOTOK || (ofp = fdopen (out, "w")) == NULL) adios (NULL, "no file descriptors -- you lose big"); unlink (tmpfil); for (state = FLD;;) switch (state = m_getfld (state, name, buffer, sizeof buffer, ifp)) { case FLD: case FLDPLUS: case FLDEOF: if (uprf (name, "resent")) fprintf (ofp, "Prev-"); fprintf (ofp, "%s: %s", name, buffer); while (state == FLDPLUS) { state = m_getfld (state, name, buffer, sizeof buffer, ifp); fputs (buffer, ofp); } if (state == FLDEOF) goto process; break; case BODY: case BODYEOF: fclose (ofp); cp = m_mktemp2(NULL, "dist", &txtfd, NULL); if (cp == NULL) { adios("distsbr", "unable to create temporary file"); } fchmod(txtfd, 0600); strncpy (tmpfil, cp, sizeof(tmpfil)); if ((out = dup (txtfd)) == NOTOK || (ofp = fdopen (out, "w")) == NULL) adios (NULL, "no file descriptors -- you lose big"); unlink (tmpfil); fprintf (ofp, "\n%s", buffer); while (state == BODY) { state = m_getfld (state, name, buffer, sizeof buffer, ifp); fputs (buffer, ofp); } case FILEEOF: goto process; case LENERR: case FMTERR: adios (NULL, "format error in message %s", msgnam); default: adios (NULL, "getfld() returned %d", state); } process: ; fclose (ifp); fclose (ofp); } nmh-1.5/uip/dp.c000644 007761 000765 00000006162 11765267273 013463 0ustar00kenhkenh000000 000000 /* * dp.c -- parse dates 822-style * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #define NDATES 100 #define WIDTH 78 #define WBUFSIZ BUFSIZ #define FORMAT "%<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%>" static struct swit switches[] = { #define FORMSW 0 { "form formatfile", 0 }, #define FMTSW 1 { "format string", 5 }, #define WIDTHSW 2 { "width columns", 0 }, #define VERSIONSW 3 { "version", 0 }, #define HELPSW 4 { "help", 0 }, { NULL, 0 } }; static struct format *fmt; static int dat[5]; /* * static prototypes */ static int process (char *, int); int main (int argc, char **argv) { int datep = 0, width = 0, status = 0; char *cp, *form = NULL, *format = NULL, *nfs; char buf[BUFSIZ], **argp, **arguments; char *dates[NDATES]; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] dates ...", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') adios (NULL, "missing argument to %s", argp[-2]); form = NULL; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); width = atoi (cp); continue; } } if (datep > NDATES) adios (NULL, "more than %d dates", NDATES); else dates[datep++] = cp; } dates[datep] = NULL; if (datep == 0) adios (NULL, "usage: %s [switches] dates ...", invo_name); /* get new format string */ nfs = new_fs (form, format, FORMAT); if (width == 0) { if ((width = sc_width ()) < WIDTH / 2) width = WIDTH / 2; width -= 2; } if (width > WBUFSIZ) width = WBUFSIZ; fmt_compile (nfs, &fmt); dat[0] = 0; dat[1] = 0; dat[2] = 0; dat[3] = width; dat[4] = 0; for (datep = 0; dates[datep]; datep++) status += process (dates[datep], width); context_save (); /* save the context file */ done (status); return 1; } static int process (char *date, int length) { int status = 0; char buffer[WBUFSIZ + 1]; register struct comp *cptr; FINDCOMP (cptr, "text"); if (cptr) cptr->c_text = date; fmt_scan (fmt, buffer, length, dat); fputs (buffer, stdout); return status; } nmh-1.5/uip/dropsbr.c000644 007761 000765 00000035637 11762736346 014543 0ustar00kenhkenh000000 000000 /* * dropsbr.c -- create/read/manipulate mail drops * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #ifdef NTOHLSWAP # include #else # undef ntohl # define ntohl(n) (n) #endif #include /* * static prototypes */ static int mbx_chk_mbox (int); static int mbx_chk_mmdf (int); static int map_open (char *, int); /* * Main entry point to open/create and lock * a file or maildrop. */ int mbx_open (char *file, int mbx_style, uid_t uid, gid_t gid, mode_t mode) { int j, count, fd; struct stat st; j = 0; /* attempt to open and lock file */ for (count = 4; count > 0; count--) { if ((fd = lkopen (file, O_RDWR | O_CREAT | O_NONBLOCK, mode)) == NOTOK) { switch (errno) { #if defined(FCNTL_LOCKING) || defined(LOCKF_LOCKING) case EACCES: case EAGAIN: #endif #ifdef FLOCK_LOCKING case EWOULDBLOCK: #endif case ETXTBSY: j = errno; sleep (5); break; default: /* just return error */ return NOTOK; } } /* good file descriptor */ break; } errno = j; /* * Return if we still failed after 4 attempts, * or we just want to skip the sanity checks. */ if (fd == NOTOK || mbx_style == OTHER_FORMAT) return fd; /* * Do sanity checks on maildrop. */ if (fstat (fd, &st) == NOTOK) { /* * The stat failed. So we make sure file * has right ownership/modes */ chown (file, uid, gid); chmod (file, mode); } else if (st.st_size > (off_t) 0) { int status; /* check the maildrop */ switch (mbx_style) { case MMDF_FORMAT: default: status = mbx_chk_mmdf (fd); break; case MBOX_FORMAT: status = mbx_chk_mbox (fd); break; } /* if error, attempt to close it */ if (status == NOTOK) { close (fd); return NOTOK; } } return fd; } /* * Check/prepare MBOX style maildrop for appending. */ static int mbx_chk_mbox (int fd) { /* just seek to the end */ if (lseek (fd, (off_t) 0, SEEK_END) == (off_t) NOTOK) return NOTOK; return OK; } /* * Check/prepare MMDF style maildrop for appending. */ static int mbx_chk_mmdf (int fd) { ssize_t count; char ldelim[BUFSIZ]; count = strlen (mmdlm2); if (lseek (fd, -count, SEEK_END) == (off_t) NOTOK) return NOTOK; if (read (fd, ldelim, count) != count) return NOTOK; ldelim[count] = 0; if (strcmp (ldelim, mmdlm2) && write (fd, "\n", 1) != 1 && write (fd, mmdlm2, count) != count) return NOTOK; return OK; } int mbx_read (FILE *fp, long pos, struct drop **drops, int noisy) { register int len, size; register long ld1, ld2; register char *bp; char buffer[BUFSIZ]; register struct drop *cp, *dp, *ep, *pp; pp = (struct drop *) calloc ((size_t) (len = MAXFOLDER), sizeof(*dp)); if (pp == NULL) { if (noisy) admonish (NULL, "unable to allocate drop storage"); return NOTOK; } ld1 = (long) strlen (mmdlm1); ld2 = (long) strlen (mmdlm2); fseek (fp, pos, SEEK_SET); for (ep = (dp = pp) + len - 1; fgets (buffer, sizeof(buffer), fp);) { size = 0; if (strcmp (buffer, mmdlm1) == 0) pos += ld1, dp->d_start = (long) pos; else { dp->d_start = (long)pos , pos += (long) strlen (buffer); for (bp = buffer; *bp; bp++, size++) if (*bp == '\n') size++; } while (fgets (buffer, sizeof(buffer), fp) != NULL) if (strcmp (buffer, mmdlm2) == 0) break; else { pos += (long) strlen (buffer); for (bp = buffer; *bp; bp++, size++) if (*bp == '\n') size++; } if (dp->d_start != (long) pos) { dp->d_id = 0; dp->d_size = (long) size; dp->d_stop = pos; dp++; } pos += ld2; if (dp >= ep) { register int curlen = dp - pp; cp = (struct drop *) mh_xrealloc ((char *) pp, (size_t) (len += MAXFOLDER) * sizeof(*pp)); dp = cp + curlen, ep = (pp = cp) + len - 1; } } if (dp == pp) free ((char *) pp); else *drops = pp; return (dp - pp); } int mbx_write(char *mailbox, int md, FILE *fp, int id, long last, long pos, off_t stop, int mapping, int noisy) { register int i, j, size; off_t start; long off; register char *cp; char buffer[BUFSIZ]; off = (long) lseek (md, (off_t) 0, SEEK_CUR); j = strlen (mmdlm1); if (write (md, mmdlm1, j) != j) return NOTOK; start = lseek (md, (off_t) 0, SEEK_CUR); size = 0; fseek (fp, pos, SEEK_SET); while (fgets (buffer, sizeof(buffer), fp) && (pos < stop)) { i = strlen (buffer); for (j = 0; (j = stringdex (mmdlm1, buffer)) >= 0; buffer[j]++) continue; for (j = 0; (j = stringdex (mmdlm2, buffer)) >= 0; buffer[j]++) continue; if (write (md, buffer, i) != i) return NOTOK; pos += (long) i; if (mapping) for (cp = buffer; i-- > 0; size++) if (*cp++ == '\n') size++; } stop = lseek (md, (off_t) 0, SEEK_CUR); j = strlen (mmdlm2); if (write (md, mmdlm2, j) != j) return NOTOK; if (mapping) map_write (mailbox, md, id, last, start, stop, off, size, noisy); return OK; } /* * Append message to end of file or maildrop. */ int mbx_copy (char *mailbox, int mbx_style, int md, int fd, int mapping, char *text, int noisy) { int i, j, size; off_t start, stop; long pos; char *cp, buffer[BUFSIZ]; FILE *fp; pos = (long) lseek (md, (off_t) 0, SEEK_CUR); size = 0; switch (mbx_style) { case MMDF_FORMAT: default: j = strlen (mmdlm1); if (write (md, mmdlm1, j) != j) return NOTOK; start = lseek (md, (off_t) 0, SEEK_CUR); if (text) { i = strlen (text); if (write (md, text, i) != i) return NOTOK; for (cp = text; *cp++; size++) if (*cp == '\n') size++; } while ((i = read (fd, buffer, sizeof(buffer))) > 0) { for (j = 0; (j = stringdex (mmdlm1, buffer)) >= 0; buffer[j]++) continue; for (j = 0; (j = stringdex (mmdlm2, buffer)) >= 0; buffer[j]++) continue; if (write (md, buffer, i) != i) return NOTOK; if (mapping) for (cp = buffer; i-- > 0; size++) if (*cp++ == '\n') size++; } stop = lseek (md, (off_t) 0, SEEK_CUR); j = strlen (mmdlm2); if (write (md, mmdlm2, j) != j) return NOTOK; if (mapping) map_write (mailbox, md, 0, (long) 0, start, stop, pos, size, noisy); return (i != NOTOK ? OK : NOTOK); case MBOX_FORMAT: if ((j = dup (fd)) == NOTOK) return NOTOK; if ((fp = fdopen (j, "r")) == NULL) { close (j); return NOTOK; } start = lseek (md, (off_t) 0, SEEK_CUR); /* If text is given, we add it to top of message */ if (text) { i = strlen (text); if (write (md, text, i) != i) return NOTOK; for (cp = text; *cp++; size++) if (*cp == '\n') size++; } for (j = 0; fgets (buffer, sizeof(buffer), fp) != NULL; j++) { /* * Check the first line, and make some changes. */ if (j == 0 && !text) { /* * Change the "Return-Path:" field (if in first line) * back to "From ". */ if (!strncmp (buffer, "Return-Path:", 12)) { char tmpbuffer[BUFSIZ]; char *tp, *ep, *fp; strncpy(tmpbuffer, buffer, sizeof(tmpbuffer)); ep = tmpbuffer + 13; if (!(fp = strchr(ep + 1, ' '))) fp = strchr(ep + 1, '\n'); tp = dctime(dlocaltimenow()); snprintf (buffer, sizeof(buffer), "From %.*s %s", (int)(fp - ep), ep, tp); } else if (!strncmp (buffer, "X-Envelope-From:", 16)) { /* * Change the "X-Envelope-From:" field * (if first line) back to "From ". */ char tmpbuffer[BUFSIZ]; char *ep; strncpy(tmpbuffer, buffer, sizeof(tmpbuffer)); ep = tmpbuffer + 17; snprintf (buffer, sizeof(buffer), "From %s", ep); } else if (strncmp (buffer, "From ", 5)) { /* * If there is already a "From " line, * then leave it alone. Else we add one. */ char tmpbuffer[BUFSIZ]; char *tp, *ep; strncpy(tmpbuffer, buffer, sizeof(tmpbuffer)); ep = "nobody@nowhere"; tp = dctime(dlocaltimenow()); snprintf (buffer, sizeof(buffer), "From %s %s%s", ep, tp, tmpbuffer); } } /* * If this is not first line, and begins with * "From ", then prepend line with ">". */ if (j != 0 && strncmp (buffer, "From ", 5) == 0) { write (md, ">", 1); size++; } i = strlen (buffer); if (write (md, buffer, i) != i) { fclose (fp); return NOTOK; } if (mapping) for (cp = buffer; i-- > 0; size++) if (*cp++ == '\n') size++; } if (write (md, "\n", 1) != 1) { fclose (fp); return NOTOK; } if (mapping) size += 2; fclose (fp); lseek (fd, (off_t) 0, SEEK_END); stop = lseek (md, (off_t) 0, SEEK_CUR); if (mapping) map_write (mailbox, md, 0, (long) 0, start, stop, pos, size, noisy); return OK; } } int mbx_size (int md, off_t start, off_t stop) { register int i, fd; register long pos; register FILE *fp; if ((fd = dup (md)) == NOTOK || (fp = fdopen (fd, "r")) == NULL) { if (fd != NOTOK) close (fd); return NOTOK; } fseek (fp, start, SEEK_SET); for (i = 0, pos = stop - start; pos-- > 0; i++) if (fgetc (fp) == '\n') i++; fclose (fp); return i; } /* * Close and unlock file/maildrop. */ int mbx_close (char *mailbox, int md) { if (lkclose (md, mailbox) == 0) return OK; return NOTOK; } /* * This function is performed implicitly by getbbent.c: * bb->bb_map = map_name (bb->bb_file); */ char * map_name (char *file) { register char *cp, *dp; static char buffer[BUFSIZ]; if ((dp = strchr(cp = r1bindex (file, '/'), '.')) == NULL) dp = cp + strlen (cp); if (cp == file) snprintf (buffer, sizeof(buffer), ".%.*s%s", (int)(dp - cp), cp, ".map"); else snprintf (buffer, sizeof(buffer), "%.*s.%.*s%s", (int)(cp - file), file, (int)(dp - cp), cp, ".map"); return buffer; } int map_read (char *file, long pos, struct drop **drops, int noisy) { register int i, md, msgp; register char *cp; struct drop d; register struct drop *mp, *dp; if ((md = open (cp = map_name (file), O_RDONLY)) == NOTOK || map_chk (cp, md, mp = &d, pos, noisy)) { if (md != NOTOK) close (md); return 0; } msgp = mp->d_id; dp = (struct drop *) calloc ((size_t) (msgp + 1), sizeof(*dp)); if (dp == NULL) { close (md); return 0; } memcpy((char *) dp, (char *) mp, sizeof(*dp)); lseek (md, (off_t) sizeof(*mp), SEEK_SET); if ((i = read (md, (char *) (dp + 1), msgp * sizeof(*dp))) < (int) sizeof(*dp)) { i = 0; free ((char *) dp); } else { #ifdef NTOHLSWAP register struct drop *tdp; int j; for (j = 0, tdp = dp; j < i / sizeof(*dp); j++, tdp++) { tdp->d_id = ntohl(tdp->d_id); tdp->d_size = ntohl(tdp->d_size); tdp->d_start = ntohl(tdp->d_start); tdp->d_stop = ntohl(tdp->d_stop); } #endif *drops = dp; } close (md); return (i / sizeof(*dp)); } int map_write (char *mailbox, int md, int id, long last, off_t start, off_t stop, long pos, int size, int noisy) { register int i; int clear, fd, td; char *file; register struct drop *dp; struct drop d1, d2, *rp; register FILE *fp; struct stat st; if ((fd = map_open (file = map_name (mailbox), md)) == NOTOK) return NOTOK; if ((fstat (fd, &st) == OK) && (st.st_size > 0)) clear = 0; else clear = 1; if (!clear && map_chk (file, fd, &d1, pos, noisy)) { unlink (file); mbx_close (file, fd); if ((fd = map_open (file, md)) == NOTOK) return NOTOK; clear++; } if (clear) { if ((td = dup (md)) == NOTOK || (fp = fdopen (td, "r")) == NULL) { if (noisy) admonish (file, "unable to %s", td != NOTOK ? "fdopen" : "dup"); if (td != NOTOK) close (td); mbx_close (file, fd); return NOTOK; } switch (i = mbx_read (fp, 0, &rp, noisy)) { case NOTOK: fclose (fp); mbx_close (file, fd); return NOTOK; case OK: fclose (fp); break; default: d1.d_id = 0; for (dp = rp; i-- >0; dp++) { if (dp->d_start == start) dp->d_id = id; lseek (fd, (off_t) (++d1.d_id * sizeof(*dp)), SEEK_SET); if (write (fd, (char *) dp, sizeof(*dp)) != sizeof(*dp)) { if (noisy) admonish (file, "write error"); mbx_close (file, fd); fclose (fp); return NOTOK; } } free ((char *) rp); fclose (fp); break; } } else { if (last == 0) last = d1.d_start; dp = &d2; dp->d_id = id; dp->d_size = (long) (size ? size : mbx_size (fd, start, stop)); dp->d_start = start; dp->d_stop = stop; lseek (fd, (off_t) (++d1.d_id * sizeof(*dp)), SEEK_SET); if (write (fd, (char *) dp, sizeof(*dp)) != sizeof(*dp)) { if (noisy) admonish (file, "write error"); mbx_close (file, fd); return NOTOK; } } dp = &d1; dp->d_size = DRVRSN; dp->d_start = (long) last; dp->d_stop = lseek (md, (off_t) 0, SEEK_CUR); lseek (fd, (off_t) 0, SEEK_SET); if (write (fd, (char *) dp, sizeof(*dp)) != sizeof(*dp)) { if (noisy) admonish (file, "write error"); mbx_close (file, fd); return NOTOK; } mbx_close (file, fd); return OK; } static int map_open (char *file, int md) { mode_t mode; struct stat st; mode = fstat (md, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot (); return mbx_open (file, OTHER_FORMAT, st.st_uid, st.st_gid, mode); } int map_chk (char *file, int fd, struct drop *dp, long pos, int noisy) { ssize_t count; struct drop d, tmpd; register struct drop *dl; if (read (fd, (char *) &tmpd, sizeof(*dp)) != sizeof(*dp)) { #ifdef notdef admonish (NULL, "%s: missing or partial index", file); #endif /* notdef */ return NOTOK; } #ifndef NTOHLSWAP *dp = tmpd; /* if ntohl(n)=(n), can use struct assign */ #else dp->d_id = ntohl(tmpd.d_id); dp->d_size = ntohl(tmpd.d_size); dp->d_start = ntohl(tmpd.d_start); dp->d_stop = ntohl(tmpd.d_stop); #endif if (dp->d_size != DRVRSN) { if (noisy) admonish (NULL, "%s: version mismatch (%d != %d)", file, dp->d_size, DRVRSN); return NOTOK; } if (dp->d_stop != pos) { if (noisy && pos != (long) 0) admonish (NULL, "%s: pointer mismatch or incomplete index (%ld!=%ld)", file, dp->d_stop, (long) pos); return NOTOK; } if ((long) ((dp->d_id + 1) * sizeof(*dp)) != (long) lseek (fd, (off_t) 0, SEEK_END)) { if (noisy) admonish (NULL, "%s: corrupt index(1)", file); return NOTOK; } dl = &d; count = strlen (mmdlm2); lseek (fd, (off_t) (dp->d_id * sizeof(*dp)), SEEK_SET); if (read (fd, (char *) dl, sizeof(*dl)) != sizeof(*dl) || (ntohl(dl->d_stop) != dp->d_stop && ntohl(dl->d_stop) + count != dp->d_stop)) { if (noisy) admonish (NULL, "%s: corrupt index(2)", file); return NOTOK; } return OK; } nmh-1.5/uip/flist.c000644 007761 000765 00000041177 11765267273 014206 0ustar00kenhkenh000000 000000 /* * flist.c -- list nmh folders containing messages * -- in a given sequence * * originally by * David Nichols, Xerox-PARC, November, 1992 * * Copyright (c) 1994 Xerox Corporation. * Use and copying of this software and preparation of derivative works based * upon this software are permitted. Any distribution of this software or * derivative works must comply with all applicable United States export * control laws. This software is made available AS IS, and Xerox Corporation * makes no warranty about the software, its performance or its conformity to * any specification. */ #include #include #define FALSE 0 #define TRUE 1 /* * We allocate space to record the names of folders * (foldersToDo array), this number of elements at a time. */ #define MAXFOLDERS 100 static struct swit switches[] = { #define SEQSW 0 { "sequence name", 0 }, #define ALLSW 1 { "all", 0 }, #define NOALLSW 2 { "noall", 0 }, #define RECURSE 3 { "recurse", 0 }, #define NORECURSE 4 { "norecurse", 0 }, #define SHOWZERO 5 { "showzero", 0 }, #define NOSHOWZERO 6 { "noshowzero", 0 }, #define ALPHASW 7 { "alpha", 0 }, #define NOALPHASW 8 { "noalpha", 0 }, #define FASTSW 9 { "fast", 0 }, #define NOFASTSW 10 { "nofast", 0 }, #define TOTALSW 11 { "total", -5 }, #define NOTOTALSW 12 { "nototal", -7 }, #define VERSIONSW 13 { "version", 0 }, #define HELPSW 14 { "help", 0 }, { NULL, 0 } }; struct Folder { char *name; /* name of folder */ int priority; int error; /* error == 1 for unreadable folder */ int nMsgs; /* number of messages in folder */ int nSeq[NUMATTRS]; /* number of messages in each sequence */ int private[NUMATTRS]; /* is given sequence, public or private */ }; static struct Folder *orders = NULL; static int nOrders = 0; static int nOrdersAlloced = 0; static struct Folder *folders = NULL; static unsigned int nFolders = 0; static int nFoldersAlloced = 0; /* info on folders to search */ static char **foldersToDo; static int numfolders; static int maxfolders; /* info on sequences to search for */ static char *sequencesToDo[NUMATTRS]; static unsigned int numsequences; static int all = FALSE; /* scan all folders in top level? */ static int alphaOrder = FALSE; /* want alphabetical order only */ static int recurse = FALSE; /* show nested folders? */ static int showzero = TRUE; /* show folders even if no messages in seq? */ static int Total = TRUE; /* display info on number of messages in * * sequence found, and total num messages */ static char curfolder[BUFSIZ]; /* name of the current folder */ static char *nmhdir; /* base nmh mail directory */ /* * Type for a compare function for qsort. This keeps * the compiler happy. */ typedef int (*qsort_comp) (const void *, const void *); /* * prototypes */ int CompareFolders(struct Folder *, struct Folder *); void GetFolderOrder(void); void ScanFolders(void); int AddFolder(char *, int); void BuildFolderList(char *, int); void BuildFolderListRecurse(char *, struct stat *, int); void PrintFolders(void); void AllocFolders(struct Folder **, int *, int); int AssignPriority(char *); static void do_readonly_folders(void); int main(int argc, char **argv) { char *cp, **argp; char **arguments; char buf[BUFSIZ]; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex(argv[0], '/'); /* read user profile/context */ context_read(); /* * If program was invoked with name ending * in `s', then add switch `-all'. */ if (argv[0][strlen (argv[0]) - 1] == 's') all = TRUE; arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* allocate the initial space to record the folder names */ numfolders = 0; maxfolders = MAXFOLDERS; foldersToDo = (char **) mh_xmalloc ((size_t) (maxfolders * sizeof(*foldersToDo))); /* no sequences yet */ numsequences = 0; /* parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch(++cp, switches)) { case AMBIGSW: ambigsw(cp, switches); done(1); case UNKWNSW: adios(NULL, "-%s unknown", cp); case HELPSW: snprintf(buf, sizeof(buf), "%s [+folder1 [+folder2 ...]][switches]", invo_name); print_help(buf, switches, 1); done(1); case VERSIONSW: print_version(invo_name); done (1); case SEQSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); /* check if too many sequences specified */ if (numsequences >= NUMATTRS) adios (NULL, "too many sequences (more than %d) specified", NUMATTRS); sequencesToDo[numsequences++] = cp; break; case ALLSW: all = TRUE; break; case NOALLSW: all = FALSE; break; case SHOWZERO: showzero = TRUE; break; case NOSHOWZERO: showzero = FALSE; break; case ALPHASW: alphaOrder = TRUE; break; case NOALPHASW: alphaOrder = FALSE; break; case NOFASTSW: case TOTALSW: Total = TRUE; break; case FASTSW: case NOTOTALSW: Total = FALSE; break; case RECURSE: recurse = TRUE; break; case NORECURSE: recurse = FALSE; break; } } else { /* * Check if we need to allocate more space * for folder names. */ if (numfolders >= maxfolders) { maxfolders += MAXFOLDERS; foldersToDo = (char **) mh_xrealloc (foldersToDo, (size_t) (maxfolders * sizeof(*foldersToDo))); } if (*cp == '+' || *cp == '@') { foldersToDo[numfolders++] = pluspath (cp); } else foldersToDo[numfolders++] = cp; } } if (!context_find ("path")) free (path ("./", TFOLDER)); /* get current folder */ strncpy (curfolder, getfolder(1), sizeof(curfolder)); /* get nmh base directory */ nmhdir = m_maildir (""); /* * If we didn't specify any sequences, we search * for the "Unseen-Sequence" profile entry and use * all the sequences defined there. We check to * make sure that the Unseen-Sequence entry doesn't * contain more than NUMATTRS sequences. */ if (numsequences == 0) { if ((cp = context_find(usequence)) && *cp) { char **ap, *dp; dp = getcpy(cp); ap = brkstring (dp, " ", "\n"); for (; ap && *ap; ap++) { if (numsequences >= NUMATTRS) adios (NULL, "too many sequences (more than %d) in %s profile entry", NUMATTRS, usequence); else sequencesToDo[numsequences++] = *ap; } } else { adios (NULL, "no sequence specified or %s profile entry found", usequence); } } GetFolderOrder(); ScanFolders(); qsort(folders, nFolders, sizeof(struct Folder), (qsort_comp) CompareFolders); PrintFolders(); done (0); return 1; } /* * Read the Flist-Order profile entry to determine * how to sort folders for output. */ void GetFolderOrder(void) { unsigned char *p, *s; int priority = 1; struct Folder *o; if (!(p = context_find("Flist-Order"))) return; for (;;) { while (isspace(*p)) ++p; s = p; while (*p && !isspace(*p)) ++p; if (p != s) { /* Found one. */ AllocFolders(&orders, &nOrdersAlloced, nOrders + 1); o = &orders[nOrders++]; o->priority = priority++; o->name = (char *) mh_xmalloc(p - s + 1); strncpy(o->name, s, p - s); o->name[p - s] = 0; } else break; } } /* * Scan all the necessary folders */ void ScanFolders(void) { int i; /* * change directory to base of nmh directory */ if (chdir (nmhdir) == NOTOK) adios (nmhdir, "unable to change directory to"); if (numfolders > 0) { /* Update context */ strncpy (curfolder, foldersToDo[numfolders - 1], sizeof(curfolder)); context_replace (pfolder, curfolder);/* update current folder */ context_save (); /* save the context file */ /* * Scan each given folder. If -all is given, * then also scan the 1st level subfolders under * each given folder. */ for (i = 0; i < numfolders; ++i) BuildFolderList(foldersToDo[i], all ? 1 : 0); } else { if (all) { /* * Do the readonly folders */ do_readonly_folders(); /* * Now scan the entire nmh directory for folders */ BuildFolderList(".", 0); } else { /* * Else scan current folder */ BuildFolderList(curfolder, 0); } } } /* * Initial building of folder list for * the top of our search tree. */ void BuildFolderList(char *dirName, int searchdepth) { struct stat st; /* Make sure we have a directory */ if ((stat(dirName, &st) == -1) || !S_ISDIR(st.st_mode)) return; /* * If base directory, don't add it to the * folder list. We just recurse into it. */ if (!strcmp (dirName, ".")) { BuildFolderListRecurse (".", &st, 0); return; } /* * Add this folder to the list. * If recursing and directory has subfolders, * then build folder list for subfolders. */ if (AddFolder(dirName, showzero) && (recurse || searchdepth) && st.st_nlink > 2) BuildFolderListRecurse(dirName, &st, searchdepth - 1); } /* * Recursive building of folder list */ void BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth) { char *base, name[PATH_MAX]; unsigned char *n; int nlinks; DIR *dir; struct dirent *dp; struct stat st; /* * Keep track of number of directories we've seen so we can * stop stat'ing entries in this directory once we've seen * them all. This optimization will fail if you have extra * directories beginning with ".", since we don't bother to * stat them. But that shouldn't generally be a problem. */ nlinks = s->st_nlink; if (nlinks == 1) { /* Disable the optimization under conditions where st_nlink is set to 1. That happens on Cygwin, for example: http://cygwin.com/ml/cygwin-apps/2008-08/msg00264.html */ nlinks = INT_MAX; } if (!(dir = opendir(dirName))) adios(dirName, "can't open directory"); /* * A hack so that we don't see a * leading "./" in folder names. */ base = strcmp (dirName, ".") ? dirName : dirName + 1; while (nlinks && (dp = readdir(dir))) { if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) { nlinks--; continue; } if (dp->d_name[0] == '.') continue; /* Check to see if the name of the file is a number * if it is, we assume it's a mail file and skip it */ for (n = dp->d_name; *n && isdigit(*n); n++); if (!*n) continue; strncpy (name, base, sizeof(name) - 2); if (*base) strcat(name, "/"); strncat(name, dp->d_name, sizeof(name) - strlen(name) - 1); if ((stat(name, &st) != -1) && S_ISDIR(st.st_mode)) { /* * Check if this was really a symbolic link pointing * to a directory. If not, then decrement link count. */ if (lstat (name, &st) == -1) nlinks--; /* Add this folder to the list */ if (AddFolder(name, showzero) && (recurse || searchdepth) && st.st_nlink > 2) BuildFolderListRecurse(name, &st, searchdepth - 1); } } closedir(dir); } /* * Add this folder to our list, counting the total number of * messages and the number of messages in each sequence. */ int AddFolder(char *name, int force) { unsigned int i; int msgnum, nonzero; int seqnum[NUMATTRS], nSeq[NUMATTRS]; struct Folder *f; struct msgs *mp; /* Read folder and create message structure */ if (!(mp = folder_read (name))) { /* Oops, error occurred. Record it and continue. */ AllocFolders(&folders, &nFoldersAlloced, nFolders + 1); f = &folders[nFolders++]; f->name = getcpy(name); f->error = 1; f->priority = AssignPriority(f->name); return 0; } for (i = 0; i < numsequences; i++) { /* Convert sequences to their sequence numbers */ if (sequencesToDo[i]) seqnum[i] = seq_getnum(mp, sequencesToDo[i]); else seqnum[i] = -1; /* Now count messages in this sequence */ nSeq[i] = 0; if (mp->nummsg > 0 && seqnum[i] != -1) { for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) { if (in_sequence(mp, seqnum[i], msgnum)) nSeq[i]++; } } } /* Check if any of the sequence checks were nonzero */ nonzero = 0; for (i = 0; i < numsequences; i++) { if (nSeq[i] > 0) { nonzero = 1; break; } } if (nonzero || force) { /* save general folder information */ AllocFolders(&folders, &nFoldersAlloced, nFolders + 1); f = &folders[nFolders++]; f->name = getcpy(name); f->nMsgs = mp->nummsg; f->error = 0; f->priority = AssignPriority(f->name); /* record the sequence information */ for (i = 0; i < numsequences; i++) { f->nSeq[i] = nSeq[i]; f->private[i] = (seqnum[i] != -1) ? is_seq_private(mp, seqnum[i]) : 0; } } folder_free (mp); /* free folder/message structure */ return 1; } /* * Print the folder/sequence information */ void PrintFolders(void) { char tmpname[BUFSIZ]; unsigned int i, j, len, has_private = 0; unsigned int maxfolderlen = 0, maxseqlen = 0; int maxnum = 0, maxseq = 0; if (!Total) { for (i = 0; i < nFolders; i++) printf("%s\n", folders[i].name); return; } /* * Find the width we need for various fields */ for (i = 0; i < nFolders; ++i) { /* find the length of longest folder name */ len = strlen(folders[i].name); if (len > maxfolderlen) maxfolderlen = len; /* If folder had error, skip the rest */ if (folders[i].error) continue; /* find the maximum total messages */ if (folders[i].nMsgs > maxnum) maxnum = folders[i].nMsgs; for (j = 0; j < numsequences; j++) { /* find maximum width of sequence name */ len = strlen (sequencesToDo[j]); if ((folders[i].nSeq[j] > 0 || showzero) && (len > maxseqlen)) maxseqlen = len; /* find the maximum number of messages in sequence */ if (folders[i].nSeq[j] > maxseq) maxseq = folders[i].nSeq[j]; /* check if this sequence is private in any of the folders */ if (folders[i].private[j]) has_private = 1; } } /* Now print all the folder/sequence information */ for (i = 0; i < nFolders; i++) { for (j = 0; j < numsequences; j++) { if (folders[i].nSeq[j] > 0 || showzero) { /* Add `+' to end of name of current folder */ if (strcmp(curfolder, folders[i].name)) snprintf(tmpname, sizeof(tmpname), "%s", folders[i].name); else snprintf(tmpname, sizeof(tmpname), "%s+", folders[i].name); if (folders[i].error) { printf("%-*s is unreadable\n", maxfolderlen+1, tmpname); continue; } printf("%-*s has %*d in sequence %-*s%s; out of %*d\n", maxfolderlen+1, tmpname, num_digits(maxseq), folders[i].nSeq[j], maxseqlen, sequencesToDo[j], !has_private ? "" : folders[i].private[j] ? " (private)" : " ", num_digits(maxnum), folders[i].nMsgs); } } } } /* * Put them in priority order. */ int CompareFolders(struct Folder *f1, struct Folder *f2) { if (!alphaOrder && f1->priority != f2->priority) return f1->priority - f2->priority; else return strcmp(f1->name, f2->name); } /* * Make sure we have at least n folders allocated. */ void AllocFolders(struct Folder **f, int *nfa, int n) { if (n <= *nfa) return; if (*f == NULL) { *nfa = 10; *f = (struct Folder *) mh_xmalloc (*nfa * (sizeof(struct Folder))); } else { *nfa *= 2; *f = (struct Folder *) mh_xrealloc (*f, *nfa * (sizeof(struct Folder))); } } /* * Return the priority for a name. The highest comes from an exact match. * After that, the longest match (then first) assigns the priority. */ int AssignPriority(char *name) { int i, ol, nl; int best = nOrders; int bestLen = 0; struct Folder *o; nl = strlen(name); for (i = 0; i < nOrders; ++i) { o = &orders[i]; if (!strcmp(name, o->name)) return o->priority; ol = strlen(o->name); if (nl < ol - 1) continue; if (ol < bestLen) continue; if (o->name[0] == '*' && !strcmp(o->name + 1, name + (nl - ol + 1))) { best = o->priority; bestLen = ol; } else if (o->name[ol - 1] == '*' && strncmp(o->name, name, ol - 1) == 0) { best = o->priority; bestLen = ol; } } return best; } /* * Do the read only folders */ static void do_readonly_folders (void) { int atrlen; char atrcur[BUFSIZ]; register struct node *np; snprintf (atrcur, sizeof(atrcur), "atr-%s-", current); atrlen = strlen (atrcur); for (np = m_defs; np; np = np->n_next) if (ssequal (atrcur, np->n_name) && !ssequal (nmhdir, np->n_name + atrlen)) BuildFolderList (np->n_name + atrlen, 0); } nmh-1.5/uip/fmtdump.c000644 007761 000765 00000026766 11765267273 014550 0ustar00kenhkenh000000 000000 /* * fmtdump.c -- compile format file and dump out instructions * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include static struct swit switches[] = { #define FORMSW 0 { "form formatfile", 0 }, #define FMTSW 1 { "format string", 5 }, #define VERSIONSW 2 { "version", 0 }, #define HELPSW 3 { "help", 0 }, { NULL, 0 } }; /* for assignlabel */ static struct format *lvec[128]; static int lused = 0; /* * static prototypes */ static void fmt_dump (struct format *); static void dumpone(struct format *); static int findlabel(struct format *); static void assignlabel(struct format *); static char *f_typestr(int); static char *c_typestr(int); static char *c_flagsstr(int); static void litputs(char *); static void litputc(char); int main (int argc, char **argv) { char *cp, *form = NULL, *format = NULL; char buf[BUFSIZ], *nfs, **argp, **arguments; struct format *fmt; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') adios (NULL, "missing argument to %s", argp[-2]); form = NULL; continue; } } if (form) adios (NULL, "only one form at a time!"); else form = cp; } /* * Get new format string. Must be before chdir(). */ nfs = new_fs (form, format, FORMAT); (void) fmt_compile(nfs, &fmt); fmt_dump(fmt); done(0); return 1; } static void fmt_dump (struct format *fmth) { int i; register struct format *fmt, *addr; /* Assign labels */ for (fmt = fmth; fmt; ++fmt) { i = fmt->f_type; if (i == FT_IF_S || i == FT_IF_S_NULL || i == FT_IF_V_EQ || i == FT_IF_V_NE || i == FT_IF_V_GT || i == FT_IF_MATCH || i == FT_IF_AMATCH || i == FT_GOTO) { addr = fmt + fmt->f_skip; if (findlabel(addr) < 0) assignlabel(addr); } if (fmt->f_type == FT_DONE && fmt->f_value == 0) break; } /* Dump them out! */ for (fmt = fmth; fmt; ++fmt) { dumpone(fmt); if (fmt->f_type == FT_DONE && fmt->f_value == 0) break; } } static void dumpone(struct format *fmt) { register int i; if ((i = findlabel(fmt)) >= 0) printf("L%d:", i); putchar('\t'); fputs(f_typestr((int)fmt->f_type), stdout); switch (fmt->f_type) { case FT_COMP: case FT_LS_COMP: case FT_LV_COMPFLAG: case FT_LV_COMP: printf(", comp "); litputs(fmt->f_comp->c_name); if (fmt->f_comp->c_type) printf(", c_type %s", c_typestr(fmt->f_comp->c_type)); if (fmt->f_comp->c_flags) printf(", c_flags %s", c_flagsstr(fmt->f_comp->c_flags)); break; case FT_LV_SEC: case FT_LV_MIN: case FT_LV_HOUR: case FT_LV_MDAY: case FT_LV_MON: case FT_LS_MONTH: case FT_LS_LMONTH: case FT_LS_ZONE: case FT_LV_YEAR: case FT_LV_WDAY: case FT_LS_DAY: case FT_LS_WEEKDAY: case FT_LV_YDAY: case FT_LV_ZONE: case FT_LV_CLOCK: case FT_LV_RCLOCK: case FT_LV_DAYF: case FT_LV_ZONEF: case FT_LV_DST: case FT_LS_822DATE: case FT_LS_PRETTY: case FT_LOCALDATE: case FT_GMTDATE: case FT_PARSEDATE: printf(", c_name "); litputs(fmt->f_comp->c_name); if (fmt->f_comp->c_type) printf(", c_type %s", c_typestr(fmt->f_comp->c_type)); if (fmt->f_comp->c_flags) printf(", c_flags %s", c_flagsstr(fmt->f_comp->c_flags)); break; case FT_LS_ADDR: case FT_LS_PERS: case FT_LS_MBOX: case FT_LS_HOST: case FT_LS_PATH: case FT_LS_GNAME: case FT_LS_NOTE: case FT_LS_822ADDR: case FT_LV_HOSTTYPE: case FT_LV_INGRPF: case FT_LV_NOHOSTF: case FT_LS_FRIENDLY: case FT_PARSEADDR: case FT_MYMBOX: printf(", c_name "); litputs(fmt->f_comp->c_name); if (fmt->f_comp->c_type) printf(", c_type %s", c_typestr(fmt->f_comp->c_type)); if (fmt->f_comp->c_flags) printf(", c_flags %s", c_flagsstr(fmt->f_comp->c_flags)); break; case FT_COMPF: printf(", width %d, fill '", fmt->f_width); litputc(fmt->f_fill); printf("' name "); litputs(fmt->f_comp->c_name); if (fmt->f_comp->c_type) printf(", c_type %s", c_typestr(fmt->f_comp->c_type)); if (fmt->f_comp->c_flags) printf(", c_flags %s", c_flagsstr(fmt->f_comp->c_flags)); break; case FT_STRF: case FT_NUMF: printf(", width %d, fill '", fmt->f_width); litputc(fmt->f_fill); putchar('\''); break; case FT_LIT: #ifdef FT_LIT_FORCE case FT_LIT_FORCE: #endif putchar(' '); litputs(fmt->f_text); break; case FT_LITF: printf(", width %d, fill '", fmt->f_width); litputc(fmt->f_fill); printf("' "); litputs(fmt->f_text); break; case FT_CHAR: putchar(' '); putchar('\''); litputc(fmt->f_char); putchar('\''); break; case FT_IF_S: case FT_IF_S_NULL: case FT_IF_MATCH: case FT_IF_AMATCH: printf(" continue else goto"); case FT_GOTO: i = findlabel(fmt + fmt->f_skip); printf(" L%d", i); break; case FT_IF_V_EQ: case FT_IF_V_NE: case FT_IF_V_GT: i = findlabel(fmt + fmt->f_skip); printf(" %d continue else goto L%d", fmt->f_value, i); break; case FT_V_EQ: case FT_V_NE: case FT_V_GT: case FT_LV_LIT: case FT_LV_PLUS_L: case FT_LV_MINUS_L: case FT_LV_DIVIDE_L: case FT_LV_MODULO_L: printf(" value %d", fmt->f_value); break; case FT_LS_LIT: printf(" str "); litputs(fmt->f_text); break; case FT_LS_GETENV: printf(" getenv "); litputs(fmt->f_text); break; case FT_LS_DECODECOMP: printf(", comp "); litputs(fmt->f_comp->c_name); break; case FT_LS_DECODE: break; case FT_LS_TRIM: printf(", width %d", fmt->f_width); break; case FT_LV_DAT: printf(", value dat[%d]", fmt->f_value); break; } putchar('\n'); } static int findlabel(struct format *addr) { register int i; for (i = 0; i < lused; ++i) if (addr == lvec[i]) return(i); return(-1); } static void assignlabel(struct format *addr) { lvec[lused++] = addr; } static char * f_typestr(int t) { static char buf[32]; switch (t) { case FT_COMP: return("COMP"); case FT_COMPF: return("COMPF"); case FT_LIT: return("LIT"); case FT_LITF: return("LITF"); #ifdef FT_LIT_FORCE case FT_LIT_FORCE: return("LIT_FORCE"); #endif case FT_CHAR: return("CHAR"); case FT_NUM: return("NUM"); case FT_NUMF: return("NUMF"); case FT_STR: return("STR"); case FT_STRF: return("STRF"); case FT_STRFW: return("STRFW"); case FT_PUTADDR: return("PUTADDR"); case FT_STRLIT: return("STRLIT"); case FT_LS_COMP: return("LS_COMP"); case FT_LS_LIT: return("LS_LIT"); case FT_LS_GETENV: return("LS_GETENV"); case FT_LS_DECODECOMP: return("FT_LS_DECODECOMP"); case FT_LS_DECODE: return("FT_LS_DECODE"); case FT_LS_TRIM: return("LS_TRIM"); case FT_LV_COMP: return("LV_COMP"); case FT_LV_COMPFLAG: return("LV_COMPFLAG"); case FT_LV_LIT: return("LV_LIT"); case FT_LV_DAT: return("LV_DAT"); case FT_LV_STRLEN: return("LV_STRLEN"); case FT_LV_PLUS_L: return("LV_PLUS_L"); case FT_LV_MINUS_L: return("LV_MINUS_L"); case FT_LV_DIVIDE_L: return("LV_DIVIDE_L"); case FT_LV_MODULO_L: return("LV_MODULO_L"); case FT_LV_CHAR_LEFT: return("LV_CHAR_LEFT"); case FT_LS_MONTH: return("LS_MONTH"); case FT_LS_LMONTH: return("LS_LMONTH"); case FT_LS_ZONE: return("LS_ZONE"); case FT_LS_DAY: return("LS_DAY"); case FT_LS_WEEKDAY: return("LS_WEEKDAY"); case FT_LS_822DATE: return("LS_822DATE"); case FT_LS_PRETTY: return("LS_PRETTY"); case FT_LV_SEC: return("LV_SEC"); case FT_LV_MIN: return("LV_MIN"); case FT_LV_HOUR: return("LV_HOUR"); case FT_LV_MDAY: return("LV_MDAY"); case FT_LV_MON: return("LV_MON"); case FT_LV_YEAR: return("LV_YEAR"); case FT_LV_YDAY: return("LV_YDAY"); case FT_LV_WDAY: return("LV_WDAY"); case FT_LV_ZONE: return("LV_ZONE"); case FT_LV_CLOCK: return("LV_CLOCK"); case FT_LV_RCLOCK: return("LV_RCLOCK"); case FT_LV_DAYF: return("LV_DAYF"); case FT_LV_DST: return("LV_DST"); case FT_LV_ZONEF: return("LV_ZONEF"); case FT_LS_ADDR: return("LS_ADDR"); case FT_LS_PERS: return("LS_PERS"); case FT_LS_MBOX: return("LS_MBOX"); case FT_LS_HOST: return("LS_HOST"); case FT_LS_PATH: return("LS_PATH"); case FT_LS_GNAME: return("LS_GNAME"); case FT_LS_NOTE: return("LS_NOTE"); case FT_LS_822ADDR: return("LS_822ADDR"); case FT_LS_FRIENDLY: return("LS_FRIENDLY"); case FT_LV_HOSTTYPE: return("LV_HOSTTYPE"); case FT_LV_INGRPF: return("LV_INGRPF"); case FT_LV_NOHOSTF: return("LV_NOHOSTF"); case FT_LOCALDATE: return("LOCALDATE"); case FT_GMTDATE: return("GMTDATE"); case FT_PARSEDATE: return("PARSEDATE"); case FT_PARSEADDR: return("PARSEADDR"); case FT_FORMATADDR: return("FORMATADDR"); case FT_CONCATADDR: return("CONCATADDR"); case FT_MYMBOX: return("MYMBOX"); #ifdef FT_ADDTOSEQ case FT_ADDTOSEQ: return("ADDTOSEQ"); #endif case FT_SAVESTR: return("SAVESTR"); #ifdef FT_PAUSE case FT_PAUSE: return ("PAUSE"); #endif case FT_DONE: return("DONE"); case FT_NOP: return("NOP"); case FT_GOTO: return("GOTO"); case FT_IF_S_NULL: return("IF_S_NULL"); case FT_IF_S: return("IF_S"); case FT_IF_V_EQ: return("IF_V_EQ"); case FT_IF_V_NE: return("IF_V_NE"); case FT_IF_V_GT: return("IF_V_GT"); case FT_IF_MATCH: return("IF_MATCH"); case FT_IF_AMATCH: return("IF_AMATCH"); case FT_S_NULL: return("S_NULL"); case FT_S_NONNULL: return("S_NONNULL"); case FT_V_EQ: return("V_EQ"); case FT_V_NE: return("V_NE"); case FT_V_GT: return("V_GT"); case FT_V_MATCH: return("V_MATCH"); case FT_V_AMATCH: return("V_AMATCH"); default: printf(buf, "/* ??? #%d */", t); return(buf); } } #define FNORD(v, s) if (t & (v)) { \ if (i++ > 0) \ strcat(buf, "|"); \ strcat(buf, s); } static char * c_typestr(int t) { register int i; static char buf[64]; buf[0] = '\0'; if (t & ~(CT_ADDR|CT_DATE)) printf(buf, "0x%x ", t); strcat(buf, "<"); i = 0; FNORD(CT_ADDR, "ADDR"); FNORD(CT_DATE, "DATE"); strcat(buf, ">"); return(buf); } static char * c_flagsstr(int t) { register int i; static char buf[64]; buf[0] = '\0'; if (t & ~(CF_TRUE|CF_PARSED|CF_DATEFAB|CF_TRIMMED)) printf(buf, "0x%x ", t); strcat(buf, "<"); i = 0; FNORD(CF_TRUE, "TRUE"); FNORD(CF_PARSED, "PARSED"); FNORD(CF_DATEFAB, "DATEFAB"); FNORD(CF_TRIMMED, "TRIMMED"); strcat(buf, ">"); return(buf); } #undef FNORD static void litputs(char *s) { if (s) { putc('"', stdout); while (*s) litputc(*s++); putc('"', stdout); } else fputs("", stdout); } static void litputc(char c) { if (c & ~ 0177) { putc('M', stdout); putc('-', stdout); c &= 0177; } if (c < 0x20 || c == 0177) { if (c == '\b') { putc('\\', stdout); putc('b', stdout); } else if (c == '\f') { putc('\\', stdout); putc('f', stdout); } else if (c == '\n') { putc('\\', stdout); putc('n', stdout); } else if (c == '\r') { putc('\\', stdout); putc('r', stdout); } else if (c == '\t') { putc('\\', stdout); putc('t', stdout); } else { putc('^', stdout); putc(c ^ 0x40, stdout); /* DEL to ?, others to alpha */ } } else putc(c, stdout); } nmh-1.5/uip/folder.c000644 007761 000765 00000036335 11765267273 014340 0ustar00kenhkenh000000 000000 /* * folder(s).c -- set/list the current message and/or folder * -- push/pop a folder onto/from the folder stack * -- list the folder stack * * This code is Copyright (c) 2002, 2008, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include static struct swit switches[] = { #define ALLSW 0 { "all", 0 }, #define NALLSW 1 { "noall", 0 }, #define CREATSW 2 { "create", 0 }, #define NCREATSW 3 { "nocreate", 0 }, #define FASTSW 4 { "fast", 0 }, #define NFASTSW 5 { "nofast", 0 }, #define HDRSW 6 { "header", 0 }, #define NHDRSW 7 { "noheader", 0 }, #define PACKSW 8 { "pack", 0 }, #define NPACKSW 9 { "nopack", 0 }, #define VERBSW 10 { "verbose", 0 }, #define NVERBSW 11 { "noverbose", 0 }, #define RECURSW 12 { "recurse", 0 }, #define NRECRSW 13 { "norecurse", 0 }, #define TOTALSW 14 { "total", 0 }, #define NTOTLSW 15 { "nototal", 0 }, #define LISTSW 16 { "list", 0 }, #define NLISTSW 17 { "nolist", 0 }, #define PRNTSW 18 { "print", 0 }, #define NPRNTSW 19 { "noprint", -4 }, #define PUSHSW 20 { "push", 0 }, #define POPSW 21 { "pop", 0 }, #define VERSIONSW 22 { "version", 0 }, #define HELPSW 23 { "help", 0 }, { NULL, 0 } }; static int fshort = 0; /* output only folder names */ static int fcreat = 0; /* should we ask to create new folders? */ static int fpack = 0; /* are we packing the folder? */ static int fverb = 0; /* print actions taken while packing folder */ static int fheader = 0; /* should we output a header? */ static int frecurse = 0; /* recurse through subfolders */ static int ftotal = 0; /* should we output the totals? */ static int all = 0; /* should we output all folders */ static int total_folders = 0; /* total number of folders */ static char *nmhdir; static char *stack = "Folder-Stack"; static char folder[BUFSIZ]; /* * Structure to hold information about * folders as we scan them. */ struct FolderInfo { char *name; int nummsg; int curmsg; int lowmsg; int hghmsg; int others; /* others == 1 if other files in folder */ int error; /* error == 1 for unreadable folder */ }; /* * Dynamically allocated space to hold * all the folder information. */ static struct FolderInfo *fi; static int maxFolderInfo; /* * static prototypes */ static int get_folder_info (char *, char *); static crawl_callback_t get_folder_info_callback; static void print_folders (void); static int sfold (struct msgs *, char *); static void readonly_folders (void); int main (int argc, char **argv) { int printsw = 0, listsw = 0; int pushsw = 0, popsw = 0; char *cp, *dp, *msg = NULL, *argfolder = NULL; char **ap, **argp, buf[BUFSIZ], **arguments; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); /* * If program was invoked with name ending * in `s', then add switch `-all'. */ if (argv[0][strlen (argv[0]) - 1] == 's') all = 1; arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case ALLSW: all = 1; continue; case NALLSW: all = 0; continue; case CREATSW: fcreat = 1; continue; case NCREATSW: fcreat = -1; continue; case FASTSW: fshort++; continue; case NFASTSW: fshort = 0; continue; case HDRSW: fheader = 1; continue; case NHDRSW: fheader = -1; continue; case PACKSW: fpack++; continue; case NPACKSW: fpack = 0; continue; case VERBSW: fverb++; continue; case NVERBSW: fverb = 0; continue; case RECURSW: frecurse++; continue; case NRECRSW: frecurse = 0; continue; case TOTALSW: ftotal = 1; continue; case NTOTLSW: ftotal = -1; continue; case PRNTSW: printsw = 1; continue; case NPRNTSW: printsw = 0; continue; case LISTSW: listsw = 1; continue; case NLISTSW: listsw = 0; continue; case PUSHSW: pushsw = 1; listsw = 1; popsw = 0; continue; case POPSW: popsw = 1; listsw = 1; pushsw = 0; continue; } } if (*cp == '+' || *cp == '@') { if (argfolder) adios (NULL, "only one folder at a time!"); else argfolder = pluspath (cp); } else { if (msg) adios (NULL, "only one (current) message at a time!"); else msg = cp; } } if (!context_find ("path")) free (path ("./", TFOLDER)); nmhdir = concat (m_maildir (""), "/", NULL); /* * If we aren't working with the folder stack * (-push, -pop, -list) then the default is to print. */ if (pushsw == 0 && popsw == 0 && listsw == 0) printsw++; /* Pushing a folder onto the folder stack */ if (pushsw) { if (!argfolder) { /* If no folder is given, the current folder and */ /* the top of the folder stack are swapped. */ if ((cp = context_find (stack))) { dp = getcpy (cp); ap = brkstring (dp, " ", "\n"); argfolder = getcpy(*ap++); } else { adios (NULL, "no other folder"); } for (cp = getcpy (getfolder (1)); *ap; ap++) cp = add (*ap, add (" ", cp)); free (dp); context_replace (stack, cp); /* update folder stack */ } else { /* update folder stack */ context_replace (stack, (cp = context_find (stack)) ? concat (getfolder (1), " ", cp, NULL) : getcpy (getfolder (1))); } } /* Popping a folder off of the folder stack */ if (popsw) { if (argfolder) adios (NULL, "sorry, no folders allowed with -pop"); if ((cp = context_find (stack))) { dp = getcpy (cp); ap = brkstring (dp, " ", "\n"); argfolder = getcpy(*ap++); } else { adios (NULL, "folder stack empty"); } if (*ap) { /* if there's anything left in the stack */ cp = getcpy (*ap++); for (; *ap; ap++) cp = add (*ap, add (" ", cp)); context_replace (stack, cp); /* update folder stack */ } else { context_del (stack); /* delete folder stack entry from context */ } free (dp); } if (pushsw || popsw) { cp = m_maildir(argfolder); if (access (cp, F_OK) == NOTOK) adios (cp, "unable to find folder"); context_replace (pfolder, argfolder); /* update current folder */ context_save (); /* save the context file */ argfolder = NULL; } /* Listing the folder stack */ if (listsw) { printf ("%s", argfolder ? argfolder : getfolder (1)); if ((cp = context_find (stack))) { dp = getcpy (cp); for (ap = brkstring (dp, " ", "\n"); *ap; ap++) printf (" %s", *ap); free (dp); } printf ("\n"); if (!printsw) done (0); } /* Allocate initial space to record folder information */ maxFolderInfo = CRAWL_NUMFOLDERS; fi = mh_xmalloc (maxFolderInfo * sizeof(*fi)); /* * Scan the folders */ if (all || ftotal > 0) { /* * If no folder is given, do them all */ /* change directory to base of nmh directory for crawl_folders */ if (chdir (nmhdir) == NOTOK) adios (nmhdir, "unable to change directory to"); if (!argfolder) { if (msg) admonish (NULL, "no folder given for message %s", msg); readonly_folders (); /* do any readonly folders */ strncpy (folder, (cp = context_find (pfolder)) ? cp : "", sizeof(folder)); crawl_folders (".", get_folder_info_callback, NULL); } else { strncpy (folder, argfolder, sizeof(folder)); if (get_folder_info (argfolder, msg)) { context_replace (pfolder, argfolder);/* update current folder */ context_save (); /* save the context file */ } /* * Since recurse wasn't done in get_folder_info(), * we still need to list all level-1 sub-folders. */ if (!frecurse) crawl_folders (folder, get_folder_info_callback, NULL); } } else { strncpy (folder, argfolder ? argfolder : getfolder (1), sizeof(folder)); /* * Check if folder exists. If not, then see if * we should create it, or just exit. */ create_folder (m_maildir (folder), fcreat, done); if (get_folder_info (folder, msg) && argfolder) { /* update current folder */ context_replace (pfolder, argfolder); } } /* * Print out folder information */ print_folders(); context_save (); /* save the context file */ done (0); return 1; } static int get_folder_info_body (char *fold, char *msg, boolean *crawl_children) { int i, retval = 1; struct msgs *mp = NULL; i = total_folders++; /* * if necessary, reallocate the space * for folder information */ if (total_folders >= maxFolderInfo) { maxFolderInfo += CRAWL_NUMFOLDERS; fi = mh_xrealloc (fi, maxFolderInfo * sizeof(*fi)); } fi[i].name = fold; fi[i].nummsg = 0; fi[i].curmsg = 0; fi[i].lowmsg = 0; fi[i].hghmsg = 0; fi[i].others = 0; fi[i].error = 0; if ((ftotal > 0) || !fshort || msg || fpack) { /* * create message structure and get folder info */ if (!(mp = folder_read (fold))) { admonish (NULL, "unable to read folder %s", fold); return 0; } /* set the current message */ if (msg && !sfold (mp, msg)) retval = 0; if (fpack) { if (folder_pack (&mp, fverb) == -1) done (1); seq_save (mp); /* synchronize the sequences */ context_save (); /* save the context file */ } /* record info for this folder */ if ((ftotal > 0) || !fshort) { fi[i].nummsg = mp->nummsg; fi[i].curmsg = mp->curmsg; fi[i].lowmsg = mp->lowmsg; fi[i].hghmsg = mp->hghmsg; fi[i].others = other_files (mp); } folder_free (mp); /* free folder/message structure */ } *crawl_children = (frecurse && (fshort || fi[i].others) && (fi[i].error == 0)); return retval; } static boolean get_folder_info_callback (char *fold, void *baton) { boolean crawl_children; NMH_UNUSED (baton); get_folder_info_body (fold, NULL, &crawl_children); fflush (stdout); return crawl_children; } static int get_folder_info (char *fold, char *msg) { boolean crawl_children; int retval; retval = get_folder_info_body (fold, msg, &crawl_children); if (crawl_children) { crawl_folders (fold, get_folder_info_callback, NULL); } return retval; } /* * Print folder information */ static void print_folders (void) { int i, len, hasempty = 0, curprinted; int maxlen = 0, maxnummsg = 0, maxlowmsg = 0; int maxhghmsg = 0, maxcurmsg = 0, total_msgs = 0; int nummsgdigits, lowmsgdigits; int hghmsgdigits, curmsgdigits; char tmpname[BUFSIZ]; /* * compute a few values needed to for * printing various fields */ for (i = 0; i < total_folders; i++) { /* length of folder name */ len = strlen (fi[i].name); if (len > maxlen) maxlen = len; /* If folder has error, skip the rest */ if (fi[i].error) continue; /* calculate total number of messages */ total_msgs += fi[i].nummsg; /* maximum number of messages */ if (fi[i].nummsg > maxnummsg) maxnummsg = fi[i].nummsg; /* maximum low message */ if (fi[i].lowmsg > maxlowmsg) maxlowmsg = fi[i].lowmsg; /* maximum high message */ if (fi[i].hghmsg > maxhghmsg) maxhghmsg = fi[i].hghmsg; /* maximum current message */ if (fi[i].curmsg >= fi[i].lowmsg && fi[i].curmsg <= fi[i].hghmsg && fi[i].curmsg > maxcurmsg) maxcurmsg = fi[i].curmsg; /* check for empty folders */ if (fi[i].nummsg == 0) hasempty = 1; } nummsgdigits = num_digits (maxnummsg); lowmsgdigits = num_digits (maxlowmsg); hghmsgdigits = num_digits (maxhghmsg); curmsgdigits = num_digits (maxcurmsg); if (hasempty && nummsgdigits < 2) nummsgdigits = 2; /* * Print the header */ if (fheader > 0 || (all && !fshort && fheader >= 0)) printf ("%-*s %*s %-*s; %-*s %*s\n", maxlen+1, "FOLDER", nummsgdigits + 13, "# MESSAGES", lowmsgdigits + hghmsgdigits + 4, " RANGE", curmsgdigits + 4, "CUR", 9, "(OTHERS)"); /* * Print folder information */ if (all || fshort || ftotal < 1) { for (i = 0; i < total_folders; i++) { if (fshort) { printf ("%s\n", fi[i].name); continue; } /* Add `+' to end of name, if folder is current */ if (strcmp (folder, fi[i].name)) snprintf (tmpname, sizeof(tmpname), "%s", fi[i].name); else snprintf (tmpname, sizeof(tmpname), "%s+", fi[i].name); if (fi[i].error) { printf ("%-*s is unreadable\n", maxlen+1, tmpname); continue; } printf ("%-*s ", maxlen+1, tmpname); curprinted = 0; /* remember if we print cur */ if (fi[i].nummsg == 0) { printf ("has %*s messages%*s", nummsgdigits, "no", fi[i].others ? lowmsgdigits + hghmsgdigits + 5 : 0, ""); } else { printf ("has %*d message%s (%*d-%*d)", nummsgdigits, fi[i].nummsg, (fi[i].nummsg == 1) ? " " : "s", lowmsgdigits, fi[i].lowmsg, hghmsgdigits, fi[i].hghmsg); if (fi[i].curmsg >= fi[i].lowmsg && fi[i].curmsg <= fi[i].hghmsg) { curprinted = 1; printf ("; cur=%*d", curmsgdigits, fi[i].curmsg); } } if (fi[i].others) printf (";%*s (others)", curprinted ? 0 : curmsgdigits + 6, ""); printf (".\n"); } } /* * Print folder/message totals */ if (ftotal > 0 || (all && !fshort && ftotal >= 0)) { if (all) printf ("\n"); printf ("TOTAL = %d message%c in %d folder%s.\n", total_msgs, total_msgs != 1 ? 's' : ' ', total_folders, total_folders != 1 ? "s" : ""); } fflush (stdout); } /* * Set the current message and sychronize sequences */ static int sfold (struct msgs *mp, char *msg) { /* parse the message range/sequence/name and set SELECTED */ if (!m_convert (mp, msg)) return 0; if (mp->numsel > 1) { admonish (NULL, "only one message at a time!"); return 0; } seq_setprev (mp); /* set the previous-sequence */ seq_setcur (mp, mp->lowsel);/* set current message */ seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ return 1; } /* * Do the read only folders */ static void readonly_folders (void) { int atrlen; char atrcur[BUFSIZ]; register struct node *np; snprintf (atrcur, sizeof(atrcur), "atr-%s-", current); atrlen = strlen (atrcur); for (np = m_defs; np; np = np->n_next) if (ssequal (atrcur, np->n_name) && !ssequal (nmhdir, np->n_name + atrlen)) get_folder_info (np->n_name + atrlen, NULL); } nmh-1.5/uip/forw.c000644 007761 000765 00000042021 11765267273 014027 0ustar00kenhkenh000000 000000 /* * forw.c -- forward a message, or group of messages. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #define IFORMAT "digest-issue-%s" #define VFORMAT "digest-volume-%s" static struct swit switches[] = { #define ANNOSW 0 { "annotate", 0 }, #define NANNOSW 1 { "noannotate", 0 }, #define DFOLDSW 2 { "draftfolder +folder", 0 }, #define DMSGSW 3 { "draftmessage msg", 0 }, #define NDFLDSW 4 { "nodraftfolder", 0 }, #define EDITRSW 5 { "editor editor", 0 }, #define NEDITSW 6 { "noedit", 0 }, #define FILTSW 7 { "filter filterfile", 0 }, #define FORMSW 8 { "form formfile", 0 }, #define FRMTSW 9 { "format", 5 }, #define NFRMTSW 10 { "noformat", 7 }, #define INPLSW 11 { "inplace", 0 }, #define NINPLSW 12 { "noinplace", 0 }, #define MIMESW 13 { "mime", 0 }, #define NMIMESW 14 { "nomime", 0 }, #define DGSTSW 15 { "digest list", 0 }, #define ISSUESW 16 { "issue number", 0 }, #define VOLUMSW 17 { "volume number", 0 }, #define WHATSW 18 { "whatnowproc program", 0 }, #define NWHATSW 19 { "nowhatnowproc", 0 }, #define BITSTUFFSW 20 { "dashstuffing", 0 }, /* interface to mhl */ #define NBITSTUFFSW 21 { "nodashstuffing", 0 }, #define VERSIONSW 22 { "version", 0 }, #define HELPSW 23 { "help", 0 }, #define FILESW 24 { "file file", 4 }, /* interface from msh */ #define BILDSW 25 { "build", 5 }, /* interface from mhe */ #define FROMSW 26 { "from address", 0 }, #define TOSW 27 { "to address", 0 }, #define CCSW 28 { "cc address", 0 }, #define SUBJECTSW 29 { "subject text", 0 }, #define FCCSW 30 { "fcc mailbox", 0 }, #define WIDTHSW 31 { "width columns", 0 }, { NULL, 0 } }; static struct swit aqrnl[] = { #define NOSW 0 { "quit", 0 }, #define YESW 1 { "replace", 0 }, #define LISTDSW 2 { "list", 0 }, #define REFILSW 3 { "refile +folder", 0 }, #define NEWSW 4 { "new", 0 }, { NULL, 0 } }; static struct swit aqrl[] = { { "quit", 0 }, { "replace", 0 }, { "list", 0 }, { "refile +folder", 0 }, { NULL, 0 } }; static char drft[BUFSIZ]; static char delim3[] = "\n------------------------------------------------------------\n\n"; static char delim4[] = "\n------------------------------\n\n"; static struct msgs *mp = NULL; /* used a lot */ /* * static prototypes */ static void mhl_draft (int, char *, int, int, char *, char *, int); static void copy_draft (int, char *, char *, int, int, int); static void copy_mime_draft (int); int main (int argc, char **argv) { int msgp = 0, anot = 0, inplace = 1, mime = 0; int issue = 0, volume = 0, dashstuff = 0; int nedit = 0, nwhat = 0, i, in; int out, isdf = 0, msgnum = 0; int outputlinelen = OUTPUTLINELEN; int dat[5]; char *cp, *cwd, *maildir, *dfolder = NULL; char *dmsg = NULL, *digest = NULL, *ed = NULL; char *file = NULL, *filter = NULL, *folder = NULL, *fwdmsg = NULL; char *from = NULL, *to = NULL, *cc = NULL, *subject = NULL, *fcc = NULL; char *form = NULL, buf[BUFSIZ], value[10]; char **argp, **arguments, *msgs[MAXARGS]; struct stat st; int buildsw = 0; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case ANNOSW: anot++; continue; case NANNOSW: anot = 0; continue; case EDITRSW: if (!(ed = *argp++) || *ed == '-') adios (NULL, "missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: nedit++; continue; case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') adios (NULL, "missing argument to %s", argp[-2]); nwhat = 0; continue; case BILDSW: buildsw++; /* fall... */ case NWHATSW: nwhat++; continue; case FILESW: if (file) adios (NULL, "only one file at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case FILTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); filter = getcpy (etcpath (cp)); mime = 0; continue; case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case FRMTSW: filter = getcpy (etcpath (mhlforward)); continue; case NFRMTSW: filter = NULL; continue; case INPLSW: inplace++; continue; case NINPLSW: inplace = 0; continue; case MIMESW: mime++; filter = NULL; continue; case NMIMESW: mime = 0; continue; case DGSTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); digest = getcpy(cp); mime = 0; continue; case ISSUESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((issue = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case VOLUMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((volume = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case DFOLDSW: if (dfolder) adios (NULL, "only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) adios (NULL, "only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; isdf = NOTOK; continue; case BITSTUFFSW: dashstuff = 1; /* trinary logic */ continue; case NBITSTUFFSW: dashstuff = -1; /* trinary logic */ continue; case FROMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); from = addlist(from, cp); continue; case TOSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); to = addlist(to, cp); continue; case CCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); cc = addlist(cc, cp); continue; case FCCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); fcc = addlist(fcc, cp); continue; case SUBJECTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); subject = getcpy(cp); continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((outputlinelen = atoi(cp)) < 10) adios (NULL, "impossible width %d", outputlinelen); continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { msgs[msgp++] = cp; } } cwd = getcpy (pwd ()); if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && (msgp || folder)) adios (NULL, "can't mix files and folders/msgs"); try_it_again: strncpy (drft, buildsw ? m_maildir ("draft") : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft)); /* Check if a draft already exists */ if (!buildsw && stat (drft, &st) != NOTOK) { printf ("Draft \"%s\" exists (%ld bytes).", drft, (long) st.st_size); for (i = LISTDSW; i != YESW;) { if (!(argp = getans ("\nDisposition? ", isdf ? aqrnl : aqrl))) done (1); switch (i = smatch (*argp, isdf ? aqrnl : aqrl)) { case NOSW: done (0); case NEWSW: dmsg = NULL; goto try_it_again; case YESW: break; case LISTDSW: showfile (++argp, drft); break; case REFILSW: if (refile (++argp, drft) == 0) i = YESW; break; default: advise (NULL, "say what?"); break; } } } if (file) { /* * Forwarding a file. */ anot = 0; /* don't want to annotate a file */ } else { /* * Forwarding a message. */ if (!msgp) msgs[msgp++] = "cur"; if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous sequence */ /* * Find the first message in our set and use it as the input * for the component scanner */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) { fwdmsg = strdup(m_name(msgnum)); break; } if (! fwdmsg) adios (NULL, "Unable to find input message"); } if (filter && access (filter, R_OK) == NOTOK) adios (filter, "unable to read"); /* * Open form (component) file. */ if (digest) { if (issue == 0) { snprintf (buf, sizeof(buf), IFORMAT, digest); if (volume == 0 && (cp = context_find (buf)) && ((issue = atoi (cp)) < 0)) issue = 0; issue++; } if (volume == 0) { snprintf (buf, sizeof(buf), VFORMAT, digest); if ((cp = context_find (buf)) == NULL || (volume = atoi (cp)) <= 0) volume = 1; } if (!form) form = digestcomps; } else { if (!form) form = forwcomps; } dat[0] = digest ? issue : msgnum; dat[1] = volume; dat[2] = 0; dat[3] = outputlinelen; dat[4] = 0; in = build_form (form, digest, dat, from, to, cc, fcc, subject, file ? file : fwdmsg); if ((out = creat (drft, m_gmprot ())) == NOTOK) adios (drft, "unable to create"); /* * copy the components into the draft */ cpydata (in, out, form, drft); close (in); if (file) { /* just copy the file into the draft */ if ((in = open (file, O_RDONLY)) == NOTOK) adios (file, "unable to open"); cpydata (in, out, file, drft); close (in); close (out); } else { /* * If filter file is defined, then format the * messages into the draft using mhlproc. */ if (filter) mhl_draft (out, digest, volume, issue, drft, filter, dashstuff); else if (mime) copy_mime_draft (out); else copy_draft (out, digest, drft, volume, issue, dashstuff); close (out); if (digest) { snprintf (buf, sizeof(buf), IFORMAT, digest); snprintf (value, sizeof(value), "%d", issue); context_replace (buf, getcpy (value)); snprintf (buf, sizeof(buf), VFORMAT, digest); snprintf (value, sizeof(value), "%d", volume); context_replace (buf, getcpy (value)); } context_replace (pfolder, folder); /* update current folder */ seq_setcur (mp, mp->lowsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } if (nwhat) done (0); what_now (ed, nedit, NOUSE, drft, NULL, 0, mp, anot ? "Forwarded" : NULL, inplace, cwd, 0); done (1); return 1; } /* * Filter the messages you are forwarding, into the * draft calling the mhlproc, and reading its output * from a pipe. */ static void mhl_draft (int out, char *digest, int volume, int issue, char *file, char *filter, int dashstuff) { pid_t child_id; int i, msgnum, pd[2]; char *vec[MAXARGS]; char buf1[BUFSIZ]; char buf2[BUFSIZ]; if (pipe (pd) == NOTOK) adios ("pipe", "unable to create"); vec[0] = r1bindex (mhlproc, '/'); for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: adios ("fork", "unable to"); case OK: close (pd[0]); dup2 (pd[1], 1); close (pd[1]); i = 1; vec[i++] = "-forwall"; vec[i++] = "-form"; vec[i++] = filter; if (digest) { vec[i++] = "-digest"; vec[i++] = digest; vec[i++] = "-issue"; snprintf (buf1, sizeof(buf1), "%d", issue); vec[i++] = buf1; vec[i++] = "-volume"; snprintf (buf2, sizeof(buf2), "%d", volume); vec[i++] = buf2; } /* * Are we dashstuffing (quoting) the lines that begin * with `-'. We use the mhl default (don't add any flag) * unless the user has specified a specific flag. */ if (dashstuff > 0) vec[i++] = "-dashstuffing"; else if (dashstuff < 0) vec[i++] = "-nodashstuffing"; if (mp->numsel >= MAXARGS - i) adios (NULL, "more than %d messages for %s exec", MAXARGS - i, vec[0]); /* * Now add the message names to filter. We can only * handle about 995 messages (because vec is fixed size), * but that should be plenty. */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel && i < (int) sizeof(vec) - 1; msgnum++) if (is_selected (mp, msgnum)) vec[i++] = getcpy (m_name (msgnum)); vec[i] = NULL; execvp (mhlproc, vec); fprintf (stderr, "unable to exec "); perror (mhlproc); _exit (-1); default: close (pd[1]); cpydata (pd[0], out, vec[0], file); close (pd[0]); pidXwait(child_id, mhlproc); break; } } /* * Copy the messages into the draft. The messages are * not filtered through the mhlproc. Do dashstuffing if * necessary. */ static void copy_draft (int out, char *digest, char *file, int volume, int issue, int dashstuff) { int fd,i, msgcnt, msgnum; int len, buflen; register char *bp, *msgnam; char buffer[BUFSIZ]; msgcnt = 1; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) { if (digest) { strncpy (buffer, msgnum == mp->lowsel ? delim3 : delim4, sizeof(buffer)); } else { /* Get buffer ready to go */ bp = buffer; buflen = sizeof(buffer); strncpy (bp, "\n-------", buflen); len = strlen (bp); bp += len; buflen -= len; if (msgnum == mp->lowsel) { snprintf (bp, buflen, " Forwarded Message%s", mp->numsel > 1 ? "s" : ""); } else { snprintf (bp, buflen, " Message %d", msgcnt); } len = strlen (bp); bp += len; buflen -= len; strncpy (bp, "\n\n", buflen); } write (out, buffer, strlen (buffer)); if ((fd = open (msgnam = m_name (msgnum), O_RDONLY)) == NOTOK) { admonish (msgnam, "unable to read message"); continue; } /* * Copy the message. Add RFC934 quoting (dashstuffing) * unless given the -nodashstuffing flag. */ if (dashstuff >= 0) cpydgst (fd, out, msgnam, file); else cpydata (fd, out, msgnam, file); close (fd); msgcnt++; } } if (digest) { strncpy (buffer, delim4, sizeof(buffer)); } else { snprintf (buffer, sizeof(buffer), "\n------- End of Forwarded Message%s\n", mp->numsel > 1 ? "s" : ""); } write (out, buffer, strlen (buffer)); if (digest) { snprintf (buffer, sizeof(buffer), "End of %s Digest [Volume %d Issue %d]\n", digest, volume, issue); i = strlen (buffer); for (bp = buffer + i; i > 1; i--) *bp++ = '*'; *bp++ = '\n'; *bp = 0; write (out, buffer, strlen (buffer)); } } /* * Create a mhn composition file for forwarding message. */ static void copy_mime_draft (int out) { int msgnum; char buffer[BUFSIZ]; snprintf (buffer, sizeof(buffer), "#forw [forwarded message%s] +%s", mp->numsel == 1 ? "" : "s", mp->foldpath); write (out, buffer, strlen (buffer)); for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) { snprintf (buffer, sizeof(buffer), " %s", m_name (msgnum)); write (out, buffer, strlen (buffer)); } write (out, "\n", 1); } nmh-1.5/uip/forwsbr.c000755 007761 000765 00000011410 11762736346 014536 0ustar00kenhkenh000000 000000 /* * forwsbr.c -- subroutine to build a draft from a component file * * This code is Copyright (c) 2012, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include /* * Take from replsbr.c - a buffer big enough to read in data header lines * in reasonable chunks but not enough to slurp in the whole message */ static char msgbuf[256]; #define COMPFREE(c) if (c->c_text) free(c->c_text) /* * A list of components we treat as addresses */ static char *addrcomps[] = { "from", "sender", "reply-to", "to", "cc", "bcc", "resent-from", "resent-sender", "resent-reply-to", "resent-to", "resent-cc", "resent-bcc", NULL }; int build_form (char *form, char *digest, int *dat, char *from, char *to, char *cc, char *fcc, char *subject, char *inputfile) { int in; int fmtsize, state, char_read = 0; unsigned i; register char *nfs; char *line, tmpfil[BUFSIZ], name[NAMESZ], **ap; FILE *tmp; register struct comp *cptr; struct format *fmt; char *cp = NULL; /* * Open the message we'll be scanning for components */ if ((tmp = fopen(inputfile, "r")) == NULL) adios (inputfile, "Unable to open"); /* Get new format string */ nfs = new_fs (form, NULL, NULL); fmtsize = strlen (nfs) + 256; /* Compile format string */ (void) fmt_compile (nfs, &fmt); /* * Mark any components tagged as address components */ for (ap = addrcomps; *ap; ap++) { FINDCOMP (cptr, *ap); if (cptr) cptr->c_type |= CT_ADDR; } /* * Process our message and save all relevant components * * A lot of this is taken from replsbr.c; should we try to merge * these routines? */ for (state = FLD;;) { state = m_getfld(state, name, msgbuf, sizeof(msgbuf), tmp); switch (state) { case FLD: case FLDPLUS: /* * If we find a component that we're interested in, save * a copy. We don't do all of that weird buffer switching * that replout does. */ if ((cptr = wantcomp[CHASH(name)])) do { if (mh_strcasecmp(name, cptr->c_name) == 0) { char_read += msg_count; if (! cptr->c_text) { cptr->c_text = strdup(msgbuf); } else { i = strlen(cptr->c_text) - 1; if (cptr->c_text[i] == '\n') { if (cptr->c_type & CT_ADDR) { cptr->c_text[i] = '\0'; cptr->c_text = add(",\n\t", cptr->c_text); } else { cptr->c_text = add ("\t", cptr->c_text); } } cptr->c_text = add(msgbuf, cptr->c_text); } while (state == FLDPLUS) { state = m_getfld(state, name, msgbuf, sizeof(msgbuf), tmp); cptr->c_text = add(msgbuf, cptr->c_text); char_read += msg_count; } break; } } while ((cptr = cptr->c_next)); while (state == FLDPLUS) state = m_getfld(state, name, msgbuf, sizeof(msgbuf), tmp); break; case LENERR: case FMTERR: case BODY: case FILEEOF: goto finished; default: adios(NULL, "m_getfld() returned %d", state); } } /* * Override any components just in case they were included in the * input message. Also include command-line components given here */ finished: FINDCOMP (cptr, "digest"); if (cptr) { COMPFREE(cptr); cptr->c_text = digest; } FINDCOMP (cptr, "nmh-date"); if (cptr) { COMPFREE(cptr); cptr->c_text = getcpy(dtimenow (0)); } FINDCOMP (cptr, "nmh-from"); if (cptr) { COMPFREE(cptr); cptr->c_text = from; } FINDCOMP (cptr, "nmh-to"); if (cptr) { COMPFREE(cptr); cptr->c_text = to; } FINDCOMP (cptr, "nmh-cc"); if (cptr) { COMPFREE(cptr); cptr->c_text = cc; } FINDCOMP (cptr, "nmh-subject"); if (cptr) { COMPFREE(cptr); cptr->c_text = subject; } FINDCOMP (cptr, "fcc"); if (cptr) { COMPFREE(cptr); cptr->c_text = fcc; } cp = m_mktemp2(NULL, invo_name, NULL, &tmp); if (cp == NULL) adios("forw", "unable to create temporary file"); strncpy (tmpfil, cp, sizeof(tmpfil)); unlink (tmpfil); if ((in = dup (fileno (tmp))) == NOTOK) adios ("dup", "unable to"); line = mh_xmalloc ((unsigned) fmtsize); fmt_scan (fmt, line, fmtsize, dat); fputs (line, tmp); free (line); if (fclose (tmp)) adios (tmpfil, "error writing"); lseek (in, (off_t) 0, SEEK_SET); /* * Free any component buffers that we allocated */ for (i = 0; i < (sizeof(wantcomp) / sizeof(struct comp)); i++) for (cptr = wantcomp[i]; cptr != NULL; cptr = cptr->c_next) COMPFREE(cptr); return in; } nmh-1.5/uip/inc.c000644 007761 000765 00000064070 11765267273 013633 0ustar00kenhkenh000000 000000 /* * inc.c -- incorporate messages from a maildrop into a folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #ifdef MAILGROUP /* Revised: Sat Apr 14 17:08:17 PDT 1990 (marvit@hplabs) * Added hpux hacks to set and reset gid to be "mail" as needed. The reset * is necessary so inc'ed mail is the group of the inc'er, rather than * "mail". We setgid to egid only when [un]locking the mail file. This * is also a major security precaution which will not be explained here. * * Fri Feb 7 16:04:57 PST 1992 John Romine * NB: I'm not 100% sure that this setgid stuff is secure even now. * * See the *GROUPPRIVS() macros later. I'm reasonably happy with the setgid * attribute. Running setuid root is probably not a terribly good idea, though. * -- Peter Maydell , 04/1998 * * Peter Maydell's patch slightly modified for nmh 0.28-pre2. * Ruud de Rooij Wed, 22 Jul 1998 13:24:22 +0200 */ #endif #include #include #include #include #include #include #include #include #include #include #include #include #ifndef CYRUS_SASL # define SASLminc(a) (a) #else # define SASLminc(a) 0 #endif static struct swit switches[] = { #define AUDSW 0 { "audit audit-file", 0 }, #define NAUDSW 1 { "noaudit", 0 }, #define CHGSW 2 { "changecur", 0 }, #define NCHGSW 3 { "nochangecur", 0 }, #define FILESW 4 { "file name", 0 }, #define FORMSW 5 { "form formatfile", 0 }, #define FMTSW 6 { "format string", 5 }, #define HOSTSW 7 { "host hostname", 0 }, #define USERSW 8 { "user username", 0 }, #define PACKSW 9 { "pack file", 0}, #define NPACKSW 10 { "nopack", 0 }, #define PORTSW 11 { "port name/number", 0 }, #define SILSW 12 { "silent", 0 }, #define NSILSW 13 { "nosilent", 0 }, #define TRNCSW 14 { "truncate", 0 }, #define NTRNCSW 15 { "notruncate", 0 }, #define WIDTHSW 16 { "width columns", 0 }, #define VERSIONSW 17 { "version", 0 }, #define HELPSW 18 { "help", 0 }, #define SNOOPSW 19 { "snoop", -5 }, #define SASLSW 20 { "sasl", SASLminc(-4) }, #define SASLMECHSW 21 { "saslmech", SASLminc(-8) }, #define PROXYSW 22 { "proxy command", 0 }, { NULL, 0 } }; /* * flags for the mail source */ #define INC_FILE 0 #define INC_POP 1 static int inc_type; static struct Maildir_entry { char *filename; time_t mtime; } *Maildir = NULL; static int num_maildir_entries = 0; static int snoop = 0; extern char response[]; static int size; static long pos; static int mbx_style = MMDF_FORMAT; static int pd = NOTOK; static long start; static long stop; static char *packfile = NULL; static FILE *pf = NULL; /* This is an attempt to simplify things by putting all the * privilege ops into macros. * *GROUPPRIVS() is related to handling the setgid MAIL property, * and only applies if MAILGROUP is defined. * Basically, SAVEGROUPPRIVS() is called right at the top of main() * to initialise things, and then DROPGROUPPRIVS() and GETGROUPPRIVS() * do the obvious thing. * * There's probably a better implementation if we're allowed to use * BSD-style setreuid() rather than using POSIX saved-ids. * Anyway, if you're euid root it's a bit pointless to drop the group * permissions... * * I'm pretty happy that the security is good provided we aren't setuid root. * The only things we trust with group=mail privilege are lkfopen() * and lkfclose(). */ /* * For setting and returning to "mail" gid */ #ifdef MAILGROUP static int return_gid; #define TRYDROPGROUPPRIVS() DROPGROUPPRIVS() #define DROPGROUPPRIVS() setgid(getgid()) #define GETGROUPPRIVS() setgid(return_gid) #define SAVEGROUPPRIVS() return_gid = getegid() #else /* define *GROUPPRIVS() as null; this avoids having lots of "#ifdef MAILGROUP"s */ #define TRYDROPGROUPPRIVS() #define DROPGROUPPRIVS() #define GETGROUPPRIVS() #define SAVEGROUPPRIVS() #endif /* not MAILGROUP */ /* these variables have to be globals so that done() can correctly clean up the lockfile */ static int locked = 0; static char *newmail; static FILE *in; /* * prototypes */ char *map_name(char *); static void inc_done(int) NORETURN; static int pop_action(char *); static int pop_pack(char *); static int map_count(void); int maildir_srt(const void *va, const void *vb) { const struct Maildir_entry *a = va, *b = vb; if (a->mtime > b->mtime) return 1; else if (a->mtime < b->mtime) return -1; else return 0; } int main (int argc, char **argv) { int chgflag = 1, trnflag = 1; int noisy = 1, width = 0; int hghnum = 0, msgnum = 0; int sasl = 0; int incerr = 0; /* <0 if inc hits an error which means it should not truncate mailspool */ char *cp, *maildir = NULL, *folder = NULL; char *format = NULL, *form = NULL; char *host = NULL, *port = NULL, *user = NULL, *proxy = NULL; char *audfile = NULL, *from = NULL, *saslmech = NULL; char buf[BUFSIZ], **argp, *nfs, **arguments; struct msgs *mp = NULL; struct stat st, s1; FILE *aud = NULL; char b[MAXPATHLEN + 1]; char *maildir_copy = NULL; /* copy of mail directory because the static gets overwritten */ int nmsgs, nbytes; char *pass = NULL; char *MAILHOST_env_variable; done=inc_done; /* absolutely the first thing we do is save our privileges, * and drop them if we can. */ SAVEGROUPPRIVS(); TRYDROPGROUPPRIVS(); #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Scheme is: * use MAILHOST environment variable if present, * else try Hesiod. * If that fails, use the default (if any) * provided by mts.conf in mts_init() */ if ((MAILHOST_env_variable = getenv("MAILHOST")) != NULL) pophost = MAILHOST_env_variable; /* * If there is a valid "pophost" entry in mts.conf, * then use it as the default host. */ if (pophost && *pophost) host = pophost; if ((cp = getenv ("MHPOPDEBUG")) && *cp) snoop++; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case AUDSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); audfile = getcpy (m_maildir (cp)); continue; case NAUDSW: audfile = NULL; continue; case CHGSW: chgflag++; continue; case NCHGSW: chgflag = 0; continue; /* * The flag `trnflag' has the value: * * 2 if -truncate is given * 1 by default (truncating is default) * 0 if -notruncate is given */ case TRNCSW: trnflag = 2; continue; case NTRNCSW: trnflag = 0; continue; case FILESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); from = path (cp, TFILE); /* * If the truncate file is in default state, * change to not truncate. */ if (trnflag == 1) trnflag = 0; continue; case SILSW: noisy = 0; continue; case NSILSW: noisy++; continue; case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') adios (NULL, "missing argument to %s", argp[-2]); form = NULL; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); width = atoi (cp); continue; case HOSTSW: if (!(host = *argp++) || *host == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case PORTSW: if (!(host = *argp++) || *port == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case USERSW: if (!(user = *argp++) || *user == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case PACKSW: if (!(packfile = *argp++) || *packfile == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NPACKSW: packfile = NULL; continue; case SNOOPSW: snoop++; continue; case SASLSW: sasl++; continue; case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case PROXYSW: if (!(proxy = *argp++) || *proxy == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { adios (NULL, "usage: %s [+folder] [switches]", invo_name); } } /* NOTE: above this point you should use TRYDROPGROUPPRIVS(), * not DROPGROUPPRIVS(). */ if (host && !*host) host = NULL; /* guarantee dropping group priveleges; we might not have done so earlier */ DROPGROUPPRIVS(); /* * Where are we getting the new mail? */ if (from) inc_type = INC_FILE; else if (host) inc_type = INC_POP; else inc_type = INC_FILE; /* * Are we getting the mail from * a POP server? */ if (inc_type == INC_POP) { if (user == NULL) user = getusername (); if (sasl) pass = getusername (); else ruserpass (host, &user, &pass); /* * initialize POP connection */ if (pop_init (host, port, user, pass, proxy, snoop, sasl, saslmech) == NOTOK) adios (NULL, "%s", response); /* Check if there are any messages */ if (pop_stat (&nmsgs, &nbytes) == NOTOK) adios (NULL, "%s", response); if (nmsgs == 0) { pop_quit(); adios (NULL, "no mail to incorporate"); } } /* * We will get the mail from a file * (typically the standard maildrop) */ if (inc_type == INC_FILE) { if (from) newmail = from; else if ((newmail = getenv ("MAILDROP")) && *newmail) newmail = m_mailpath (newmail); else if ((newmail = context_find ("maildrop")) && *newmail) newmail = m_mailpath (newmail); else { newmail = concat (MAILDIR, "/", MAILFIL, NULL); } if (stat (newmail, &s1) == NOTOK || s1.st_size == 0) adios (NULL, "no mail to incorporate"); if (s1.st_mode & S_IFDIR) { DIR *md; struct dirent *de; struct stat ms; int i; i = 0; cp = concat (newmail, "/new", NULL); if ((md = opendir(cp)) == NULL) adios (NULL, "unable to open %s", cp); while ((de = readdir (md)) != NULL) { if (de->d_name[0] == '.') continue; if (i >= num_maildir_entries) { if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL) adios(NULL, "not enough memory for %d messages", 2*i+16); num_maildir_entries = 2*i+16; } Maildir[i].filename = concat (cp, "/", de->d_name, NULL); if (stat(Maildir[i].filename, &ms) != 0) adios (Maildir[i].filename, "couldn't get delivery time"); Maildir[i].mtime = ms.st_mtime; i++; } free (cp); closedir (md); cp = concat (newmail, "/cur", NULL); if ((md = opendir(cp)) == NULL) adios (NULL, "unable to open %s", cp); while ((de = readdir (md)) != NULL) { if (de->d_name[0] == '.') continue; if (i >= num_maildir_entries) { if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL) adios(NULL, "not enough memory for %d messages", 2*i+16); num_maildir_entries = 2*i+16; } Maildir[i].filename = concat (cp, "/", de->d_name, NULL); if (stat(Maildir[i].filename, &ms) != 0) adios (Maildir[i].filename, "couldn't get delivery time"); Maildir[i].mtime = ms.st_mtime; i++; } free (cp); closedir (md); if (i == 0) adios (NULL, "no mail to incorporate"); num_maildir_entries = i; qsort (Maildir, num_maildir_entries, sizeof(*Maildir), maildir_srt); } if ((cp = strdup(newmail)) == (char *)0) adios (NULL, "error allocating memory to copy newmail"); newmail = cp; } /* skip the folder setup */ if ((inc_type == INC_POP) && packfile) goto go_to_it; if (!context_find ("path")) free (path ("./", TFOLDER)); if (!folder) folder = getfolder (0); maildir = m_maildir (folder); if ((maildir_copy = strdup(maildir)) == (char *)0) adios (maildir, "error allocating memory to copy maildir"); if (!folder_exists(maildir)) { /* If the folder doesn't exist, and we're given the -silent flag, * just fail. */ if (noisy) create_folder(maildir, 0, done); else done (1); } if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); go_to_it: if (inc_type == INC_FILE && Maildir == NULL) { if (access (newmail, W_OK) != NOTOK) { locked++; if (trnflag) { SIGNAL (SIGHUP, SIG_IGN); SIGNAL (SIGINT, SIG_IGN); SIGNAL (SIGQUIT, SIG_IGN); SIGNAL (SIGTERM, SIG_IGN); } GETGROUPPRIVS(); /* Reset gid to lock mail file */ in = lkfopen (newmail, "r"); DROPGROUPPRIVS(); if (in == NULL) adios (NULL, "unable to lock and fopen %s", newmail); fstat (fileno(in), &s1); } else { trnflag = 0; if ((in = fopen (newmail, "r")) == NULL) adios (newmail, "unable to read"); } } /* This shouldn't be necessary but it can't hurt. */ DROPGROUPPRIVS(); if (audfile) { int i; if ((i = stat (audfile, &st)) == NOTOK) advise (NULL, "Creating Receive-Audit: %s", audfile); if ((aud = fopen (audfile, "a")) == NULL) adios (audfile, "unable to append to"); else if (i == NOTOK) chmod (audfile, m_gmprot ()); fprintf (aud, from ? "<> %s -ms %s\n" : host ? "<> %s -host %s -user %s\n" : "<> %s\n", dtimenow (0), from ? from : host, user); } /* Get new format string */ nfs = new_fs (form, format, FORMAT); if (noisy) { printf ("Incorporating new mail into %s...\n\n", folder); fflush (stdout); } /* * Get the mail from a POP server */ if (inc_type == INC_POP) { int i; if (packfile) { packfile = path (packfile, TFILE); if (stat (packfile, &st) == NOTOK) { if (errno != ENOENT) adios (packfile, "error on file"); cp = concat ("Create file \"", packfile, "\"? ", NULL); if (noisy && !getanswer (cp)) done (1); free (cp); } msgnum = map_count (); if ((pd = mbx_open (packfile, mbx_style, getuid(), getgid(), m_gmprot())) == NOTOK) adios (packfile, "unable to open"); if ((pf = fdopen (pd, "w+")) == NULL) adios (NULL, "unable to fdopen %s", packfile); } else { hghnum = msgnum = mp->hghmsg; /* * Check if we have enough message space for all the new * messages. If not, then realloc the folder and add enough * space for all new messages plus 10 additional slots. */ if (mp->hghmsg + nmsgs >= mp->hghoff && !(mp = folder_realloc (mp, mp->lowoff, mp->hghmsg + nmsgs + 10))) adios (NULL, "unable to allocate folder storage"); } for (i = 1; i <= nmsgs; i++) { msgnum++; if (packfile) { fseek (pf, 0L, SEEK_CUR); pos = ftell (pf); size = 0; fwrite (mmdlm1, 1, strlen (mmdlm1), pf); start = ftell (pf); if (pop_retr (i, pop_pack) == NOTOK) adios (NULL, "%s", response); fseek (pf, 0L, SEEK_CUR); stop = ftell (pf); if (fflush (pf)) adios (packfile, "write error on"); fseek (pf, start, SEEK_SET); } else { cp = getcpy (m_name (msgnum)); if ((pf = fopen (cp, "w+")) == NULL) adios (cp, "unable to write"); chmod (cp, m_gmprot ()); start = stop = 0L; if (pop_retr (i, pop_action) == NOTOK) adios (NULL, "%s", response); if (fflush (pf)) adios (cp, "write error on"); fseek (pf, 0L, SEEK_SET); } switch (incerr = scan (pf, msgnum, 0, nfs, width, packfile ? 0 : msgnum == mp->hghmsg + 1 && chgflag, 1, NULL, stop - start, noisy)) { case SCNEOF: printf ("%*d empty\n", DMAXFOLDER, msgnum); break; case SCNFAT: trnflag = 0; noisy++; /* advise (cp, "unable to read"); already advised */ /* fall thru */ case SCNERR: case SCNNUM: break; case SCNMSG: case SCNENC: default: if (aud) fputs (scanl, aud); if (noisy) fflush (stdout); if (!packfile) { clear_msg_flags (mp, msgnum); set_exists (mp, msgnum); set_unseen (mp, msgnum); mp->msgflags |= SEQMOD; } break; } if (packfile) { fseek (pf, stop, SEEK_SET); fwrite (mmdlm2, 1, strlen (mmdlm2), pf); if (fflush (pf) || ferror (pf)) { int e = errno; pop_quit (); errno = e; adios (packfile, "write error on"); } map_write (packfile, pd, 0, 0L, start, stop, pos, size, noisy); } else { if (ferror(pf) || fclose (pf)) { int e = errno; unlink (cp); pop_quit (); errno = e; adios (cp, "write error on"); } free (cp); } if (trnflag && pop_dele (i) == NOTOK) adios (NULL, "%s", response); } if (pop_quit () == NOTOK) adios (NULL, "%s", response); if (packfile) { mbx_close (packfile, pd); pd = NOTOK; } } /* * Get the mail from file (usually mail spool) */ if (inc_type == INC_FILE && Maildir == NULL) { m_unknown (in); /* the MAGIC invocation... */ hghnum = msgnum = mp->hghmsg; for (;;) { /* * Check if we need to allocate more space for message status. * If so, then add space for an additional 100 messages. */ if (msgnum >= mp->hghoff && !(mp = folder_realloc (mp, mp->lowoff, mp->hghoff + 100))) { advise (NULL, "unable to allocate folder storage"); incerr = NOTOK; break; } #if 0 /* copy file from spool to tmp file */ tmpfilenam = m_scratch ("", invo_name); if ((fd = creat (tmpfilenam, m_gmprot ())) == NOTOK) adios (tmpfilenam, "unable to create"); chmod (tmpfilenam, m_gmprot ()); if (!(in2 = fdopen (fd, "r+"))) adios (tmpfilenam, "unable to access"); cpymsg (in, in2); /* link message into folder */ newmsg = folder_addmsg(mp, tmpfilenam); #endif /* create scanline for new message */ switch (incerr = scan (in, msgnum + 1, msgnum + 1, nfs, width, msgnum == hghnum && chgflag, 1, NULL, 0L, noisy)) { case SCNFAT: case SCNEOF: break; case SCNERR: if (aud) fputs ("inc aborted!\n", aud); advise (NULL, "aborted!"); /* doesn't clean up locks! */ break; case SCNNUM: advise (NULL, "BUG in %s, number out of range", invo_name); break; default: advise (NULL, "BUG in %s, scan() botch (%d)", invo_name, incerr); break; case SCNMSG: case SCNENC: /* * Run the external program hook on the message. */ (void)snprintf(b, sizeof (b), "%s/%d", maildir_copy, msgnum + 1); (void)ext_hook("add-hook", b, (char *)0); if (aud) fputs (scanl, aud); if (noisy) fflush (stdout); msgnum++; mp->hghmsg++; mp->nummsg++; if (mp->lowmsg == 0) mp->lowmsg = 1; clear_msg_flags (mp, msgnum); set_exists (mp, msgnum); set_unseen (mp, msgnum); mp->msgflags |= SEQMOD; continue; } /* If we get here there was some sort of error from scan(), * so stop processing anything more from the spool. */ break; } } else if (inc_type == INC_FILE) { /* Maildir inbox to process */ char *sp; FILE *sf; int i; hghnum = msgnum = mp->hghmsg; for (i = 0; i < num_maildir_entries; i++) { msgnum++; /* * Check if we need to allocate more space for message status. * If so, then add space for an additional 100 messages. */ if (msgnum >= mp->hghoff && !(mp = folder_realloc (mp, mp->lowoff, mp->hghoff + 100))) { advise (NULL, "unable to allocate folder storage"); incerr = NOTOK; break; } sp = Maildir[i].filename; cp = getcpy (m_name (msgnum)); pf = NULL; if (!trnflag || link(sp, cp) == -1) { static char buf[65536]; size_t nrd; if ((sf = fopen (sp, "r")) == NULL) adios (sp, "unable to read for copy"); if ((pf = fopen (cp, "w+")) == NULL) adios (cp, "unable to write for copy"); while ((nrd = fread(buf, 1, sizeof(buf), sf)) > 0) if (fwrite(buf, 1, nrd, pf) != nrd) break; if (ferror(sf) || fflush(pf) || ferror(pf)) { int e = errno; fclose(pf); fclose(sf); unlink(cp); errno = e; adios(cp, "copy error %s -> %s", sp, cp); } fclose (sf); sf = NULL; } if (pf == NULL && (pf = fopen (cp, "r")) == NULL) adios (cp, "not available"); chmod (cp, m_gmprot ()); fseek (pf, 0L, SEEK_SET); switch (incerr = scan (pf, msgnum, 0, nfs, width, msgnum == mp->hghmsg + 1 && chgflag, 1, NULL, stop - start, noisy)) { case SCNEOF: printf ("%*d empty\n", DMAXFOLDER, msgnum); break; case SCNFAT: trnflag = 0; noisy++; /* advise (cp, "unable to read"); already advised */ /* fall thru */ case SCNERR: case SCNNUM: break; case SCNMSG: case SCNENC: default: /* * Run the external program hook on the message. */ (void)snprintf(b, sizeof (b), "%s/%d", maildir_copy, msgnum + 1); (void)ext_hook("add-hook", b, (char *)0); if (aud) fputs (scanl, aud); if (noisy) fflush (stdout); if (!packfile) { clear_msg_flags (mp, msgnum); set_exists (mp, msgnum); set_unseen (mp, msgnum); mp->msgflags |= SEQMOD; } break; } if (ferror(pf) || fclose (pf)) { int e = errno; unlink (cp); errno = e; adios (cp, "write error on"); } pf = NULL; free (cp); if (trnflag && unlink (sp) == NOTOK) adios (sp, "couldn't unlink"); free (sp); /* Free Maildir[i]->filename */ } free (Maildir); /* From now on Maildir is just a flag - don't dref! */ } if (incerr < 0) { /* error */ if (locked) { GETGROUPPRIVS(); /* Be sure we can unlock mail file */ (void) lkfclose (in, newmail); in = NULL; DROPGROUPPRIVS(); /* And then return us to normal privileges */ } else { fclose (in); in = NULL; } adios (NULL, "failed"); } if (aud) fclose (aud); if (noisy) fflush (stdout); if ((inc_type == INC_POP) && packfile) done (0); /* * truncate file we are incorporating from */ if (inc_type == INC_FILE && Maildir == NULL) { if (trnflag) { if (stat (newmail, &st) != NOTOK && s1.st_mtime != st.st_mtime) advise (NULL, "new messages have arrived!\007"); else { int newfd; if ((newfd = creat (newmail, 0600)) != NOTOK) close (newfd); else admonish (newmail, "error zero'ing"); unlink(map_name(newmail)); } } else { if (noisy) printf ("%s not zero'd\n", newmail); } } if (msgnum == hghnum) { admonish (NULL, "no messages incorporated"); } else { context_replace (pfolder, folder); /* update current folder */ if (chgflag) mp->curmsg = hghnum + 1; mp->hghmsg = msgnum; if (mp->lowmsg == 0) mp->lowmsg = 1; if (chgflag) /* sigh... */ seq_setcur (mp, mp->curmsg); } /* * unlock the mail spool */ if (inc_type == INC_FILE && Maildir == NULL) { if (locked) { GETGROUPPRIVS(); /* Be sure we can unlock mail file */ (void) lkfclose (in, newmail); in = NULL; DROPGROUPPRIVS(); /* And then return us to normal privileges */ } else { fclose (in); in = NULL; } } seq_setunseen (mp, 0); /* set the Unseen-Sequence */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ done (0); return 1; } #if 0 /* * Copy message message from spool into * temporary file. Massage the "From " line * while copying. */ cpymsg (FILE *in, FILE *out) { int state; char *tmpbuf, name[NAMESZ]; for (;;) { state = m_getfld (state, name, tmpbuf, rlwidth, in); switch (state) { case FLD: case FLDPLUS: break; case BODY: break; case LENERR: case FMTERR: break; case FILEEOF: break; default: } } } #endif /* if 0 */ static void inc_done (int status) { if (packfile && pd != NOTOK) mbx_close (packfile, pd); if (locked) { GETGROUPPRIVS(); lkfclose(in, newmail); DROPGROUPPRIVS(); } exit (status); } static int pop_action (char *s) { fprintf (pf, "%s\n", s); stop += strlen (s) + 1; return 0; /* Is return value used? This was missing before 1999-07-15. */ } static int pop_pack (char *s) { int j; char buffer[BUFSIZ]; snprintf (buffer, sizeof(buffer), "%s\n", s); for (j = 0; (j = stringdex (mmdlm1, buffer)) >= 0; buffer[j]++) continue; for (j = 0; (j = stringdex (mmdlm2, buffer)) >= 0; buffer[j]++) continue; fputs (buffer, pf); size += strlen (buffer) + 1; return 0; /* Is return value used? This was missing before 1999-07-15. */ } static int map_count (void) { int md; char *cp; struct drop d; struct stat st; if (stat (packfile, &st) == NOTOK) return 0; if ((md = open (cp = map_name (packfile), O_RDONLY)) == NOTOK || map_chk (cp, md, &d, (long) st.st_size, 1)) { if (md != NOTOK) close (md); return 0; } close (md); return (d.d_id); } nmh-1.5/uip/install-mh.c000644 007761 000765 00000013161 11765267273 015125 0ustar00kenhkenh000000 000000 /* * install-mh.c -- initialize the nmh environment of a new user * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* mh internals */ #include #include /* structure for getpwuid() results */ static struct swit switches[] = { #define AUTOSW 0 { "auto", 0 }, #define VERSIONSW 1 { "version", 0 }, #define HELPSW 2 { "help", 0 }, #define CHECKSW 3 { "check", 1 }, { NULL, 0 } }; /* * static prototypes */ static char *geta(void); int main (int argc, char **argv) { int autof = 0; char *cp, *pathname, buf[BUFSIZ]; char *dp, **arguments, **argp; struct node *np; struct passwd *pw; struct stat st; FILE *in, *out; int check; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); arguments = getarguments (invo_name, argc, argv, 0); argp = arguments; check = 0; while ((dp = *argp++)) { if (*dp == '-') { switch (smatch (++dp, switches)) { case AMBIGSW: ambigsw (dp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown\n", dp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches]", invo_name); print_help (buf, switches, 0); done (1); case VERSIONSW: print_version(invo_name); done (1); case AUTOSW: autof++; continue; case CHECKSW: check = 1; continue; } } else { adios (NULL, "%s is invalid argument", dp); } } /* * Find user's home directory. Try the HOME environment variable first, * the home directory field in the password file if that's not found. */ if ((mypath = getenv("HOME")) == (char *)0) { if ((pw = getpwuid(getuid())) == (struct passwd *)0 || *pw->pw_dir == '\0') adios(NULL, "cannot determine your home directory"); else mypath = pw->pw_dir; } /* * Find the user's profile. Check for the existence of an MH environment * variable first with non-empty contents. Convert any relative path name * found there to an absolute one. Look for the profile in the user's home * directory if the MH environment variable isn't set. */ if ((cp = getenv("MH")) && *cp != '\0') defpath = path(cp, TFILE); else defpath = concat(mypath, "/", mh_profile, NULL); /* * Check for the existence of the profile file. It's an error if it exists and * this isn't an installation check. An installation check fails if it does not * exist, succeeds if it does. */ if (stat (defpath, &st) != NOTOK) { if (check) done(0); else if (autof) adios (NULL, "invocation error"); else adios (NULL, "You already have an nmh profile, use an editor to modify it"); } else if (check) { done(1); } if (!autof && gans ("Do you want help? ", anoyes)) { (void)printf( "\n" "Prior to using nmh, it is necessary to have a file in your login\n" "directory (%s) named %s which contains information\n" "to direct certain nmh operations. The only item which is required\n" "is the path to use for all nmh folder operations. The suggested nmh\n" "path for you is %s/Mail...\n" "\n", mypath, mh_profile, mypath); } cp = concat (mypath, "/", "Mail", NULL); if (stat (cp, &st) != NOTOK) { if (S_ISDIR(st.st_mode)) { cp = concat ("You already have the standard nmh directory \"", cp, "\".\nDo you want to use it for nmh? ", NULL); if (gans (cp, anoyes)) pathname = "Mail"; else goto query; } else { goto query; } } else { if (autof) printf ("I'm going to create the standard nmh path for you.\n"); else cp = concat ("Do you want the standard nmh path \"", mypath, "/", "Mail\"? ", NULL); if (autof || gans (cp, anoyes)) pathname = "Mail"; else { query: if (gans ("Do you want a path below your login directory? ", anoyes)) { printf ("What is the path? %s/", mypath); pathname = geta (); } else { printf ("What is the whole path? /"); pathname = concat ("/", geta (), NULL); } } } chdir (mypath); if (chdir (pathname) == NOTOK) { cp = concat ("\"", pathname, "\" doesn't exist; Create it? ", NULL); if (autof || gans (cp, anoyes)) if (makedir (pathname) == 0) adios (NULL, "unable to create %s", pathname); } else { printf ("[Using existing directory]\n"); } /* * Add some initial elements to the profile/context list */ m_defs = (struct node *) mh_xmalloc (sizeof *np); np = m_defs; np->n_name = getcpy ("Path"); np->n_field = getcpy (pathname); np->n_context = 0; np->n_next = NULL; /* * If there is a default profile file in the * nmh `etc' directory, then read it also. */ if ((in = fopen (mh_defaults, "r"))) { readconfig (&np->n_next, in, mh_defaults, 0); fclose (in); } ctxpath = getcpy (m_maildir (context = "context")); /* Initialize current folder to default */ context_replace (pfolder, defaultfolder); context_save (); /* * Now write out the initial .mh_profile */ if ((out = fopen (defpath, "w")) == NULL) adios (defpath, "unable to write"); for (np = m_defs; np; np = np->n_next) { if (!np->n_context) fprintf (out, "%s: %s\n", np->n_name, np->n_field); } fclose (out); done (0); return 1; } static char * geta (void) { char *cp; static char line[BUFSIZ]; fflush(stdout); if (fgets(line, sizeof(line), stdin) == NULL) done (1); if ((cp = strchr(line, '\n'))) *cp = 0; return line; } nmh-1.5/uip/mark.c000644 007761 000765 00000015014 11765267273 014006 0ustar00kenhkenh000000 000000 /* * mark.c -- add message(s) to sequences in given folder * -- delete messages (s) from sequences in given folder * -- list sequences in given folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include static struct swit switches[] = { #define ADDSW 0 { "add", 0 }, #define DELSW 1 { "delete", 0 }, #define LSTSW 2 { "list", 0 }, #define SEQSW 3 { "sequence name", 0 }, #define PUBLSW 4 { "public", 0 }, #define NPUBLSW 5 { "nopublic", 0 }, #define ZEROSW 6 { "zero", 0 }, #define NZEROSW 7 { "nozero", 0 }, #define VERSIONSW 8 { "version", 0 }, #define HELPSW 9 { "help", 0 }, #define DEBUGSW 10 { "debug", -5 }, { NULL, 0 } }; /* * static prototypes */ static void print_debug (struct msgs *); static void seq_printdebug (struct msgs *); int main (int argc, char **argv) { int addsw = 0, deletesw = 0, debugsw = 0; int listsw = 0, publicsw = -1, zerosw = 0, msgnum; unsigned int seqp = 0; char *cp, *maildir, *folder = NULL, buf[BUFSIZ]; char **argp, **arguments; char *seqs[NUMATTRS + 1]; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case ADDSW: addsw++; deletesw = listsw = 0; continue; case DELSW: deletesw++; addsw = listsw = 0; continue; case LSTSW: listsw++; addsw = deletesw = 0; continue; case SEQSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); /* check if too many sequences specified */ if (seqp >= NUMATTRS) adios (NULL, "too many sequences (more than %d) specified", NUMATTRS); seqs[seqp++] = cp; continue; case PUBLSW: publicsw = 1; continue; case NPUBLSW: publicsw = 0; continue; case DEBUGSW: debugsw++; continue; case ZEROSW: zerosw++; continue; case NZEROSW: zerosw = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } /* * If we haven't specified -add, -delete, or -list, * then use -add if a sequence was specified, else * use -list. */ if (!addsw && !deletesw && !listsw) { if (seqp) addsw++; else listsw++; } if (!context_find ("path")) free (path ("./", TFOLDER)); if (!msgs.size) app_msgarg(&msgs, listsw ? "all" :"cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* print some general debugging info */ if (debugsw) print_debug(mp); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); if (publicsw == 1 && is_readonly(mp)) adios (NULL, "folder %s is read-only, so -public not allowed", folder); /* * Make sure at least one sequence has been * specified if we are adding or deleting. */ if (seqp == 0 && (addsw || deletesw)) adios (NULL, "-%s requires at least one -sequence argument", addsw ? "add" : "delete"); seqs[seqp] = NULL; /* Adding messages to sequences */ if (addsw) { for (seqp = 0; seqs[seqp]; seqp++) if (!seq_addsel (mp, seqs[seqp], publicsw, zerosw)) done (1); } /* Deleting messages from sequences */ if (deletesw) { for (seqp = 0; seqs[seqp]; seqp++) if (!seq_delsel (mp, seqs[seqp], publicsw, zerosw)) done (1); } /* Listing messages in sequences */ if (listsw) { if (seqp) { /* print the sequences given */ for (seqp = 0; seqs[seqp]; seqp++) seq_print (mp, seqs[seqp]); } else { /* else print them all */ seq_printall (mp); } /* print debugging info about SELECTED messages */ if (debugsw) seq_printdebug (mp); } seq_save (mp); /* synchronize message sequences */ context_replace (pfolder, folder); /* update current folder */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ done (0); return 1; } /* * Print general debugging info */ static void print_debug (struct msgs *mp) { char buf[100]; printf ("invo_name = %s\n", invo_name); printf ("mypath = %s\n", mypath); printf ("defpath = %s\n", defpath); printf ("ctxpath = %s\n", ctxpath); printf ("context flags = %s\n", snprintb (buf, sizeof(buf), (unsigned) ctxflags, DBITS)); printf ("foldpath = %s\n", mp->foldpath); printf ("folder flags = %s\n\n", snprintb(buf, sizeof(buf), (unsigned) mp->msgflags, FBITS)); printf ("lowmsg=%d hghmsg=%d nummsg=%d curmsg=%d\n", mp->lowmsg, mp->hghmsg, mp->nummsg, mp->curmsg); printf ("lowsel=%d hghsel=%d numsel=%d\n", mp->lowsel, mp->hghsel, mp->numsel); printf ("lowoff=%d hghoff=%d\n\n", mp->lowoff, mp->hghoff); } /* * Print debugging info about all the SELECTED * messages and the sequences they are in. */ static void seq_printdebug (struct msgs *mp) { int msgnum; char buf[100]; printf ("\n"); for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) printf ("%*d: %s\n", DMAXFOLDER, msgnum, snprintb (buf, sizeof(buf), (unsigned) mp->msgstats[msgnum - mp->lowoff], seq_bits (mp))); } } nmh-1.5/uip/md5.c000644 007761 000765 00000023306 11713401274 013524 0ustar00kenhkenh000000 000000 /* * md5.c -- md5 message digest algorithm * taken from RFC-1321/Appendix A.3 */ /* * MD5C.C -- RSA Data Security, Inc., MD5 message-digest algorithm */ /* * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All * rights reserved. * * License to copy and use this software is granted provided that it * is identified as the "RSA Data Security, Inc. MD5 Message-Digest * Algorithm" in all material mentioning or referencing this software * or this function. * * License is also granted to make and use derivative works provided * that such works are identified as "derived from the RSA Data * Security, Inc. MD5 Message-Digest Algorithm" in all material * mentioning or referencing the derived work. * * RSA Data Security, Inc. makes no representations concerning either * the merchantability of this software or the suitability of this * software for any particular purpose. It is provided "as is" * without express or implied warranty of any kind. * * These notices must be retained in any copies of any part of this * documentation and/or software. */ #include /* * Constants for MD5Transform routine. */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); static void Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); static void Decode PROTO_LIST ((UINT4 *, unsigned char *, unsigned int)); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } /* MD5 initialization. Begins an MD5 operation, writing a new context. */ void MD5Init (context) MD5_CTX *context; /* context */ { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; } /* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. */ void MD5Update (context, input, inputLen) MD5_CTX *context; /* context */ unsigned char *input; /* input block */ unsigned int inputLen; /* length of input block */ { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) context->count[1]++; context->count[1] += ((UINT4)inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen); MD5Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform (context->state, &input[i]); index = 0; } else i = 0; /* Buffer remaining input */ memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i); } /* * MD5 finalization. Ends an MD5 message-digest operation, writing the * the message digest and zeroizing the context. */ void MD5Final (digest, context) unsigned char digest[16]; /* message digest */ MD5_CTX *context; /* context */ { unsigned char bits[8]; unsigned int index, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); MD5Update (context, PADDING, padLen); /* Append length (before padding) */ MD5Update (context, bits, 8); /* Store state in digest */ Encode (digest, context->state, 16); /* Zeroize sensitive information. */ memset ((POINTER)context, 0, sizeof(*context)); } /* MD5 basic transformation. Transforms state based on block. */ static void MD5Transform (state, block) UINT4 state[4]; unsigned char block[64]; { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode (x, block, 64); /* Round 1 */ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ /* Round 4 */ II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ memset ((POINTER)x, 0, sizeof(x)); } /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ static void Encode (output, input, len) unsigned char *output; UINT4 *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char)(input[i] & 0xff); output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ static void Decode (output, input, len) UINT4 *output; unsigned char *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } nmh-1.5/uip/mhbuild.c000644 007761 000765 00000020737 11765267273 014510 0ustar00kenhkenh000000 000000 /* * mhbuild.c -- expand/translate MIME composition files * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include static struct swit switches[] = { #define CHECKSW 0 { "check", 0 }, #define NCHECKSW 1 { "nocheck", 0 }, #define EBCDICSW 2 { "ebcdicsafe", 0 }, #define NEBCDICSW 3 { "noebcdicsafe", 0 }, #define HEADSW 4 { "headers", 0 }, #define NHEADSW 5 { "noheaders", 0 }, #define LISTSW 6 { "list", 0 }, #define NLISTSW 7 { "nolist", 0 }, #define SIZESW 8 { "realsize", 0 }, #define NSIZESW 9 { "norealsize", 0 }, #define RFC934SW 10 { "rfc934mode", 0 }, #define NRFC934SW 11 { "norfc934mode", 0 }, #define VERBSW 12 { "verbose", 0 }, #define NVERBSW 13 { "noverbose", 0 }, #define RCACHESW 14 { "rcache policy", 0 }, #define WCACHESW 15 { "wcache policy", 0 }, #define CONTENTIDSW 16 { "contentid", 0 }, #define NCONTENTIDSW 17 { "nocontentid", 0 }, #define VERSIONSW 18 { "version", 0 }, #define HELPSW 19 { "help", 0 }, #define DEBUGSW 20 { "debug", -5 }, { NULL, 0 } }; /* mhbuildsbr.c */ extern char *tmp; /* directory to place temp files */ /* mhcachesbr.c */ extern int rcachesw; extern int wcachesw; extern char *cache_public; extern char *cache_private; int debugsw = 0; int verbosw = 0; int ebcdicsw = 0; int listsw = 0; int rfc934sw = 0; int contentidsw = 1; /* * Temporary files */ static char infile[BUFSIZ]; static int unlink_infile = 0; static char outfile[BUFSIZ]; static int unlink_outfile = 0; static void unlink_done (int) NORETURN; /* mhbuildsbr.c */ CT build_mime (char *); int output_message (CT, char *); int output_message_fp (CT, FILE *, char*); /* mhlistsbr.c */ int list_all_messages (CT *, int, int, int, int); /* mhfree.c */ void free_content (CT); int main (int argc, char **argv) { int sizesw = 1, headsw = 1; int *icachesw; char *cp, buf[BUFSIZ]; char buffer[BUFSIZ], *compfile = NULL; char **argp, **arguments; CT ct, cts[2]; FILE *fp = NULL; FILE *fp_out = NULL; done=unlink_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (cp[0] == '-' && cp[1] == '\0') { if (compfile) adios (NULL, "cannot specify both standard input and a file"); else compfile = cp; listsw = 0; /* turn off -list if using standard in/out */ verbosw = 0; /* turn off -verbose listings */ break; } if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case RCACHESW: icachesw = &rcachesw; goto do_cache; case WCACHESW: icachesw = &wcachesw; do_cache: ; if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, caches)) { case AMBIGSW: ambigsw (cp, caches); done (1); case UNKWNSW: adios (NULL, "%s unknown", cp); default: break; } continue; case CHECKSW: checksw++; continue; case NCHECKSW: checksw = 0; continue; case EBCDICSW: ebcdicsw++; continue; case NEBCDICSW: ebcdicsw = 0; continue; case HEADSW: headsw++; continue; case NHEADSW: headsw = 0; continue; case LISTSW: listsw++; continue; case NLISTSW: listsw = 0; continue; case RFC934SW: rfc934sw++; continue; case NRFC934SW: rfc934sw = 0; continue; case SIZESW: sizesw++; continue; case NSIZESW: sizesw = 0; continue; case CONTENTIDSW: contentidsw = 1; continue; case NCONTENTIDSW: contentidsw = 0; continue; case VERBSW: verbosw++; continue; case NVERBSW: verbosw = 0; continue; case DEBUGSW: debugsw = 1; continue; } } if (compfile) adios (NULL, "only one composition file allowed"); else compfile = cp; } set_endian (); if ((cp = getenv ("MM_NOASK")) && !strcmp (cp, "1")) listsw = 0; /* * Check if we've specified an additional profile */ if ((cp = getenv ("MHBUILD"))) { if ((fp = fopen (cp, "r"))) { readconfig ((struct node **) 0, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHBUILD profile (%s)", cp); } } /* * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { readconfig ((struct node **) 0, fp, cp, 0); fclose (fp); } /* Check for public cache location */ if ((cache_public = context_find (nmhcache)) && *cache_public != '/') cache_public = NULL; /* Check for private cache location */ if (!(cache_private = context_find (nmhprivcache))) cache_private = ".cache"; cache_private = getcpy (m_maildir (cache_private)); /* * Check for storage directory. If defined, we * will store temporary files there. Else we * store them in standard nmh directory. */ if ((cp = context_find (nmhstorage)) && *cp) tmp = concat (cp, "/", invo_name, NULL); else tmp = add (m_maildir (invo_name), NULL); if (!context_find ("path")) free (path ("./", TFOLDER)); /* Check if we have a file to process */ if (!compfile) adios (NULL, "need to specify a %s composition file", invo_name); /* * Process the composition file from standard input. */ if (compfile[0] == '-' && compfile[1] == '\0') { /* copy standard input to temporary file */ strncpy (infile, m_mktemp(invo_name, NULL, &fp), sizeof(infile)); while (fgets (buffer, BUFSIZ, stdin)) fputs (buffer, fp); fclose (fp); unlink_infile = 1; /* build the content structures for MIME message */ ct = build_mime (infile); cts[0] = ct; cts[1] = NULL; /* output MIME message to this temporary file */ strncpy (outfile, m_mktemp(invo_name, NULL, &fp_out), sizeof(outfile)); unlink_outfile = 1; /* output the message */ output_message_fp (ct, fp_out, outfile); fclose(fp_out); /* output the temp file to standard output */ if ((fp = fopen (outfile, "r")) == NULL) adios (outfile, "unable to open"); while (fgets (buffer, BUFSIZ, fp)) fputs (buffer, stdout); fclose (fp); unlink (infile); unlink_infile = 0; unlink (outfile); unlink_outfile = 0; free_content (ct); done (0); } /* * Process the composition file from a file. */ /* build the content structures for MIME message */ ct = build_mime (compfile); cts[0] = ct; cts[1] = NULL; /* output MIME message to this temporary file */ strncpy(outfile, m_mktemp2(compfile, invo_name, NULL, &fp_out), sizeof(outfile)); unlink_outfile = 1; /* output the message */ output_message_fp (ct, fp_out, outfile); fclose(fp_out); /* * List the message info */ if (listsw) list_all_messages (cts, headsw, sizesw, verbosw, debugsw); /* Rename composition draft */ snprintf (buffer, sizeof(buffer), "%s.orig", m_backup (compfile)); if (rename (compfile, buffer) == NOTOK) { adios (compfile, "unable to rename comp draft %s to", buffer); } /* Rename output file to take its place */ if (rename (outfile, compfile) == NOTOK) { advise (outfile, "unable to rename output %s to", compfile); rename (buffer, compfile); done (1); } unlink_outfile = 0; free_content (ct); done (0); return 1; } static void unlink_done (int status) { /* * Check if we need to remove stray * temporary files. */ if (unlink_infile) unlink (infile); if (unlink_outfile) unlink (outfile); exit (status); } nmh-1.5/uip/mhbuildsbr.c000644 007761 000765 00000117672 11765267273 015224 0ustar00kenhkenh000000 000000 /* * mhbuildsbr.c -- routines to expand/translate MIME composition files * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ /* * This code was originally part of mhn.c. I split it into * a separate program (mhbuild.c) and then later split it * again (mhbuildsbr.c). But the code still has some of * the mhn.c code in it. This program needs additional * streamlining and removal of unneeded code. */ #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_TIME_H # include #endif #include extern int debugsw; extern int verbosw; extern int ebcdicsw; extern int listsw; extern int rfc934sw; extern int contentidsw; extern int endian; /* mhmisc.c */ /* cache policies */ extern int rcachesw; /* mhcachesbr.c */ extern int wcachesw; /* mhcachesbr.c */ /* * Directory to place tmp files. This must * be set before these routines are called. */ char *tmp; pid_t xpid = 0; static char prefix[] = "----- =_aaaaaaaaaa"; /* mhmisc.c */ void content_error (char *, CT, char *, ...); /* mhcachesbr.c */ int find_cache (CT, int, int *, char *, char *, int); /* mhfree.c */ void free_content (CT); void free_ctinfo (CT); void free_encoding (CT, int); /* * prototypes */ CT build_mime (char *); /* * static prototypes */ static int init_decoded_content (CT); static char *fgetstr (char *, int, FILE *); static int user_content (FILE *, char *, char *, CT *); static void set_id (CT, int); static int compose_content (CT); static int scan_content (CT); static int build_headers (CT); static char *calculate_digest (CT, int); /* * Main routine for translating composition file * into valid MIME message. It translates the draft * into a content structure (actually a tree of content * structures). This message then can be manipulated * in various ways, including being output via * output_message(). */ CT build_mime (char *infile) { int compnum, state; char buf[BUFSIZ], name[NAMESZ]; char *cp, *np, *vp; struct multipart *m; struct part **pp; CT ct; FILE *in; umask (~m_gmprot ()); /* open the composition draft */ if ((in = fopen (infile, "r")) == NULL) adios (infile, "unable to open for reading"); /* * Allocate space for primary (outside) content */ if ((ct = (CT) calloc (1, sizeof(*ct))) == NULL) adios (NULL, "out of memory"); /* * Allocate structure for handling decoded content * for this part. We don't really need this, but * allocate it to remain consistent. */ init_decoded_content (ct); /* * Parse some of the header fields in the composition * draft into the linked list of header fields for * the new MIME message. */ for (compnum = 1, state = FLD;;) { switch (state = m_getfld (state, name, buf, sizeof(buf), in)) { case FLD: case FLDPLUS: case FLDEOF: compnum++; /* abort if draft has Mime-Version header field */ if (!mh_strcasecmp (name, VRSN_FIELD)) adios (NULL, "draft shouldn't contain %s: field", VRSN_FIELD); /* abort if draft has Content-Transfer-Encoding header field */ if (!mh_strcasecmp (name, ENCODING_FIELD)) adios (NULL, "draft shouldn't contain %s: field", ENCODING_FIELD); /* ignore any Content-Type fields in the header */ if (!mh_strcasecmp (name, TYPE_FIELD)) { while (state == FLDPLUS) state = m_getfld (state, name, buf, sizeof(buf), in); goto finish_field; } /* get copies of the buffers */ np = add (name, NULL); vp = add (buf, NULL); /* if necessary, get rest of field */ while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), in); vp = add (buf, vp); /* add to previous value */ } /* Now add the header data to the list */ add_header (ct, np, vp); finish_field: /* if this wasn't the last header field, then continue */ if (state != FLDEOF) continue; /* else fall... */ case FILEEOF: adios (NULL, "draft has empty body -- no directives!"); /* NOTREACHED */ case BODY: case BODYEOF: fseek (in, (long) (-strlen (buf)), SEEK_CUR); break; case LENERR: case FMTERR: adios (NULL, "message format error in component #%d", compnum); default: adios (NULL, "getfld() returned %d", state); } break; } /* * Now add the MIME-Version header field * to the list of header fields. */ np = add (VRSN_FIELD, NULL); vp = concat (" ", VRSN_VALUE, "\n", NULL); add_header (ct, np, vp); /* * We initally assume we will find multiple contents in the * draft. So create a multipart/mixed content to hold everything. * We can remove this later, if it is not needed. */ if (get_ctinfo ("multipart/mixed", ct, 0) == NOTOK) done (1); ct->c_type = CT_MULTIPART; ct->c_subtype = MULTI_MIXED; ct->c_file = add (infile, NULL); if ((m = (struct multipart *) calloc (1, sizeof(*m))) == NULL) adios (NULL, "out of memory"); ct->c_ctparams = (void *) m; pp = &m->mp_parts; /* * read and parse the composition file * and the directives it contains. */ while (fgetstr (buf, sizeof(buf) - 1, in)) { struct part *part; CT p; if (user_content (in, infile, buf, &p) == DONE) { admonish (NULL, "ignoring spurious #end"); continue; } if (!p) continue; if ((part = (struct part *) calloc (1, sizeof(*part))) == NULL) adios (NULL, "out of memory"); *pp = part; pp = &part->mp_next; part->mp_part = p; } /* * close the composition draft since * it's not needed any longer. */ fclose (in); /* check if any contents were found */ if (!m->mp_parts) adios (NULL, "no content directives found"); /* * If only one content was found, then remove and * free the outer multipart content. */ if (!m->mp_parts->mp_next) { CT p; p = m->mp_parts->mp_part; m->mp_parts->mp_part = NULL; /* move header fields */ p->c_first_hf = ct->c_first_hf; p->c_last_hf = ct->c_last_hf; ct->c_first_hf = NULL; ct->c_last_hf = NULL; free_content (ct); ct = p; } else { set_id (ct, 1); } /* * Fill out, or expand directives. Parse and execute * commands specified by profile composition strings. */ compose_content (ct); if ((cp = strchr(prefix, 'a')) == NULL) adios (NULL, "internal error(4)"); /* * Scan the contents. Choose a transfer encoding, and * check if prefix for multipart boundary clashes with * any of the contents. */ while (scan_content (ct) == NOTOK) { if (*cp < 'z') { (*cp)++; } else { if (*++cp == 0) adios (NULL, "giving up trying to find a unique delimiter string"); else (*cp)++; } } /* Build the rest of the header field structures */ build_headers (ct); return ct; } /* * Set up structures for placing unencoded * content when building parts. */ static int init_decoded_content (CT ct) { CE ce; if ((ce = (CE) calloc (1, sizeof(*ce))) == NULL) adios (NULL, "out of memory"); ct->c_cefile = ce; ct->c_ceopenfnx = open7Bit; /* since unencoded */ ct->c_ceclosefnx = close_encoding; ct->c_cesizefnx = NULL; /* since unencoded */ return OK; } static char * fgetstr (char *s, int n, FILE *stream) { char *cp, *ep; for (ep = (cp = s) + n; cp < ep; ) { int i; if (!fgets (cp, n, stream)) return (cp != s ? s : NULL); if (cp == s && *cp != '#') return s; cp += (i = strlen (cp)) - 1; if (i <= 1 || *cp-- != '\n' || *cp != '\\') break; *cp = '\0'; n -= (i - 2); } return s; } /* * Parse the composition draft for text and directives. * Do initial setup of Content structure. */ static int user_content (FILE *in, char *file, char *buf, CT *ctp) { int extrnal, vrsn; unsigned char *cp; char **ap; char buffer[BUFSIZ]; struct multipart *m; struct part **pp; struct stat st; struct str2init *s2i; CI ci; CT ct; CE ce; if (buf[0] == '\n' || strcmp (buf, "#\n") == 0) { *ctp = NULL; return OK; } /* allocate basic Content structure */ if ((ct = (CT) calloc (1, sizeof(*ct))) == NULL) adios (NULL, "out of memory"); *ctp = ct; /* allocate basic structure for handling decoded content */ init_decoded_content (ct); ce = ct->c_cefile; ci = &ct->c_ctinfo; set_id (ct, 0); /* * Handle inline text. Check if line * is one of the following forms: * * 1) doesn't begin with '#' (implicit directive) * 2) begins with "##" (implicit directive) * 3) begins with "#<" */ if (buf[0] != '#' || buf[1] == '#' || buf[1] == '<') { int headers; int inlineD; long pos; char content[BUFSIZ]; FILE *out; char *cp; cp = m_mktemp2(NULL, invo_name, NULL, &out); if (cp == NULL) adios("mhbuildsbr", "unable to create temporary file"); /* use a temp file to collect the plain text lines */ ce->ce_file = add (cp, NULL); ce->ce_unlink = 1; if (buf[0] == '#' && buf[1] == '<') { strncpy (content, buf + 2, sizeof(content)); inlineD = 1; goto rock_and_roll; } else { inlineD = 0; } /* the directive is implicit */ strncpy (content, "text/plain", sizeof(content)); headers = 0; strncpy (buffer, buf[0] != '#' ? buf : buf + 1, sizeof(buffer)); for (;;) { int i; if (headers >= 0 && uprf (buffer, DESCR_FIELD) && buffer[i = strlen (DESCR_FIELD)] == ':') { headers = 1; again_descr: ct->c_descr = add (buffer + i + 1, ct->c_descr); if (!fgetstr (buffer, sizeof(buffer) - 1, in)) adios (NULL, "end-of-file after %s: field in plaintext", DESCR_FIELD); switch (buffer[0]) { case ' ': case '\t': i = -1; goto again_descr; case '#': adios (NULL, "#-directive after %s: field in plaintext", DESCR_FIELD); /* NOTREACHED */ default: break; } } if (headers >= 0 && uprf (buffer, DISPO_FIELD) && buffer[i = strlen (DISPO_FIELD)] == ':') { headers = 1; again_dispo: ct->c_dispo = add (buffer + i + 1, ct->c_dispo); if (!fgetstr (buffer, sizeof(buffer) - 1, in)) adios (NULL, "end-of-file after %s: field in plaintext", DISPO_FIELD); switch (buffer[0]) { case ' ': case '\t': i = -1; goto again_dispo; case '#': adios (NULL, "#-directive after %s: field in plaintext", DISPO_FIELD); /* NOTREACHED */ default: break; } } if (headers != 1 || buffer[0] != '\n') fputs (buffer, out); rock_and_roll: headers = -1; pos = ftell (in); if ((cp = fgetstr (buffer, sizeof(buffer) - 1, in)) == NULL) break; if (buffer[0] == '#') { char *bp; if (buffer[1] != '#') break; for (cp = (bp = buffer) + 1; *cp; cp++) *bp++ = *cp; *bp = '\0'; } } if (listsw) ct->c_end = ftell (out); fclose (out); /* parse content type */ if (get_ctinfo (content, ct, inlineD) == NOTOK) done (1); for (s2i = str2cts; s2i->si_key; s2i++) if (!mh_strcasecmp (ci->ci_type, s2i->si_key)) break; if (!s2i->si_key && !uprf (ci->ci_type, "X-")) s2i++; /* * check type specified (possibly implicitly) */ switch (ct->c_type = s2i->si_val) { case CT_MESSAGE: if (!mh_strcasecmp (ci->ci_subtype, "rfc822")) { ct->c_encoding = CE_7BIT; goto call_init; } /* else fall... */ case CT_MULTIPART: adios (NULL, "it doesn't make sense to define an in-line %s content", ct->c_type == CT_MESSAGE ? "message" : "multipart"); /* NOTREACHED */ default: call_init: if ((ct->c_ctinitfnx = s2i->si_init)) (*ct->c_ctinitfnx) (ct); break; } if (cp) fseek (in, pos, SEEK_SET); return OK; } /* * If we've reached this point, the next line * must be some type of explicit directive. */ /* check if directive is external-type */ extrnal = (buf[1] == '@'); /* parse directive */ if (get_ctinfo (buf + (extrnal ? 2 : 1), ct, 1) == NOTOK) done (1); /* check directive against the list of MIME types */ for (s2i = str2cts; s2i->si_key; s2i++) if (!mh_strcasecmp (ci->ci_type, s2i->si_key)) break; /* * Check if the directive specified a valid type. * This will happen if it was one of the following forms: * * #type/subtype (or) * #@type/subtype */ if (s2i->si_key) { if (!ci->ci_subtype) adios (NULL, "missing subtype in \"#%s\"", ci->ci_type); switch (ct->c_type = s2i->si_val) { case CT_MULTIPART: adios (NULL, "use \"#begin ... #end\" instead of \"#%s/%s\"", ci->ci_type, ci->ci_subtype); /* NOTREACHED */ case CT_MESSAGE: if (!mh_strcasecmp (ci->ci_subtype, "partial")) adios (NULL, "sorry, \"#%s/%s\" isn't supported", ci->ci_type, ci->ci_subtype); if (!mh_strcasecmp (ci->ci_subtype, "external-body")) adios (NULL, "use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"", ci->ci_type, ci->ci_subtype); use_forw: adios (NULL, "use \"#forw [+folder] [msgs]\" instead of \"#%s/%s\"", ci->ci_type, ci->ci_subtype); /* NOTREACHED */ default: if ((ct->c_ctinitfnx = s2i->si_init)) (*ct->c_ctinitfnx) (ct); break; } /* * #@type/subtype (external types directive) */ if (extrnal) { struct exbody *e; CT p; if (!ci->ci_magic) adios (NULL, "need external information for \"#@%s/%s\"", ci->ci_type, ci->ci_subtype); p = ct; snprintf (buffer, sizeof(buffer), "message/external-body; %s", ci->ci_magic); free (ci->ci_magic); ci->ci_magic = NULL; /* * Since we are using the current Content structure to * hold information about the type of the external * reference, we need to create another Content structure * for the message/external-body to wrap it in. */ if ((ct = (CT) calloc (1, sizeof(*ct))) == NULL) adios (NULL, "out of memory"); *ctp = ct; ci = &ct->c_ctinfo; if (get_ctinfo (buffer, ct, 0) == NOTOK) done (1); ct->c_type = CT_MESSAGE; ct->c_subtype = MESSAGE_EXTERNAL; if ((e = (struct exbody *) calloc (1, sizeof(*e))) == NULL) adios (NULL, "out of memory"); ct->c_ctparams = (void *) e; e->eb_parent = ct; e->eb_content = p; p->c_ctexbody = e; if (params_external (ct, 1) == NOTOK) done (1); return OK; } /* Handle [file] argument */ if (ci->ci_magic) { /* check if specifies command to execute */ if (*ci->ci_magic == '|' || *ci->ci_magic == '!') { for (cp = ci->ci_magic + 1; isspace (*cp); cp++) continue; if (!*cp) adios (NULL, "empty pipe command for #%s directive", ci->ci_type); cp = add (cp, NULL); free (ci->ci_magic); ci->ci_magic = cp; } else { /* record filename of decoded contents */ ce->ce_file = ci->ci_magic; if (access (ce->ce_file, R_OK) == NOTOK) adios ("reading", "unable to access %s for", ce->ce_file); if (listsw && stat (ce->ce_file, &st) != NOTOK) ct->c_end = (long) st.st_size; ci->ci_magic = NULL; } return OK; } /* * No [file] argument, so check profile for * method to compose content. */ snprintf (buffer, sizeof(buffer), "%s-compose-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); if ((cp = context_find (buffer)) == NULL || *cp == '\0') { snprintf (buffer, sizeof(buffer), "%s-compose-%s", invo_name, ci->ci_type); if ((cp = context_find (buffer)) == NULL || *cp == '\0') { content_error (NULL, ct, "don't know how to compose content"); done (1); } } ci->ci_magic = add (cp, NULL); return OK; } if (extrnal) adios (NULL, "external definition not allowed for \"#%s\"", ci->ci_type); /* * Message directive * #forw [+folder] [msgs] */ if (!mh_strcasecmp (ci->ci_type, "forw")) { int msgnum; char *folder, *arguments[MAXARGS]; struct msgs *mp; if (ci->ci_magic) { ap = brkstring (ci->ci_magic, " ", "\n"); copyip (ap, arguments, MAXARGS); } else { arguments[0] = "cur"; arguments[1] = NULL; } folder = NULL; /* search the arguments for a folder name */ for (ap = arguments; *ap; ap++) { cp = *ap; if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder per #forw directive"); else folder = pluspath (cp); } } /* else, use the current folder */ if (!folder) folder = add (getfolder (1), NULL); if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); for (ap = arguments; *ap; ap++) { cp = *ap; if (*cp != '+' && *cp != '@') if (!m_convert (mp, cp)) done (1); } free (folder); free_ctinfo (ct); /* * If there is more than one message to include, make this * a content of type "multipart/digest" and insert each message * as a subpart. If there is only one message, then make this * a content of type "message/rfc822". */ if (mp->numsel > 1) { /* we are forwarding multiple messages */ if (get_ctinfo ("multipart/digest", ct, 0) == NOTOK) done (1); ct->c_type = CT_MULTIPART; ct->c_subtype = MULTI_DIGEST; if ((m = (struct multipart *) calloc (1, sizeof(*m))) == NULL) adios (NULL, "out of memory"); ct->c_ctparams = (void *) m; pp = &m->mp_parts; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { struct part *part; CT p; CE pe; if ((p = (CT) calloc (1, sizeof(*p))) == NULL) adios (NULL, "out of memory"); init_decoded_content (p); pe = p->c_cefile; if (get_ctinfo ("message/rfc822", p, 0) == NOTOK) done (1); p->c_type = CT_MESSAGE; p->c_subtype = MESSAGE_RFC822; snprintf (buffer, sizeof(buffer), "%s/%d", mp->foldpath, msgnum); pe->ce_file = add (buffer, NULL); if (listsw && stat (pe->ce_file, &st) != NOTOK) p->c_end = (long) st.st_size; if ((part = (struct part *) calloc (1, sizeof(*part))) == NULL) adios (NULL, "out of memory"); *pp = part; pp = &part->mp_next; part->mp_part = p; } } } else { /* we are forwarding one message */ if (get_ctinfo ("message/rfc822", ct, 0) == NOTOK) done (1); ct->c_type = CT_MESSAGE; ct->c_subtype = MESSAGE_RFC822; msgnum = mp->lowsel; snprintf (buffer, sizeof(buffer), "%s/%d", mp->foldpath, msgnum); ce->ce_file = add (buffer, NULL); if (listsw && stat (ce->ce_file, &st) != NOTOK) ct->c_end = (long) st.st_size; } folder_free (mp); /* free folder/message structure */ return OK; } /* * #end */ if (!mh_strcasecmp (ci->ci_type, "end")) { free_content (ct); *ctp = NULL; return DONE; } /* * #begin [ alternative | parallel ] */ if (!mh_strcasecmp (ci->ci_type, "begin")) { if (!ci->ci_magic) { vrsn = MULTI_MIXED; cp = SubMultiPart[vrsn - 1].kv_key; } else if (!mh_strcasecmp (ci->ci_magic, "alternative")) { vrsn = MULTI_ALTERNATE; cp = SubMultiPart[vrsn - 1].kv_key; } else if (!mh_strcasecmp (ci->ci_magic, "parallel")) { vrsn = MULTI_PARALLEL; cp = SubMultiPart[vrsn - 1].kv_key; } else if (uprf (ci->ci_magic, "digest")) { goto use_forw; } else { vrsn = MULTI_UNKNOWN; cp = ci->ci_magic; } free_ctinfo (ct); snprintf (buffer, sizeof(buffer), "multipart/%s", cp); if (get_ctinfo (buffer, ct, 0) == NOTOK) done (1); ct->c_type = CT_MULTIPART; ct->c_subtype = vrsn; if ((m = (struct multipart *) calloc (1, sizeof(*m))) == NULL) adios (NULL, "out of memory"); ct->c_ctparams = (void *) m; pp = &m->mp_parts; while (fgetstr (buffer, sizeof(buffer) - 1, in)) { struct part *part; CT p; if (user_content (in, file, buffer, &p) == DONE) { if (!m->mp_parts) adios (NULL, "empty \"#begin ... #end\" sequence"); return OK; } if (!p) continue; if ((part = (struct part *) calloc (1, sizeof(*part))) == NULL) adios (NULL, "out of memory"); *pp = part; pp = &part->mp_next; part->mp_part = p; } admonish (NULL, "premature end-of-file, missing #end"); return OK; } /* * Unknown directive */ adios (NULL, "unknown directive \"#%s\"", ci->ci_type); return NOTOK; /* NOT REACHED */ } static void set_id (CT ct, int top) { char msgid[BUFSIZ]; static int partno; static time_t clock = 0; static char *msgfmt; if (clock == 0) { time (&clock); snprintf (msgid, sizeof(msgid), "<%d.%ld.%%d@%s>\n", (int) getpid(), (long) clock, LocalName(1)); partno = 0; msgfmt = getcpy(msgid); } snprintf (msgid, sizeof(msgid), msgfmt, top ? 0 : ++partno); ct->c_id = getcpy (msgid); } static char ebcdicsafe[0x100] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* * Fill out, or expand the various contents in the composition * draft. Read-in any necessary files. Parse and execute any * commands specified by profile composition strings. */ static int compose_content (CT ct) { CE ce = ct->c_cefile; switch (ct->c_type) { case CT_MULTIPART: { int partnum; char *pp; char partnam[BUFSIZ]; struct multipart *m = (struct multipart *) ct->c_ctparams; struct part *part; if (ct->c_partno) { snprintf (partnam, sizeof(partnam), "%s.", ct->c_partno); pp = partnam + strlen (partnam); } else { pp = partnam; } /* first, we call compose_content on all the subparts */ for (part = m->mp_parts, partnum = 1; part; part = part->mp_next, partnum++) { CT p = part->mp_part; sprintf (pp, "%d", partnum); p->c_partno = add (partnam, NULL); if (compose_content (p) == NOTOK) return NOTOK; } /* * If the -rfc934mode switch is given, then check all * the subparts of a multipart/digest. If they are all * message/rfc822, then mark this content and all * subparts with the rfc934 compatibility mode flag. */ if (rfc934sw && ct->c_subtype == MULTI_DIGEST) { int is934 = 1; for (part = m->mp_parts; part; part = part->mp_next) { CT p = part->mp_part; if (p->c_subtype != MESSAGE_RFC822) { is934 = 0; break; } } ct->c_rfc934 = is934; for (part = m->mp_parts; part; part = part->mp_next) { CT p = part->mp_part; if ((p->c_rfc934 = is934)) p->c_end++; } } if (listsw) { ct->c_end = (partnum = strlen (prefix) + 2) + 2; if (ct->c_rfc934) ct->c_end += 1; for (part = m->mp_parts; part; part = part->mp_next) ct->c_end += part->mp_part->c_end + partnum; } } break; case CT_MESSAGE: /* Nothing to do for type message */ break; /* * Discrete types (text/application/audio/image/video) */ default: if (!ce->ce_file) { pid_t child_id; int i, xstdout, len, buflen; char *bp, **ap, *cp; char *vec[4], buffer[BUFSIZ]; FILE *out; CI ci = &ct->c_ctinfo; char *tfile = NULL; if (!(cp = ci->ci_magic)) adios (NULL, "internal error(5)"); tfile = m_mktemp2(NULL, invo_name, NULL, NULL); if (tfile == NULL) { adios("mhbuildsbr", "unable to create temporary file"); } ce->ce_file = add (tfile, NULL); ce->ce_unlink = 1; xstdout = 0; /* Get buffer ready to go */ bp = buffer; bp[0] = '\0'; buflen = sizeof(buffer); /* * Parse composition string into buffer */ for ( ; *cp; cp++) { if (*cp == '%') { switch (*++cp) { case 'a': { /* insert parameters from directive */ char **ep; char *s = ""; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { snprintf (bp, buflen, "%s%s=\"%s\"", s, *ap, *ep); len = strlen (bp); bp += len; buflen -= len; s = " "; } } break; case 'F': /* %f, and stdout is not-redirected */ xstdout = 1; /* and fall... */ case 'f': /* * insert temporary filename where * content should be written */ snprintf (bp, buflen, "%s", ce->ce_file); break; case 's': /* insert content subtype */ strncpy (bp, ci->ci_subtype, buflen); break; case '%': /* insert character % */ goto raw; default: *bp++ = *--cp; *bp = '\0'; buflen--; continue; } len = strlen (bp); bp += len; buflen -= len; } else { raw: *bp++ = *cp; *bp = '\0'; buflen--; } } if (verbosw) printf ("composing content %s/%s from command\n\t%s\n", ci->ci_type, ci->ci_subtype, buffer); fflush (stdout); /* not sure if need for -noverbose */ vec[0] = "/bin/sh"; vec[1] = "-c"; vec[2] = buffer; vec[3] = NULL; if ((out = fopen (ce->ce_file, "w")) == NULL) adios (ce->ce_file, "unable to open for writing"); for (i = 0; (child_id = vfork()) == NOTOK && i > 5; i++) sleep (5); switch (child_id) { case NOTOK: adios ("fork", "unable to fork"); /* NOTREACHED */ case OK: if (!xstdout) dup2 (fileno (out), 1); close (fileno (out)); execvp ("/bin/sh", vec); fprintf (stderr, "unable to exec "); perror ("/bin/sh"); _exit (-1); /* NOTREACHED */ default: fclose (out); if (pidXwait(child_id, NULL)) done (1); break; } } /* Check size of file */ if (listsw && ct->c_end == 0L) { struct stat st; if (stat (ce->ce_file, &st) != NOTOK) ct->c_end = (long) st.st_size; } break; } return OK; } /* * Scan the content. * * 1) choose a transfer encoding. * 2) check for clashes with multipart boundary string. * 3) for text content, figure out which character set is being used. * * If there is a clash with one of the contents and the multipart boundary, * this function will exit with NOTOK. This will cause the scanning process * to be repeated with a different multipart boundary. It is possible * (although highly unlikely) that this scan will be repeated multiple times. */ static int scan_content (CT ct) { int len; int check8bit = 0, contains8bit = 0; /* check if contains 8bit data */ int checklinelen = 0, linelen = 0; /* check for long lines */ int checkboundary = 0, boundaryclash = 0; /* check if clashes with multipart boundary */ int checklinespace = 0, linespace = 0; /* check if any line ends with space */ int checkebcdic = 0, ebcdicunsafe = 0; /* check if contains ebcdic unsafe characters */ unsigned char *cp = NULL, buffer[BUFSIZ]; struct text *t = NULL; FILE *in = NULL; CE ce = ct->c_cefile; /* * handle multipart by scanning all subparts * and then checking their encoding. */ if (ct->c_type == CT_MULTIPART) { struct multipart *m = (struct multipart *) ct->c_ctparams; struct part *part; /* initially mark the domain of enclosing multipart as 7bit */ ct->c_encoding = CE_7BIT; for (part = m->mp_parts; part; part = part->mp_next) { CT p = part->mp_part; if (scan_content (p) == NOTOK) /* choose encoding for subpart */ return NOTOK; /* if necessary, enlarge encoding for enclosing multipart */ if (p->c_encoding == CE_BINARY) ct->c_encoding = CE_BINARY; if (p->c_encoding == CE_8BIT && ct->c_encoding != CE_BINARY) ct->c_encoding = CE_8BIT; } return OK; } /* * Decide what to check while scanning this content. */ switch (ct->c_type) { case CT_TEXT: check8bit = 1; checkboundary = 1; if (ct->c_subtype == TEXT_PLAIN) { checkebcdic = 0; checklinelen = 0; checklinespace = 0; } else { checkebcdic = ebcdicsw; checklinelen = 1; checklinespace = 1; } break; case CT_APPLICATION: check8bit = 1; checkebcdic = ebcdicsw; checklinelen = 1; checklinespace = 1; checkboundary = 1; break; case CT_MESSAGE: check8bit = 0; checkebcdic = 0; checklinelen = 0; checklinespace = 0; /* don't check anything for message/external */ if (ct->c_subtype == MESSAGE_EXTERNAL) checkboundary = 0; else checkboundary = 1; break; case CT_AUDIO: case CT_IMAGE: case CT_VIDEO: /* * Don't check anything for these types, * since we are forcing use of base64. */ check8bit = 0; checkebcdic = 0; checklinelen = 0; checklinespace = 0; checkboundary = 0; break; } /* * Scan the unencoded content */ if (check8bit || checklinelen || checklinespace || checkboundary) { if ((in = fopen (ce->ce_file, "r")) == NULL) adios (ce->ce_file, "unable to open for reading"); len = strlen (prefix); while (fgets (buffer, sizeof(buffer) - 1, in)) { /* * Check for 8bit data. */ if (check8bit) { for (cp = buffer; *cp; cp++) { if (!isascii (*cp)) { contains8bit = 1; check8bit = 0; /* no need to keep checking */ } /* * Check if character is ebcdic-safe. We only check * this if also checking for 8bit data. */ if (checkebcdic && !ebcdicsafe[*cp & 0xff]) { ebcdicunsafe = 1; checkebcdic = 0; /* no need to keep checking */ } } } /* * Check line length. */ if (checklinelen && (strlen (buffer) > CPERLIN + 1)) { linelen = 1; checklinelen = 0; /* no need to keep checking */ } /* * Check if line ends with a space. */ if (checklinespace && (cp = buffer + strlen (buffer) - 2) > buffer && isspace (*cp)) { linespace = 1; checklinespace = 0; /* no need to keep checking */ } /* * Check if content contains a line that clashes * with our standard boundary for multipart messages. */ if (checkboundary && buffer[0] == '-' && buffer[1] == '-') { for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--) if (!isspace (*cp)) break; *++cp = '\0'; if (!strncmp(buffer + 2, prefix, len) && isdigit(buffer[2 + len])) { boundaryclash = 1; checkboundary = 0; /* no need to keep checking */ } } } fclose (in); } /* * Decide which transfer encoding to use. */ switch (ct->c_type) { case CT_TEXT: /* * If the text content didn't specify a character * set, we need to figure out which one was used. */ t = (struct text *) ct->c_ctparams; if (t->tx_charset == CHARSET_UNSPECIFIED) { CI ci = &ct->c_ctinfo; char **ap, **ep; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) continue; if (contains8bit) { t->tx_charset = CHARSET_UNKNOWN; *ap = concat ("charset=", write_charset_8bit(), NULL); } else { t->tx_charset = CHARSET_USASCII; *ap = add ("charset=us-ascii", NULL); } cp = strchr(*ap++, '='); *ap = NULL; *cp++ = '\0'; *ep = cp; } if (contains8bit || ebcdicunsafe || linelen || linespace || checksw) ct->c_encoding = CE_QUOTED; else ct->c_encoding = CE_7BIT; break; case CT_APPLICATION: /* For application type, use base64, except when postscript */ if (contains8bit || ebcdicunsafe || linelen || linespace || checksw) ct->c_encoding = (ct->c_subtype == APPLICATION_POSTSCRIPT) ? CE_QUOTED : CE_BASE64; else ct->c_encoding = CE_7BIT; break; case CT_MESSAGE: ct->c_encoding = CE_7BIT; break; case CT_AUDIO: case CT_IMAGE: case CT_VIDEO: /* For audio, image, and video contents, just use base64 */ ct->c_encoding = CE_BASE64; break; } return (boundaryclash ? NOTOK : OK); } /* * Scan the content structures, and build header * fields that will need to be output into the * message. */ static int build_headers (CT ct) { int cc, mailbody, len; char **ap, **ep; char *np, *vp, buffer[BUFSIZ]; CI ci = &ct->c_ctinfo; /* * If message is type multipart, then add the multipart * boundary to the list of attribute/value pairs. */ if (ct->c_type == CT_MULTIPART) { char *cp; static int level = 0; /* store nesting level */ ap = ci->ci_attrs; ep = ci->ci_values; snprintf (buffer, sizeof(buffer), "boundary=%s%d", prefix, level++); cp = strchr(*ap++ = add (buffer, NULL), '='); *ap = NULL; *cp++ = '\0'; *ep = cp; } /* * Skip the output of Content-Type, parameters, content * description and disposition, and Content-ID if the * content is of type "message" and the rfc934 compatibility * flag is set (which means we are inside multipart/digest * and the switch -rfc934mode was given). */ if (ct->c_type == CT_MESSAGE && ct->c_rfc934) goto skip_headers; /* * output the content type and subtype */ np = add (TYPE_FIELD, NULL); vp = concat (" ", ci->ci_type, "/", ci->ci_subtype, NULL); /* keep track of length of line */ len = strlen (TYPE_FIELD) + strlen (ci->ci_type) + strlen (ci->ci_subtype) + 3; mailbody = ct->c_type == CT_MESSAGE && ct->c_subtype == MESSAGE_EXTERNAL && ((struct exbody *) ct->c_ctparams)->eb_body; /* * Append the attribute/value pairs to * the end of the Content-Type line. */ for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { if (mailbody && !mh_strcasecmp (*ap, "body")) continue; vp = add (";", vp); len++; snprintf (buffer, sizeof(buffer), "%s=\"%s\"", *ap, *ep); if (len + 1 + (cc = strlen (buffer)) >= CPERLIN) { vp = add ("\n\t", vp); len = 8; } else { vp = add (" ", vp); len++; } vp = add (buffer, vp); len += cc; } /* * Append any RFC-822 comment to the end of * the Content-Type line. */ if (ci->ci_comment) { snprintf (buffer, sizeof(buffer), "(%s)", ci->ci_comment); if (len + 1 + (cc = 2 + strlen (ci->ci_comment)) >= CPERLIN) { vp = add ("\n\t", vp); len = 8; } else { vp = add (" ", vp); len++; } vp = add (buffer, vp); len += cc; } vp = add ("\n", vp); add_header (ct, np, vp); /* * output the Content-ID, unless disabled by -nocontentid */ if (contentidsw && ct->c_id) { np = add (ID_FIELD, NULL); vp = concat (" ", ct->c_id, NULL); add_header (ct, np, vp); } /* * output the Content-Description */ if (ct->c_descr) { np = add (DESCR_FIELD, NULL); vp = concat (" ", ct->c_descr, NULL); add_header (ct, np, vp); } /* * output the Content-Disposition */ if (ct->c_dispo) { np = add (DISPO_FIELD, NULL); vp = concat (" ", ct->c_dispo, NULL); add_header (ct, np, vp); } skip_headers: /* * If this is the internal content structure for a * "message/external", then we are done with the * headers (since it has no body). */ if (ct->c_ctexbody) return OK; /* * output the Content-MD5 */ if (checksw) { np = add (MD5_FIELD, NULL); vp = calculate_digest (ct, (ct->c_encoding == CE_QUOTED) ? 1 : 0); add_header (ct, np, vp); } /* * output the Content-Transfer-Encoding */ switch (ct->c_encoding) { case CE_7BIT: /* Nothing to output */ #if 0 np = add (ENCODING_FIELD, NULL); vp = concat (" ", "7bit", "\n", NULL); add_header (ct, np, vp); #endif break; case CE_8BIT: if (ct->c_type == CT_MESSAGE) adios (NULL, "internal error, invalid encoding"); np = add (ENCODING_FIELD, NULL); vp = concat (" ", "8bit", "\n", NULL); add_header (ct, np, vp); break; case CE_QUOTED: if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART) adios (NULL, "internal error, invalid encoding"); np = add (ENCODING_FIELD, NULL); vp = concat (" ", "quoted-printable", "\n", NULL); add_header (ct, np, vp); break; case CE_BASE64: if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART) adios (NULL, "internal error, invalid encoding"); np = add (ENCODING_FIELD, NULL); vp = concat (" ", "base64", "\n", NULL); add_header (ct, np, vp); break; case CE_BINARY: if (ct->c_type == CT_MESSAGE) adios (NULL, "internal error, invalid encoding"); np = add (ENCODING_FIELD, NULL); vp = concat (" ", "binary", "\n", NULL); add_header (ct, np, vp); break; default: adios (NULL, "unknown transfer encoding in content"); break; } /* * Additional content specific header processing */ switch (ct->c_type) { case CT_MULTIPART: { struct multipart *m; struct part *part; m = (struct multipart *) ct->c_ctparams; for (part = m->mp_parts; part; part = part->mp_next) { CT p; p = part->mp_part; build_headers (p); } } break; case CT_MESSAGE: if (ct->c_subtype == MESSAGE_EXTERNAL) { struct exbody *e; e = (struct exbody *) ct->c_ctparams; build_headers (e->eb_content); } break; default: /* Nothing to do */ break; } return OK; } static char nib2b64[0x40+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static char * calculate_digest (CT ct, int asciiP) { int cc; char buffer[BUFSIZ], *vp, *op; unsigned char *dp; unsigned char digest[16]; unsigned char outbuf[25]; MD5_CTX mdContext; CE ce = ct->c_cefile; char *infilename = ce->ce_file ? ce->ce_file : ct->c_file; FILE *in; /* open content */ if ((in = fopen (infilename, "r")) == NULL) adios (infilename, "unable to open for reading"); /* Initialize md5 context */ MD5Init (&mdContext); /* calculate md5 message digest */ if (asciiP) { while (fgets (buffer, sizeof(buffer) - 1, in)) { char c, *cp; cp = buffer + strlen (buffer) - 1; if ((c = *cp) == '\n') *cp = '\0'; MD5Update (&mdContext, (unsigned char *) buffer, (unsigned int) strlen (buffer)); if (c == '\n') MD5Update (&mdContext, (unsigned char *) "\r\n", 2); } } else { while ((cc = fread (buffer, sizeof(*buffer), sizeof(buffer), in)) > 0) MD5Update (&mdContext, (unsigned char *) buffer, (unsigned int) cc); } /* md5 finalization. Write digest and zero md5 context */ MD5Final (digest, &mdContext); /* close content */ fclose (in); /* print debugging info */ if (debugsw) { unsigned char *ep; fprintf (stderr, "MD5 digest="); for (ep = (dp = digest) + sizeof(digest) / sizeof(digest[0]); dp < ep; dp++) fprintf (stderr, "%02x", *dp & 0xff); fprintf (stderr, "\n"); } /* encode the digest using base64 */ for (dp = digest, op = outbuf, cc = sizeof(digest) / sizeof(digest[0]); cc > 0; cc -= 3, op += 4) { unsigned long bits; char *bp; bits = (*dp++ & 0xff) << 16; if (cc > 1) { bits |= (*dp++ & 0xff) << 8; if (cc > 2) bits |= *dp++ & 0xff; } for (bp = op + 4; bp > op; bits >>= 6) *--bp = nib2b64[bits & 0x3f]; if (cc < 3) { *(op + 3) = '='; if (cc < 2) *(op + 2) = '='; } } /* null terminate string */ outbuf[24] = '\0'; /* now make copy and return string */ vp = concat (" ", outbuf, "\n", NULL); return vp; } nmh-1.5/uip/mhcachesbr.c000644 007761 000765 00000021156 11762736347 015157 0ustar00kenhkenh000000 000000 /* * mhcachesbr.c -- routines to manipulate the MIME content cache * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_TIME_H # include #endif #include extern int debugsw; extern pid_t xpid; /* mhshowsbr.c or mhbuildsbr.c */ /* cache policies */ int rcachesw = CACHE_ASK; int wcachesw = CACHE_ASK; /* * Location of public and private cache. These must * be set before these routines are called. */ char *cache_public; char *cache_private; /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void content_error (char *, CT, char *, ...); void flush_errors (void); /* * prototypes */ void cache_all_messages (CT *); int find_cache (CT, int, int *, char *, char *, int); /* * static prototypes */ static void cache_content (CT); static int find_cache_aux (int, char *, char *, char *, int); static int find_cache_aux2 (char *, char *, char *, int); /* * Top level entry point to cache content * from a group of messages */ void cache_all_messages (CT *cts) { CT ct, *ctp; for (ctp = cts; *ctp; ctp++) { ct = *ctp; if (type_ok (ct, 1)) { cache_content (ct); if (ct->c_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } if (ct->c_ceclosefnx) (*ct->c_ceclosefnx) (ct); } } flush_errors (); } /* * Entry point to cache content from external sources. */ static void cache_content (CT ct) { int cachetype; char *file, cachefile[BUFSIZ]; CE ce = ct->c_cefile; if (!ct->c_id) { advise (NULL, "no %s: field in %s", ID_FIELD, ct->c_file); return; } if (!ce) { advise (NULL, "unable to decode %s", ct->c_file); return; } /* THIS NEEDS TO BE FIXED */ #if 0 if (ct->c_ceopenfnx == openMail) { advise (NULL, "a radish may no know Greek, but I do..."); return; } #endif if (find_cache (NULL, wcachesw != CACHE_NEVER ? wcachesw : CACHE_ASK, &cachetype, ct->c_id, cachefile, sizeof(cachefile)) == NOTOK) { advise (NULL, "unable to cache %s's contents", ct->c_file); return; } if (wcachesw != CACHE_NEVER && wcachesw != CACHE_ASK) { fflush (stdout); fprintf (stderr, "caching message %s as file %s\n", ct->c_file, cachefile); } if (ce->ce_file) { int mask = umask (cachetype ? ~m_gmprot () : 0222); FILE *fp; if (debugsw) fprintf (stderr, "caching by copying %s...\n", ce->ce_file); file = NULL; if ((*ct->c_ceopenfnx) (ct, &file) == NOTOK) goto reset_umask; if ((fp = fopen (cachefile, "w"))) { int cc; char buffer[BUFSIZ]; FILE *gp = ce->ce_fp; fseek (gp, 0L, SEEK_SET); while ((cc = fread (buffer, sizeof(*buffer), sizeof(buffer), gp)) > 0) fwrite (buffer, sizeof(*buffer), cc, fp); fflush (fp); if (ferror (gp)) { admonish (ce->ce_file, "error reading"); unlink (cachefile); } else { if (ferror (fp)) { admonish (cachefile, "error writing"); unlink (cachefile); } } fclose (fp); } else content_error (cachefile, ct, "unable to fopen for writing"); reset_umask: umask (mask); } else { if (debugsw) fprintf (stderr, "in place caching...\n"); file = cachefile; if ((*ct->c_ceopenfnx) (ct, &file) != NOTOK) chmod (cachefile, cachetype ? m_gmprot () : 0444); } } int find_cache (CT ct, int policy, int *writing, char *id, char *buffer, int buflen) { int status = NOTOK; if (id == NULL) return NOTOK; id = trimcpy (id); if (debugsw) fprintf (stderr, "find_cache %s(%d) %s %s\n", caches[policy].sw, policy, writing ? "writing" : "reading", id); switch (policy) { case CACHE_NEVER: default: break; case CACHE_ASK: case CACHE_PUBLIC: if (cache_private && !writing && find_cache_aux (writing ? 2 : 0, cache_private, id, buffer, buflen) == OK) { if (access (buffer, R_OK) != NOTOK) { got_private: if (writing) *writing = 1; got_it: status = OK; break; } } if (cache_public && find_cache_aux (writing ? 1 : 0, cache_public, id, buffer, buflen) == OK) { if (writing || access (buffer, R_OK) != NOTOK) { if (writing) *writing = 0; goto got_it; } } break; case CACHE_PRIVATE: if (cache_private && find_cache_aux (writing ? 2 : 0, cache_private, id, buffer, buflen) == OK) { if (writing || access (buffer, R_OK) != NOTOK) goto got_private; } break; } if (status == OK && policy == CACHE_ASK) { int len, buflen; char *bp, query[BUFSIZ]; if (xpid) { if (xpid < 0) xpid = -xpid; pidcheck (pidwait (xpid, NOTOK)); xpid = 0; } /* Get buffer ready to go */ bp = query; buflen = sizeof(query); /* Now, construct query */ if (writing) { snprintf (bp, buflen, "Make cached, publically-accessible copy"); } else { struct stat st; snprintf (bp, buflen, "Use cached copy"); len = strlen (bp); bp += len; buflen -= len; if (ct->c_partno) { snprintf (bp, buflen, " of content %s", ct->c_partno); len = strlen (bp); bp += len; buflen -= len; } stat (buffer, &st); snprintf (bp, buflen, " (size %lu octets)", (unsigned long) st.st_size); } len = strlen (bp); bp += len; buflen -= len; snprintf (bp, buflen, "\n in file %s? ", buffer); /* Now, check answer */ if (!getanswer (query)) status = NOTOK; } if (status == OK && writing) { if (*writing && strchr(buffer, '/')) make_intermediates (buffer); unlink (buffer); } free (id); return status; } static int find_cache_aux (int writing, char *directory, char *id, char *buffer, int buflen) { int mask, usemap; char mapfile[BUFSIZ], mapname[BUFSIZ]; FILE *fp; static int partno, pid; static time_t clock = 0; usemap = 1; if (debugsw) fprintf (stderr, "find_cache_aux %s usemap=%d\n", directory, usemap); snprintf (mapfile, sizeof(mapfile), "%s/cache.map", directory); if (find_cache_aux2 (mapfile, id, mapname, sizeof(mapname)) == OK) goto done_map; if (!writing) { if (usemap) return NOTOK; use_raw: snprintf (buffer, buflen, "%s/%s", directory, id); return OK; } if (!usemap && access (mapfile, W_OK) == NOTOK) goto use_raw; if (clock != 0) { time_t now; time (&now); if (now > clock) clock = 0; } else { pid = getpid (); } if (clock == 0) { time (&clock); partno = 0; } else { if (partno > 0xff) { clock++; partno = 0; } } snprintf (mapname, sizeof(mapname), "%08x%04x%02x", (unsigned int) (clock & 0xffffffff), (unsigned int) (pid & 0xffff), (unsigned int) (partno++ & 0xff)); if (debugsw) fprintf (stderr, "creating mapping %s->%s\n", mapname, id); make_intermediates (mapfile); mask = umask (writing == 2 ? 0077 : 0); if (!(fp = lkfopen (mapfile, "a")) && errno == ENOENT) { int fd; if ((fd = creat (mapfile, 0666)) != NOTOK) { close (fd); fp = lkfopen (mapfile, "a"); } } umask (mask); if (!fp) return NOTOK; fprintf (fp, "%s: %s\n", mapname, id); lkfclose (fp, mapfile); done_map: if (*mapname == '/') strncpy (buffer, mapname, buflen); else snprintf (buffer, buflen, "%s/%s", directory, mapname); if (debugsw) fprintf (stderr, "use %s\n", buffer); return OK; } static int find_cache_aux2 (char *mapfile, char *id, char *mapname, int namelen) { int state; char buf[BUFSIZ], name[NAMESZ]; FILE *fp; if (!(fp = lkfopen (mapfile, "r"))) return NOTOK; for (state = FLD;;) { int result; char *cp, *dp; switch (state = m_getfld (state, name, buf, sizeof(buf), fp)) { case FLD: case FLDPLUS: case FLDEOF: strncpy (mapname, name, namelen); if (state != FLDPLUS) cp = buf; else { cp = add (buf, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), fp); cp = add (buf, cp); } } dp = trimcpy (cp); if (cp != buf) free (cp); if (debugsw) fprintf (stderr, "compare %s to %s <- %s\n", id, dp, mapname); result = strcmp (id, dp); free (dp); if (result == 0) { lkfclose (fp, mapfile); return OK; } if (state != FLDEOF) continue; /* else fall... */ case BODY: case BODYEOF: case FILEEOF: default: break; } break; } lkfclose (fp, mapfile); return NOTOK; } nmh-1.5/uip/mhfree.c000644 007761 000765 00000010752 11713401274 014306 0ustar00kenhkenh000000 000000 /* * mhfree.c -- routines to free the data structures used to * -- represent MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include /* The list of top-level contents to display */ CT *cts = NULL; /* * prototypes */ void free_content (CT); void free_header (CT); void free_ctinfo (CT); void free_encoding (CT, int); void freects_done (int); /* * static prototypes */ static void free_text (CT); static void free_multi (CT); static void free_partial (CT); static void free_external (CT); /* * Primary routine to free a MIME content structure */ void free_content (CT ct) { if (!ct) return; /* * free all the header fields */ free_header (ct); if (ct->c_partno) free (ct->c_partno); if (ct->c_vrsn) free (ct->c_vrsn); if (ct->c_ctline) free (ct->c_ctline); free_ctinfo (ct); /* * some of the content types have extra * parts which need to be freed. */ switch (ct->c_type) { case CT_MULTIPART: free_multi (ct); break; case CT_MESSAGE: switch (ct->c_subtype) { case MESSAGE_PARTIAL: free_partial (ct); break; case MESSAGE_EXTERNAL: free_external (ct); break; } break; case CT_TEXT: free_text (ct); break; } if (ct->c_showproc) free (ct->c_showproc); if (ct->c_termproc) free (ct->c_termproc); if (ct->c_storeproc) free (ct->c_storeproc); if (ct->c_celine) free (ct->c_celine); /* free structures for content encodings */ free_encoding (ct, 1); if (ct->c_id) free (ct->c_id); if (ct->c_descr) free (ct->c_descr); if (ct->c_dispo) free (ct->c_dispo); if (ct->c_file) { if (ct->c_unlink) unlink (ct->c_file); free (ct->c_file); } if (ct->c_fp) fclose (ct->c_fp); if (ct->c_storage) free (ct->c_storage); if (ct->c_folder) free (ct->c_folder); free (ct); } /* * Free the linked list of header fields * for this content. */ void free_header (CT ct) { HF hp1, hp2; hp1 = ct->c_first_hf; while (hp1) { hp2 = hp1->next; free (hp1->name); free (hp1->value); free (hp1); hp1 = hp2; } ct->c_first_hf = NULL; ct->c_last_hf = NULL; } void free_ctinfo (CT ct) { char **ap; CI ci; ci = &ct->c_ctinfo; if (ci->ci_type) { free (ci->ci_type); ci->ci_type = NULL; } if (ci->ci_subtype) { free (ci->ci_subtype); ci->ci_subtype = NULL; } for (ap = ci->ci_attrs; *ap; ap++) { free (*ap); *ap = NULL; } if (ci->ci_comment) { free (ci->ci_comment); ci->ci_comment = NULL; } if (ci->ci_magic) { free (ci->ci_magic); ci->ci_magic = NULL; } } static void free_text (CT ct) { struct text *t; if (!(t = (struct text *) ct->c_ctparams)) return; free ((char *) t); ct->c_ctparams = NULL; } static void free_multi (CT ct) { struct multipart *m; struct part *part, *next; if (!(m = (struct multipart *) ct->c_ctparams)) return; if (m->mp_start) free (m->mp_start); if (m->mp_stop) free (m->mp_stop); for (part = m->mp_parts; part; part = next) { next = part->mp_next; free_content (part->mp_part); free ((char *) part); } m->mp_parts = NULL; free ((char *) m); ct->c_ctparams = NULL; } static void free_partial (CT ct) { struct partial *p; if (!(p = (struct partial *) ct->c_ctparams)) return; if (p->pm_partid) free (p->pm_partid); free ((char *) p); ct->c_ctparams = NULL; } static void free_external (CT ct) { struct exbody *e; if (!(e = (struct exbody *) ct->c_ctparams)) return; free_content (e->eb_content); if (e->eb_body) free (e->eb_body); free ((char *) e); ct->c_ctparams = NULL; } /* * Free data structures related to encoding/decoding * Content-Transfer-Encodings. */ void free_encoding (CT ct, int toplevel) { CE ce; if (!(ce = ct->c_cefile)) return; if (ce->ce_fp) { fclose (ce->ce_fp); ce->ce_fp = NULL; } if (ce->ce_file) { if (ce->ce_unlink) unlink (ce->ce_file); free (ce->ce_file); ce->ce_file = NULL; } if (toplevel) { free ((char *) ce); ct->c_cefile = NULL; } else { ct->c_ceopenfnx = NULL; } } void freects_done (int status) { CT *ctp; if ((ctp = cts)) for (; *ctp; ctp++) free_content (*ctp); exit (status); } nmh-1.5/uip/mhl.c000644 007761 000765 00000000567 11762736347 013643 0ustar00kenhkenh000000 000000 /* * mhl.c -- the nmh message listing program * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int main (int argc, char **argv) { #ifdef LOCALE setlocale(LC_ALL, ""); #endif done (mhl (argc, argv)); return 1; } nmh-1.5/uip/mhlist.c000644 007761 000765 00000020326 11765267273 014356 0ustar00kenhkenh000000 000000 /* * mhlist.c -- list the contents of MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include static struct swit switches[] = { #define CHECKSW 0 { "check", 0 }, #define NCHECKSW 1 { "nocheck", 0 }, #define HEADSW 2 { "headers", 0 }, #define NHEADSW 3 { "noheaders", 0 }, #define SIZESW 4 { "realsize", 0 }, #define NSIZESW 5 { "norealsize", 0 }, #define VERBSW 6 { "verbose", 0 }, #define NVERBSW 7 { "noverbose", 0 }, #define FILESW 8 /* interface from show */ { "file file", 0 }, #define PARTSW 9 { "part number", 0 }, #define TYPESW 10 { "type content", 0 }, #define RCACHESW 11 { "rcache policy", 0 }, #define WCACHESW 12 { "wcache policy", 0 }, #define VERSIONSW 13 { "version", 0 }, #define HELPSW 14 { "help", 0 }, /* * switches for debugging */ #define DEBUGSW 15 { "debug", -5 }, { NULL, 0 } }; /* mhparse.c */ extern char *tmp; /* directory to place temp files */ /* mhcachesbr.c */ extern int rcachesw; extern int wcachesw; extern char *cache_public; extern char *cache_private; /* mhmisc.c */ extern int npart; extern int ntype; extern char *parts[NPARTS + 1]; extern char *types[NTYPES + 1]; extern int userrs; /* * This is currently needed to keep mhparse happy. * This needs to be changed. */ pid_t xpid = 0; int debugsw = 0; int verbosw = 0; #define quitser pipeser /* mhparse.c */ CT parse_mime (char *); /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void flush_errors (void); /* mhlistsbr.c */ void list_all_messages (CT *, int, int, int, int); /* mhfree.c */ void free_content (CT); extern CT *cts; void freects_done (int) NORETURN; /* * static prototypes */ static void pipeser (int); int main (int argc, char **argv) { int sizesw = 1, headsw = 1; int msgnum, *icachesw; char *cp, *file = NULL, *folder = NULL; char *maildir, buf[100], **argp; char **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp = NULL; CT ct, *ctp; done=freects_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case RCACHESW: icachesw = &rcachesw; goto do_cache; case WCACHESW: icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, caches)) { case AMBIGSW: ambigsw (cp, caches); done (1); case UNKWNSW: adios (NULL, "%s unknown", cp); default: break; } continue; case CHECKSW: checksw++; continue; case NCHECKSW: checksw = 0; continue; case HEADSW: headsw = 1; continue; case NHEADSW: headsw = 0; continue; case SIZESW: sizesw = 1; continue; case NSIZESW: sizesw = 0; continue; case PARTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (npart >= NPARTS) adios (NULL, "too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (ntype >= NTYPES) adios (NULL, "too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios (NULL, "missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; case VERBSW: verbosw = 1; continue; case NVERBSW: verbosw = 0; continue; case DEBUGSW: debugsw = 1; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } /* null terminate the list of acceptable parts/types */ parts[npart] = NULL; types[ntype] = NULL; set_endian (); /* Check for public cache location */ if ((cache_public = context_find (nmhcache)) && *cache_public != '/') cache_public = NULL; /* Check for private cache location */ if (!(cache_private = context_find (nmhprivcache))) cache_private = ".cache"; cache_private = getcpy (m_maildir (cache_private)); /* * Check for storage directory. If specified, * then store temporary files there. Else we * store them in standard nmh directory. */ if ((cp = context_find (nmhstorage)) && *cp) tmp = concat (cp, "/", invo_name, NULL); else tmp = add (m_maildir (invo_name), NULL); if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && msgs.size) adios (NULL, "cannot specify msg and file at same time!"); /* * check if message is coming from file */ if (file) { if (!(cts = (CT *) calloc ((size_t) 2, sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; if ((ct = parse_mime (file))) *ctp++ = ct; } else { /* * message(s) are coming from a folder */ if (!msgs.size) app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ if (!(cts = (CT *) calloc ((size_t) (mp->numsel + 1), sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { char *msgnam; msgnam = m_name (msgnum); if ((ct = parse_mime (msgnam))) *ctp++ = ct; } } } if (!*cts) done (1); userrs = 1; SIGNAL (SIGQUIT, quitser); SIGNAL (SIGPIPE, pipeser); /* * Get the associated umask for the relevant contents. */ for (ctp = cts; *ctp; ctp++) { struct stat st; ct = *ctp; if (type_ok (ct, 1) && !ct->c_umask) { if (stat (ct->c_file, &st) != NOTOK) ct->c_umask = ~(st.st_mode & 0777); else ct->c_umask = ~m_gmprot(); } } /* * List the message content */ list_all_messages (cts, headsw, sizesw, verbosw, debugsw); /* Now free all the structures for the content */ for (ctp = cts; *ctp; ctp++) free_content (*ctp); free ((char *) cts); cts = NULL; /* If reading from a folder, do some updating */ if (mp) { context_replace (pfolder, folder);/* update current folder */ seq_setcur (mp, mp->hghsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } done (0); return 1; } static void pipeser (int i) { if (i == SIGQUIT) { unlink ("core"); fflush (stdout); fprintf (stderr, "\n"); fflush (stderr); } done (1); /* NOTREACHED */ } nmh-1.5/uip/mhlistsbr.c000644 007761 000765 00000023766 11762736347 015100 0ustar00kenhkenh000000 000000 /* * mhlistsbr.c -- routines to list information about the * -- contents of MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void flush_errors (void); /* * prototypes */ void list_all_messages (CT *, int, int, int, int); int list_switch (CT, int, int, int, int); int list_content (CT, int, int, int, int); /* * static prototypes */ static void list_single_message (CT, int, int, int); static int list_debug (CT); static int list_multi (CT, int, int, int, int); static int list_partial (CT, int, int, int, int); static int list_external (CT, int, int, int, int); static int list_application (CT, int, int, int, int); static int list_encoding (CT); /* * various formats for -list option */ #define LSTFMT1 "%4s %-5s %-24s %5s %-36s\n" #define LSTFMT2a "%4d " #define LSTFMT2b "%-5s %-24.24s " #define LSTFMT2c1 "%5lu" #define LSTFMT2c2 "%4lu%c" #define LSTFMT2c3 "huge " #define LSTFMT2c4 " " #define LSTFMT2d1 " %-36.36s" #define LSTFMT2d2 "\t %-65.65s\n" /* * Top level entry point to list group of messages */ void list_all_messages (CT *cts, int headers, int realsize, int verbose, int debug) { CT ct, *ctp; if (headers) printf (LSTFMT1, "msg", "part", "type/subtype", "size", "description"); for (ctp = cts; *ctp; ctp++) { ct = *ctp; list_single_message (ct, realsize, verbose, debug); } flush_errors (); } /* * Entry point to list a single message */ static void list_single_message (CT ct, int realsize, int verbose, int debug) { if (type_ok (ct, 1)) { umask (ct->c_umask); list_switch (ct, 1, realsize, verbose, debug); if (ct->c_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } if (ct->c_ceclosefnx) (*ct->c_ceclosefnx) (ct); } } /* * Primary switching routine to list information about a content */ int list_switch (CT ct, int toplevel, int realsize, int verbose, int debug) { switch (ct->c_type) { case CT_MULTIPART: return list_multi (ct, toplevel, realsize, verbose, debug); break; case CT_MESSAGE: switch (ct->c_subtype) { case MESSAGE_PARTIAL: return list_partial (ct, toplevel, realsize, verbose, debug); break; case MESSAGE_EXTERNAL: return list_external (ct, toplevel, realsize, verbose, debug); break; case MESSAGE_RFC822: default: return list_content (ct, toplevel, realsize, verbose, debug); break; } break; case CT_TEXT: case CT_AUDIO: case CT_IMAGE: case CT_VIDEO: return list_content (ct, toplevel, realsize, verbose, debug); break; case CT_APPLICATION: return list_application (ct, toplevel, realsize, verbose, debug); break; default: /* list_debug (ct); */ adios (NULL, "unknown content type %d", ct->c_type); break; } return 0; /* NOT REACHED */ } #define empty(s) ((s) ? (s) : "") /* * Method for listing information about a simple/generic content */ int list_content (CT ct, int toplevel, int realsize, int verbose, int debug) { unsigned long size; char *cp, buffer[BUFSIZ]; CI ci = &ct->c_ctinfo; printf (toplevel > 0 ? LSTFMT2a : toplevel < 0 ? "part " : " ", atoi (r1bindex (empty (ct->c_file), '/'))); snprintf (buffer, sizeof(buffer), "%s/%s", empty (ci->ci_type), empty (ci->ci_subtype)); printf (LSTFMT2b, empty (ct->c_partno), buffer); if (ct->c_cesizefnx && realsize) size = (*ct->c_cesizefnx) (ct); else size = ct->c_end - ct->c_begin; /* find correct scale for size (Kilo/Mega/Giga/Tera) */ for (cp = " KMGT"; size > 9999; size >>= 10) if (!*++cp) break; /* print size of this body part */ switch (*cp) { case ' ': if (size > 0 || ct->c_encoding != CE_EXTERNAL) printf (LSTFMT2c1, size); else printf (LSTFMT2c4); break; default: printf (LSTFMT2c2, size, *cp); break; case '\0': printf (LSTFMT2c3); } /* print Content-Description */ if (ct->c_descr) { char *dp; dp = trimcpy (cp = add (ct->c_descr, NULL)); free (cp); printf (LSTFMT2d1, dp); free (dp); } printf ("\n"); if (verbose) { char **ap, **ep; CI ci = &ct->c_ctinfo; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) printf ("\t %s=\"%s\"\n", *ap, *ep); /* * If verbose, print any RFC-822 comments in the * Content-Type line. */ if (ci->ci_comment) { char *dp; dp = trimcpy (cp = add (ci->ci_comment, NULL)); free (cp); snprintf (buffer, sizeof(buffer), "(%s)", dp); free (dp); printf (LSTFMT2d2, buffer); } } if (debug) list_debug (ct); return OK; } /* * Print debugging information about a content */ static int list_debug (CT ct) { char **ap, **ep; CI ci = &ct->c_ctinfo; fflush (stdout); fprintf (stderr, " partno \"%s\"\n", empty (ct->c_partno)); /* print MIME-Version line */ if (ct->c_vrsn) fprintf (stderr, " %s:%s\n", VRSN_FIELD, ct->c_vrsn); /* print Content-Type line */ if (ct->c_ctline) fprintf (stderr, " %s:%s\n", TYPE_FIELD, ct->c_ctline); /* print parsed elements of content type */ fprintf (stderr, " type \"%s\"\n", empty (ci->ci_type)); fprintf (stderr, " subtype \"%s\"\n", empty (ci->ci_subtype)); fprintf (stderr, " comment \"%s\"\n", empty (ci->ci_comment)); fprintf (stderr, " magic \"%s\"\n", empty (ci->ci_magic)); /* print parsed parameters attached to content type */ fprintf (stderr, " parameters\n"); for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) fprintf (stderr, " %s=\"%s\"\n", *ap, *ep); /* print internal flags for type/subtype */ fprintf (stderr, " type 0x%x subtype 0x%x params 0x%x\n", ct->c_type, ct->c_subtype, (unsigned int)(unsigned long) ct->c_ctparams); fprintf (stderr, " showproc \"%s\"\n", empty (ct->c_showproc)); fprintf (stderr, " termproc \"%s\"\n", empty (ct->c_termproc)); fprintf (stderr, " storeproc \"%s\"\n", empty (ct->c_storeproc)); /* print transfer encoding information */ if (ct->c_celine) fprintf (stderr, " %s:%s", ENCODING_FIELD, ct->c_celine); /* print internal flags for transfer encoding */ fprintf (stderr, " transfer encoding 0x%x params 0x%x\n", ct->c_encoding, (unsigned int)(unsigned long) ct->c_cefile); /* print Content-ID */ if (ct->c_id) fprintf (stderr, " %s:%s", ID_FIELD, ct->c_id); /* print Content-Description */ if (ct->c_descr) fprintf (stderr, " %s:%s", DESCR_FIELD, ct->c_descr); fprintf (stderr, " read fp 0x%x file \"%s\" begin %ld end %ld\n", (unsigned int)(unsigned long) ct->c_fp, empty (ct->c_file), ct->c_begin, ct->c_end); /* print more information about transfer encoding */ list_encoding (ct); return OK; } #undef empty /* * list content information for type "multipart" */ static int list_multi (CT ct, int toplevel, int realsize, int verbose, int debug) { struct multipart *m = (struct multipart *) ct->c_ctparams; struct part *part; /* list the content for toplevel of this multipart */ list_content (ct, toplevel, realsize, verbose, debug); /* now list for all the subparts */ for (part = m->mp_parts; part; part = part->mp_next) { CT p = part->mp_part; if (part_ok (p, 1) && type_ok (p, 1)) list_switch (p, 0, realsize, verbose, debug); } return OK; } /* * list content information for type "message/partial" */ static int list_partial (CT ct, int toplevel, int realsize, int verbose, int debug) { struct partial *p = (struct partial *) ct->c_ctparams; list_content (ct, toplevel, realsize, verbose, debug); if (verbose) { printf ("\t [message %s, part %d", p->pm_partid, p->pm_partno); if (p->pm_maxno) printf (" of %d", p->pm_maxno); printf ("]\n"); } return OK; } /* * list content information for type "message/external" */ static int list_external (CT ct, int toplevel, int realsize, int verbose, int debug) { struct exbody *e = (struct exbody *) ct->c_ctparams; /* * First list the information for the * message/external content itself. */ list_content (ct, toplevel, realsize, verbose, debug); if (verbose) { if (e->eb_name) printf ("\t name=\"%s\"\n", e->eb_name); if (e->eb_dir) printf ("\t directory=\"%s\"\n", e->eb_dir); if (e->eb_site) printf ("\t site=\"%s\"\n", e->eb_site); if (e->eb_server) printf ("\t server=\"%s\"\n", e->eb_server); if (e->eb_subject) printf ("\t subject=\"%s\"\n", e->eb_subject); /* This must be defined */ printf ("\t access-type=\"%s\"\n", e->eb_access); if (e->eb_mode) printf ("\t mode=\"%s\"\n", e->eb_mode); if (e->eb_permission) printf ("\t permission=\"%s\"\n", e->eb_permission); if (e->eb_flags == NOTOK) printf ("\t [service unavailable]\n"); } /* * Now list the information for the external content * to which this content points. */ list_content (e->eb_content, 0, realsize, verbose, debug); return OK; } /* * list content information for type "application" * This no longer needs to be a separate function. It used to * produce some output with verbose enabled, but that has been * moved to list_content (). */ static int list_application (CT ct, int toplevel, int realsize, int verbose, int debug) { list_content (ct, toplevel, realsize, verbose, debug); return OK; } /* * list information about the Content-Transfer-Encoding * used by a content. */ static int list_encoding (CT ct) { CE ce; if ((ce = ct->c_cefile)) fprintf (stderr, " decoded fp 0x%x file \"%s\"\n", (unsigned int)(unsigned long) ce->ce_fp, ce->ce_file ? ce->ce_file : ""); return OK; } nmh-1.5/uip/mhlsbr.c000644 007761 000765 00000145635 11765267273 014360 0ustar00kenhkenh000000 000000 /* * mhlsbr.c -- main routines for nmh message lister * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include /* * MAJOR BUG: * for a component containing addresses, ADDRFMT, if COMPRESS is also * set, then addresses get split wrong (not at the spaces between commas). * To fix this correctly, putstr() should know about "atomic" strings that * must NOT be broken across lines. That's too difficult for right now * (it turns out that there are a number of degernate cases), so in * oneline(), instead of * * (*onelp == '\n' && !onelp[1]) * * being a terminating condition, * * (*onelp == '\n' && (!onelp[1] || (flags & ADDRFMT))) * * is used instead. This cuts the line prematurely, and gives us a much * better chance of getting things right. */ #define ONECOMP 0 #define TWOCOMP 1 #define BODYCOMP 2 #define QUOTE '\\' static struct swit mhlswitches[] = { #define BELLSW 0 { "bell", 0 }, #define NBELLSW 1 { "nobell", 0 }, #define CLRSW 2 { "clear", 0 }, #define NCLRSW 3 { "noclear", 0 }, #define FACESW 4 { "faceproc program", 0 }, #define NFACESW 5 { "nofaceproc", 0 }, #define FOLDSW 6 { "folder +folder", 0 }, #define FORMSW 7 { "form formfile", 0 }, #define PROGSW 8 { "moreproc program", 0 }, #define NPROGSW 9 { "nomoreproc", 0 }, #define LENSW 10 { "length lines", 0 }, #define WIDTHSW 11 { "width columns", 0 }, #define SLEEPSW 12 { "sleep seconds", 0 }, #define BITSTUFFSW 13 { "dashstuffing", -12 }, /* interface from forw */ #define NBITSTUFFSW 14 { "nodashstuffing", -14 }, /* interface from forw */ #define VERSIONSW 15 { "version", 0 }, #define HELPSW 16 { "help", 0 }, #define FORW1SW 17 { "forward", -7 }, /* interface from forw */ #define FORW2SW 18 { "forwall", -7 }, /* interface from forw */ #define DGSTSW 19 { "digest list", -6 }, #define VOLUMSW 20 { "volume number", -6 }, #define ISSUESW 21 { "issue number", -5 }, #define NBODYSW 22 { "nobody", -6 }, #define FMTPROCSW 23 { "fmtproc program", 0 }, #define NFMTPROCSW 24 { "nofmtproc", 0 }, { NULL, 0 } }; #define NOCOMPONENT 0x000001 /* don't show component name */ #define UPPERCASE 0x000002 /* display in all upper case */ #define CENTER 0x000004 /* center line */ #define CLEARTEXT 0x000008 /* cleartext */ #define EXTRA 0x000010 /* an "extra" component */ #define HDROUTPUT 0x000020 /* already output */ #define CLEARSCR 0x000040 /* clear screen */ #define LEFTADJUST 0x000080 /* left justify multiple lines */ #define COMPRESS 0x000100 /* compress text */ #define ADDRFMT 0x000200 /* contains addresses */ #define BELL 0x000400 /* sound bell at EOP */ #define DATEFMT 0x000800 /* contains dates */ #define FORMAT 0x001000 /* parse address/date/RFC-2047 field */ #define INIT 0x002000 /* initialize component */ #define FACEFMT 0x004000 /* contains face */ #define FACEDFLT 0x008000 /* default for face */ #define SPLIT 0x010000 /* split headers (don't concatenate) */ #define NONEWLINE 0x020000 /* don't write trailing newline */ #define NOWRAP 0x040000 /* Don't wrap lines ever */ #define FMTFILTER 0x080000 /* Filter through format filter */ #define LBITS "\020\01NOCOMPONENT\02UPPERCASE\03CENTER\04CLEARTEXT\05EXTRA\06HDROUTPUT\07CLEARSCR\010LEFTADJUST\011COMPRESS\012ADDRFMT\013BELL\014DATEFMT\015FORMAT\016INIT\017FACEFMT\020FACEDFLT\021SPLIT\022NONEWLINE\023NOWRAP\024FMTFILTER" #define GFLAGS (NOCOMPONENT | UPPERCASE | CENTER | LEFTADJUST | COMPRESS | SPLIT | NOWRAP) /* * A list of format arguments */ struct arglist { struct format *a_fmt; char *a_nfs; struct arglist *a_next; }; struct mcomp { char *c_name; /* component name */ char *c_text; /* component text */ char *c_ovtxt; /* text overflow indicator */ char *c_nfs; /* iff FORMAT */ struct format *c_fmt; /* .. */ char *c_face; /* face designator */ int c_offset; /* left margin indentation */ int c_ovoff; /* overflow indentation */ int c_width; /* width of field */ int c_cwidth; /* width of component */ int c_length; /* length in lines */ long c_flags; struct arglist *c_f_args; /* Argument list for filter*/ struct arglist *c_f_tail; /* Pointer to tail of list */ int c_nargs; /* Number of arguments */ struct mcomp *c_next; }; static struct mcomp *msghd = NULL; static struct mcomp *msgtl = NULL; static struct mcomp *fmthd = NULL; static struct mcomp *fmttl = NULL; static struct mcomp global = { NULL, NULL, NULL, NULL, NULL, NULL, 0, -1, 80, -1, 40, BELL, NULL, NULL, 0, NULL }; static struct mcomp holder = { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NOCOMPONENT, NULL, NULL, 0, NULL }; struct pair { char *p_name; long p_flags; }; static struct pair pairs[] = { { "Date", DATEFMT }, { "From", ADDRFMT|FACEDFLT }, { "Sender", ADDRFMT }, { "Reply-To", ADDRFMT }, { "To", ADDRFMT }, { "cc", ADDRFMT }, { "Bcc", ADDRFMT }, { "Resent-Date", DATEFMT }, { "Resent-From", ADDRFMT }, { "Resent-Sender", ADDRFMT }, { "Resent-Reply-To", ADDRFMT }, { "Resent-To", ADDRFMT }, { "Resent-cc", ADDRFMT }, { "Resent-Bcc", ADDRFMT }, { "Face", FACEFMT }, { NULL, 0 } }; struct triple { char *t_name; long t_on; long t_off; }; static struct triple triples[] = { { "nocomponent", NOCOMPONENT, 0 }, { "uppercase", UPPERCASE, 0 }, { "nouppercase", 0, UPPERCASE }, { "center", CENTER, 0 }, { "nocenter", 0, CENTER }, { "clearscreen", CLEARSCR, 0 }, { "noclearscreen", 0, CLEARSCR }, { "noclear", 0, CLEARSCR }, { "leftadjust", LEFTADJUST, 0 }, { "noleftadjust", 0, LEFTADJUST }, { "compress", COMPRESS, 0 }, { "nocompress", 0, COMPRESS }, { "split", SPLIT, 0 }, { "nosplit", 0, SPLIT }, { "addrfield", ADDRFMT, DATEFMT }, { "bell", BELL, 0 }, { "nobell", 0, BELL }, { "datefield", DATEFMT, ADDRFMT }, { "newline", 0, NONEWLINE }, { "nonewline", NONEWLINE, 0 }, { "wrap", 0, NOWRAP }, { "nowrap", NOWRAP, 0 }, { "format", FMTFILTER, 0 }, { "noformat", 0, FMTFILTER }, { NULL, 0, 0 } }; static char *addrcomps[] = { "from", "sender", "reply-to", "to", "cc", "bcc", "resent-from", "resent-sender", "resent-reply-to", "resent-to", "resent-cc", "resent-bcc", NULL }; static int bellflg = 0; static int clearflg = 0; static int dashstuff = 0; static int dobody = 1; static int forwflg = 0; static int forwall = 0; static int sleepsw = NOTOK; static char *digest = NULL; static int volume = 0; static int issue = 0; static int exitstat = 0; static int mhldebug = 0; static int filesize = 0; #define PITTY (-1) #define NOTTY 0 #define ISTTY 1 static int ontty = NOTTY; static int row; static unsigned int column; static int lm; static int llim; static int ovoff; static int term; static unsigned int wid; static char *ovtxt; static unsigned char *onelp; static char *parptr; static int num_ignores = 0; static char *ignores[MAXARGS]; static jmp_buf env; static jmp_buf mhlenv; static char delim3[] = /* from forw.c */ "\n----------------------------------------------------------------------\n\n"; static char delim4[] = "\n------------------------------\n\n"; static FILE *(*mhl_action) () = (FILE *(*) ()) 0; static struct comp *mhlcomp[128]; /* * Redefine a couple of functions. * These are undefined later in the code. */ #define adios mhladios #define done mhldone /* * prototypes */ static void mhl_format (char *, int, int); static int evalvar (struct mcomp *); static int ptoi (char *, int *); static int ptos (char *, char **); static char *parse (void); static void process (char *, char *, int, int); static void mhlfile (FILE *, char *, int, int); static int mcomp_flags (char *); static char *mcomp_add (long, char *, char *); static void mcomp_format (struct mcomp *, struct mcomp *); static struct mcomp *add_queue (struct mcomp **, struct mcomp **, char *, char *, int); static void free_queue (struct mcomp **, struct mcomp **); static void putcomp (struct mcomp *, struct mcomp *, int); static char *oneline (char *, long); static void putstr (char *, long); static void putch (char, long); static void intrser (int); static void pipeser (int); static void quitser (int); static void face_format (struct mcomp *); static int doface (struct mcomp *); static void mhladios (char *, char *, ...); static void mhldone (int); static void m_popen (char *); static void filterbody (struct mcomp *, char *, int, int, FILE *); static int compileargs (struct mcomp *, char *); static int checkcomp (char *, char *); static void addcomp (int, char *, char *); static void freecomps (void); static void freecomptext (void); int mhl (int argc, char **argv) { int length = 0, nomore = 0; unsigned int i, vecp = 0; int width = 0; char *cp, *folder = NULL, *form = NULL; char buf[BUFSIZ], *files[MAXARGS]; char **argp, **arguments; invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; if ((cp = getenv ("MHLDEBUG")) && *cp) mhldebug++; if ((cp = getenv ("FACEPROC"))) faceproc = cp; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, mhlswitches)) { case AMBIGSW: ambigsw (cp, mhlswitches); done (1); case UNKWNSW: adios (NULL, "-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [files ...]", invo_name); print_help (buf, mhlswitches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case BELLSW: bellflg = 1; continue; case NBELLSW: bellflg = -1; continue; case CLRSW: clearflg = 1; continue; case NCLRSW: clearflg = -1; continue; case FOLDSW: if (!(folder = *argp++) || *folder == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case FACESW: if (!(faceproc = *argp++) || *faceproc == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NFACESW: faceproc = NULL; continue; case SLEEPSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); sleepsw = atoi (cp);/* ZERO ok! */ continue; case PROGSW: if (!(moreproc = *argp++) || *moreproc == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NPROGSW: nomore++; continue; case FMTPROCSW: if (!(formatproc = *argp++) || *formatproc == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NFMTPROCSW: formatproc = NULL; continue; case LENSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((length = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((width = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case DGSTSW: if (!(digest = *argp++) || *digest == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case ISSUESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((issue = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case VOLUMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((volume = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case FORW2SW: forwall++; /* fall */ case FORW1SW: forwflg++; clearflg = -1;/* XXX */ continue; case BITSTUFFSW: dashstuff = 1; /* trinary logic */ continue; case NBITSTUFFSW: dashstuff = -1; /* trinary logic */ continue; case NBODYSW: dobody = 0; continue; } } files[vecp++] = cp; } if (!folder) folder = getenv ("mhfolder"); if (isatty (fileno (stdout))) { if (!nomore && !sc_hardcopy() && moreproc && *moreproc != '\0') { if (mhl_action) { SIGNAL (SIGINT, SIG_IGN); SIGNAL2 (SIGQUIT, quitser); } SIGNAL2 (SIGPIPE, pipeser); m_popen (moreproc); ontty = PITTY; } else { SIGNAL (SIGINT, SIG_IGN); SIGNAL2 (SIGQUIT, quitser); ontty = ISTTY; } } else { ontty = NOTTY; } for (i = 0; i < sizeof(mhlcomp)/sizeof(mhlcomp[0]); i++) mhlcomp[i] = NULL; mhl_format (form ? form : mhlformat, length, width); if (vecp == 0) { process (folder, NULL, 1, vecp = 1); } else { for (i = 0; i < vecp; i++) process (folder, files[i], i + 1, vecp); } freecomps(); if (forwall) { if (digest) { printf ("%s", delim4); if (volume == 0) { snprintf (buf, sizeof(buf), "End of %s Digest\n", digest); } else { snprintf (buf, sizeof(buf), "End of %s Digest [Volume %d Issue %d]\n", digest, volume, issue); } i = strlen (buf); for (cp = buf + i; i > 1; i--) *cp++ = '*'; *cp++ = '\n'; *cp = 0; printf ("%s", buf); } else printf ("\n------- End of Forwarded Message%s\n", vecp > 1 ? "s" : ""); } fflush(stdout); if(ferror(stdout)){ adios("output", "error writing"); } if (clearflg > 0 && ontty == NOTTY) clear_screen (); if (ontty == PITTY) m_pclose (); return exitstat; } static void mhl_format (char *file, int length, int width) { int i; char *bp, *cp, **ip; char *ap, buffer[BUFSIZ], name[NAMESZ]; struct mcomp *c1; struct stat st; FILE *fp; static dev_t dev = 0; static ino_t ino = 0; static time_t mtime = 0; if (fmthd != NULL) { if (stat (etcpath (file), &st) != NOTOK && mtime == st.st_mtime && dev == st.st_dev && ino == st.st_ino) goto out; else free_queue (&fmthd, &fmttl); } if ((fp = fopen (etcpath (file), "r")) == NULL) adios (file, "unable to open format file"); if (fstat (fileno (fp), &st) != NOTOK) { mtime = st.st_mtime; dev = st.st_dev; ino = st.st_ino; } global.c_ovtxt = global.c_nfs = NULL; global.c_fmt = NULL; global.c_offset = 0; global.c_ovoff = -1; if ((i = sc_width ()) > 5) global.c_width = i; global.c_cwidth = -1; if ((i = sc_length ()) > 5) global.c_length = i - 1; global.c_flags = BELL; /* BELL is default */ *(ip = ignores) = NULL; while (vfgets (fp, &ap) == OK) { bp = ap; if (*bp == ';') continue; if ((cp = strchr(bp, '\n'))) *cp = 0; if (*bp == ':') { c1 = add_queue (&fmthd, &fmttl, NULL, bp + 1, CLEARTEXT); continue; } parptr = bp; strncpy (name, parse(), sizeof(name)); switch (*parptr) { case '\0': case ',': case '=': /* * Split this list of fields to ignore, and copy * it to the end of the current "ignores" list. */ if (!mh_strcasecmp (name, "ignores")) { char **tmparray, **p; int n = 0; /* split the fields */ tmparray = brkstring (getcpy (++parptr), ",", NULL); /* count number of fields split */ p = tmparray; while (*p++) n++; /* copy pointers to split fields to ignores array */ ip = copyip (tmparray, ip, MAXARGS - num_ignores); num_ignores += n; continue; } parptr = bp; while (*parptr) { if (evalvar (&global)) adios (NULL, "format file syntax error: %s", bp); if (*parptr) parptr++; } continue; case ':': c1 = add_queue (&fmthd, &fmttl, name, NULL, INIT); while (*parptr == ':' || *parptr == ',') { parptr++; if (evalvar (c1)) adios (NULL, "format file syntax error: %s", bp); } if (!c1->c_nfs && global.c_nfs) { if (c1->c_flags & DATEFMT) { if (global.c_flags & DATEFMT) c1->c_nfs = getcpy (global.c_nfs); } else if (c1->c_flags & ADDRFMT) { if (global.c_flags & ADDRFMT) c1->c_nfs = getcpy (global.c_nfs); } } continue; default: adios (NULL, "format file syntax error: %s", bp); } } fclose (fp); if (mhldebug) { for (c1 = fmthd; c1; c1 = c1->c_next) { fprintf (stderr, "c1: name=\"%s\" text=\"%s\" ovtxt=\"%s\"\n", c1->c_name, c1->c_text, c1->c_ovtxt); fprintf (stderr, "\tnfs=0x%x fmt=0x%x\n", (unsigned int)(unsigned long) c1->c_nfs, (unsigned int)(unsigned long) c1->c_fmt); fprintf (stderr, "\toffset=%d ovoff=%d width=%d cwidth=%d length=%d\n", c1->c_offset, c1->c_ovoff, c1->c_width, c1->c_cwidth, c1->c_length); fprintf (stderr, "\tflags=%s\n", snprintb (buffer, sizeof(buffer), (unsigned) c1->c_flags, LBITS)); } } out: if (clearflg == 1) { global.c_flags |= CLEARSCR; } else { if (clearflg == -1) global.c_flags &= ~CLEARSCR; } switch (bellflg) { /* command line may override format file */ case 1: global.c_flags |= BELL; break; case -1: global.c_flags &= ~BELL; break; } if (length) global.c_length = length; if (width) global.c_width = width; if (global.c_length < 5) global.c_length = 10000; if (global.c_width < 5) global.c_width = 10000; } static int evalvar (struct mcomp *c1) { char *cp, name[NAMESZ]; struct triple *ap; if (!*parptr) return 0; strncpy (name, parse(), sizeof(name)); if (!mh_strcasecmp (name, "component")) { if (ptos (name, &c1->c_text)) return 1; c1->c_flags &= ~NOCOMPONENT; return 0; } if (!mh_strcasecmp (name, "overflowtext")) return ptos (name, &c1->c_ovtxt); if (!mh_strcasecmp (name, "formatfield")) { char *nfs; if (ptos (name, &cp)) return 1; nfs = new_fs (NULL, NULL, cp); c1->c_nfs = getcpy (nfs); c1->c_flags |= FORMAT; return 0; } if (!mh_strcasecmp (name, "decode")) { char *nfs; nfs = new_fs (NULL, NULL, "%(decode{text})"); c1->c_nfs = getcpy (nfs); c1->c_flags |= FORMAT; return 0; } if (!mh_strcasecmp (name, "offset")) return ptoi (name, &c1->c_offset); if (!mh_strcasecmp (name, "overflowoffset")) return ptoi (name, &c1->c_ovoff); if (!mh_strcasecmp (name, "width")) return ptoi (name, &c1->c_width); if (!mh_strcasecmp (name, "compwidth")) return ptoi (name, &c1->c_cwidth); if (!mh_strcasecmp (name, "length")) return ptoi (name, &c1->c_length); if (!mh_strcasecmp (name, "nodashstuffing")) return (dashstuff = -1); for (ap = triples; ap->t_name; ap++) if (!mh_strcasecmp (ap->t_name, name)) { c1->c_flags |= ap->t_on; c1->c_flags &= ~ap->t_off; return 0; } if (!mh_strcasecmp (name, "formatarg")) { char *nfs; int rc; if (ptos (name, &cp)) return 1; nfs = new_fs (NULL, NULL, cp); rc = compileargs(c1, nfs); return rc; } return 1; } static int ptoi (char *name, int *i) { char *cp; if (*parptr++ != '=' || !*(cp = parse ())) { advise (NULL, "missing argument to variable %s", name); return 1; } *i = atoi (cp); return 0; } static int ptos (char *name, char **s) { char c, *cp; if (*parptr++ != '=') { advise (NULL, "missing argument to variable %s", name); return 1; } if (*parptr != '"') { for (cp = parptr; *parptr && *parptr != ':' && *parptr != ','; parptr++) continue; } else { for (cp = ++parptr; *parptr && *parptr != '"'; parptr++) if (*parptr == QUOTE) if (!*++parptr) parptr--; } c = *parptr; *parptr = 0; *s = getcpy (cp); if ((*parptr = c) == '"') parptr++; return 0; } static char * parse (void) { int c; char *cp; static char result[NAMESZ]; for (cp = result; *parptr && (cp - result < NAMESZ); parptr++) { c = *parptr; if (isalnum (c) || c == '.' || c == '-' || c == '_' || c =='[' || c == ']') *cp++ = c; else break; } *cp = '\0'; return result; } static void process (char *folder, char *fname, int ofilen, int ofilec) { char *cp = NULL; FILE *fp = NULL; struct mcomp *c1; struct stat st; switch (setjmp (env)) { case OK: if (fname) { fp = mhl_action ? (*mhl_action) (fname) : fopen (fname, "r"); if (fp == NULL) { advise (fname, "unable to open"); exitstat++; return; } } else { fname = "(stdin)"; fp = stdin; } if (fstat(fileno(fp), &st) == 0) { filesize = st.st_size; } else { filesize = 0; } cp = folder ? concat (folder, ":", fname, NULL) : getcpy (fname); if (ontty != PITTY) SIGNAL (SIGINT, intrser); mhlfile (fp, cp, ofilen, ofilec); /* FALL THROUGH! */ default: if (ontty != PITTY) SIGNAL (SIGINT, SIG_IGN); if (mhl_action == NULL && fp != stdin) fclose (fp); free (cp); if (holder.c_text) { free (holder.c_text); holder.c_text = NULL; } free_queue (&msghd, &msgtl); for (c1 = fmthd; c1; c1 = c1->c_next) c1->c_flags &= ~HDROUTPUT; break; } freecomptext(); } static void mhlfile (FILE *fp, char *mname, int ofilen, int ofilec) { int state, bucket; struct mcomp *c1, *c2, *c3; char **ip, name[NAMESZ], buf[BUFSIZ]; if (forwall) { if (digest) printf ("%s", ofilen == 1 ? delim3 : delim4); else { printf ("\n-------"); if (ofilen == 1) printf (" Forwarded Message%s", ofilec > 1 ? "s" : ""); else printf (" Message %d", ofilen); printf ("\n\n"); } } else { switch (ontty) { case PITTY: if (ofilec > 1) { if (ofilen > 1) { if ((global.c_flags & CLEARSCR)) clear_screen (); else printf ("\n\n\n"); } printf (">>> %s\n\n", mname); } break; case ISTTY: strncpy (buf, "\n", sizeof(buf)); if (ofilec > 1) { if (SOprintf ("Press to list \"%s\"...", mname)) { if (ofilen > 1) printf ("\n\n\n"); printf ("Press to list \"%s\"...", mname); } fflush (stdout); buf[0] = 0; read (fileno (stdout), buf, sizeof(buf)); } if (strchr(buf, '\n')) { if ((global.c_flags & CLEARSCR)) clear_screen (); } else printf ("\n"); break; default: if (ofilec > 1) { if (ofilen > 1) { printf ("\n\n\n"); if (clearflg > 0) clear_screen (); } printf (">>> %s\n\n", mname); } break; } } for (state = FLD;;) { switch (state = m_getfld (state, name, buf, sizeof(buf), fp)) { case FLD: case FLDPLUS: bucket = checkcomp(name, buf); for (ip = ignores; *ip; ip++) if (!mh_strcasecmp (name, *ip)) { while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), fp); addcomp(bucket, name, buf); } break; } if (*ip) continue; for (c2 = fmthd; c2; c2 = c2->c_next) if (!mh_strcasecmp (c2->c_name, name)) break; c1 = NULL; if (!((c3 = c2 ? c2 : &global)->c_flags & SPLIT)) for (c1 = msghd; c1; c1 = c1->c_next) if (!mh_strcasecmp (c1->c_name, c3->c_name)) { c1->c_text = mcomp_add (c1->c_flags, buf, c1->c_text); break; } if (c1 == NULL) c1 = add_queue (&msghd, &msgtl, name, buf, 0); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), fp); c1->c_text = add (buf, c1->c_text); addcomp(bucket, name, buf); } if (c2 == NULL) c1->c_flags |= EXTRA; continue; case BODY: case FILEEOF: row = column = 0; for (c1 = fmthd; c1; c1 = c1->c_next) { if (c1->c_flags & CLEARTEXT) { putcomp (c1, c1, ONECOMP); continue; } if (!mh_strcasecmp (c1->c_name, "messagename")) { holder.c_text = concat ("(Message ", mname, ")\n", NULL); putcomp (c1, &holder, ONECOMP); free (holder.c_text); holder.c_text = NULL; continue; } if (!mh_strcasecmp (c1->c_name, "extras")) { for (c2 = msghd; c2; c2 = c2->c_next) if (c2->c_flags & EXTRA) putcomp (c1, c2, TWOCOMP); continue; } if (dobody && !mh_strcasecmp (c1->c_name, "body")) { if (c1->c_flags & FMTFILTER && state == BODY && formatproc != NULL) { filterbody(c1, buf, sizeof(buf), state, fp); } else { holder.c_text = mh_xmalloc (sizeof(buf)); strncpy (holder.c_text, buf, sizeof(buf)); while (state == BODY) { putcomp (c1, &holder, BODYCOMP); state = m_getfld (state, name, holder.c_text, sizeof(buf), fp); } free (holder.c_text); holder.c_text = NULL; } continue; } for (c2 = msghd; c2; c2 = c2->c_next) if (!mh_strcasecmp (c2->c_name, c1->c_name)) { putcomp (c1, c2, ONECOMP); if (!(c1->c_flags & SPLIT)) break; } if (faceproc && c2 == NULL && (c1->c_flags & FACEFMT)) for (c2 = msghd; c2; c2 = c2->c_next) if (c2->c_flags & FACEDFLT) { if (c2->c_face == NULL) face_format (c2); if ((holder.c_text = c2->c_face)) { putcomp (c1, &holder, ONECOMP); holder.c_text = NULL; } break; } } return; case LENERR: case FMTERR: advise (NULL, "format error in message %s", mname); exitstat++; return; default: adios (NULL, "getfld() returned %d", state); } } } static int mcomp_flags (char *name) { struct pair *ap; for (ap = pairs; ap->p_name; ap++) if (!mh_strcasecmp (ap->p_name, name)) return (ap->p_flags); return 0; } static char * mcomp_add (long flags, char *s1, char *s2) { char *dp; if (!(flags & ADDRFMT)) return add (s1, s2); if (s2 && *(dp = s2 + strlen (s2) - 1) == '\n') *dp = 0; return add (s1, add (",\n", s2)); } struct pqpair { char *pq_text; char *pq_error; struct pqpair *pq_next; }; static void mcomp_format (struct mcomp *c1, struct mcomp *c2) { int dat[5]; char *ap, *cp; char buffer[BUFSIZ], error[BUFSIZ]; struct comp *cptr; struct pqpair *p, *q; struct pqpair pq; struct mailname *mp; ap = c2->c_text; c2->c_text = NULL; dat[0] = 0; dat[1] = 0; dat[2] = filesize; dat[3] = sizeof(buffer) - 1; dat[4] = 0; fmt_compile (c1->c_nfs, &c1->c_fmt); if (!(c1->c_flags & ADDRFMT)) { FINDCOMP (cptr, "text"); if (cptr) cptr->c_text = ap; if ((cp = strrchr(ap, '\n'))) /* drop ending newline */ if (!cp[1]) *cp = 0; fmt_scan (c1->c_fmt, buffer, sizeof(buffer) - 1, dat); /* Don't need to append a newline, dctime() already did */ c2->c_text = getcpy (buffer); free (ap); return; } (q = &pq)->pq_next = NULL; while ((cp = getname (ap))) { if ((p = (struct pqpair *) calloc ((size_t) 1, sizeof(*p))) == NULL) adios (NULL, "unable to allocate pqpair memory"); if ((mp = getm (cp, NULL, 0, AD_NAME, error)) == NULL) { p->pq_text = getcpy (cp); p->pq_error = getcpy (error); } else { if ((c1->c_flags & FACEDFLT) && c2->c_face == NULL) { char *h = mp->m_host ? mp->m_host : LocalName (0); c2->c_face = concat ("address ", h, " ", mp->m_mbox, NULL); } p->pq_text = getcpy (mp->m_text); mnfree (mp); } q = (q->pq_next = p); } for (p = pq.pq_next; p; p = q) { FINDCOMP (cptr, "text"); if (cptr) cptr->c_text = p->pq_text; FINDCOMP (cptr, "error"); if (cptr) cptr->c_text = p->pq_error; fmt_scan (c1->c_fmt, buffer, sizeof(buffer) - 1, dat); if (*buffer) { if (c2->c_text) c2->c_text = add (",\n", c2->c_text); if (*(cp = buffer + strlen (buffer) - 1) == '\n') *cp = 0; c2->c_text = add (buffer, c2->c_text); } free (p->pq_text); if (p->pq_error) free (p->pq_error); q = p->pq_next; free ((char *) p); } c2->c_text = add ("\n", c2->c_text); free (ap); } static struct mcomp * add_queue (struct mcomp **head, struct mcomp **tail, char *name, char *text, int flags) { struct mcomp *c1; if ((c1 = (struct mcomp *) calloc ((size_t) 1, sizeof(*c1))) == NULL) adios (NULL, "unable to allocate comp memory"); c1->c_flags = flags & ~INIT; if ((c1->c_name = name ? getcpy (name) : NULL)) c1->c_flags |= mcomp_flags (c1->c_name); c1->c_text = text ? getcpy (text) : NULL; if (flags & INIT) { if (global.c_ovtxt) c1->c_ovtxt = getcpy (global.c_ovtxt); c1->c_offset = global.c_offset; c1->c_ovoff = global. c_ovoff; c1->c_width = c1->c_length = 0; c1->c_cwidth = global.c_cwidth; c1->c_flags |= global.c_flags & GFLAGS; } if (*head == NULL) *head = c1; if (*tail != NULL) (*tail)->c_next = c1; *tail = c1; return c1; } static void free_queue (struct mcomp **head, struct mcomp **tail) { struct mcomp *c1, *c2; for (c1 = *head; c1; c1 = c2) { c2 = c1->c_next; if (c1->c_name) free (c1->c_name); if (c1->c_text) free (c1->c_text); if (c1->c_ovtxt) free (c1->c_ovtxt); if (c1->c_nfs) free (c1->c_nfs); if (c1->c_fmt) free ((char *) c1->c_fmt); if (c1->c_face) free (c1->c_face); if (c1->c_f_args) { struct arglist *a1, *a2; for (a1 = c1->c_f_args; a1; a1 = a2) { a2 = a1->a_next; if (a1->a_fmt) free(a1->a_fmt); if (a1->a_nfs) free(a1->a_nfs); } free(a1); } free ((char *) c1); } *head = *tail = NULL; } static void putcomp (struct mcomp *c1, struct mcomp *c2, int flag) { int count, cchdr; unsigned char *cp; cchdr = 0; lm = 0; llim = c1->c_length ? c1->c_length : -1; wid = c1->c_width ? c1->c_width : global.c_width; ovoff = (c1->c_ovoff >= 0 ? c1->c_ovoff : global.c_ovoff) + c1->c_offset; if ((ovtxt = c1->c_ovtxt ? c1->c_ovtxt : global.c_ovtxt) == NULL) ovtxt = ""; if (wid < ovoff + strlen (ovtxt) + 5) adios (NULL, "component: %s width(%d) too small for overflow(%d)", c1->c_name, wid, ovoff + strlen (ovtxt) + 5); onelp = NULL; if (c1->c_flags & CLEARTEXT) { putstr (c1->c_text, c1->c_flags); putstr ("\n", c1->c_flags); return; } if (c1->c_flags & FACEFMT) switch (doface (c2)) { case NOTOK: /* error */ case OK: /* async faceproc */ return; default: /* sync faceproc */ break; } if (c1->c_nfs && (c1->c_flags & (ADDRFMT | DATEFMT | FORMAT))) mcomp_format (c1, c2); if (c1->c_flags & CENTER) { count = (c1->c_width ? c1->c_width : global.c_width) - c1->c_offset - strlen (c2->c_text); if (!(c1->c_flags & HDROUTPUT) && !(c1->c_flags & NOCOMPONENT)) count -= strlen (c1->c_text ? c1->c_text : c1->c_name) + 2; lm = c1->c_offset + (count / 2); } else { if (c1->c_offset) lm = c1->c_offset; } if (!(c1->c_flags & HDROUTPUT) && !(c1->c_flags & NOCOMPONENT)) { if (c1->c_flags & UPPERCASE) /* uppercase component also */ for (cp = (c1->c_text ? c1->c_text : c1->c_name); *cp; cp++) if (islower (*cp)) *cp = toupper (*cp); putstr (c1->c_text ? c1->c_text : c1->c_name, c1->c_flags); if (flag != BODYCOMP) { putstr (": ", c1->c_flags); if (!(c1->c_flags & SPLIT)) c1->c_flags |= HDROUTPUT; cchdr++; if ((count = c1->c_cwidth - strlen (c1->c_text ? c1->c_text : c1->c_name) - 2) > 0) while (count--) putstr (" ", c1->c_flags); } else c1->c_flags |= HDROUTPUT; /* for BODYCOMP */ } if (flag == TWOCOMP && !(c2->c_flags & HDROUTPUT) && !(c2->c_flags & NOCOMPONENT)) { if (c1->c_flags & UPPERCASE) for (cp = c2->c_name; *cp; cp++) if (islower (*cp)) *cp = toupper (*cp); putstr (c2->c_name, c1->c_flags); putstr (": ", c1->c_flags); if (!(c1->c_flags & SPLIT)) c2->c_flags |= HDROUTPUT; cchdr++; if ((count = c1->c_cwidth - strlen (c2->c_name) - 2) > 0) while (count--) putstr (" ", c1->c_flags); } if (c1->c_flags & UPPERCASE) for (cp = c2->c_text; *cp; cp++) if (islower (*cp)) *cp = toupper (*cp); count = 0; if (cchdr) { if (flag == TWOCOMP) count = (c1->c_cwidth >= 0) ? c1->c_cwidth : (int) strlen (c2->c_name) + 2; else count = (c1->c_cwidth >= 0) ? (size_t) c1->c_cwidth : strlen (c1->c_text ? c1->c_text : c1->c_name) + 2; } count += c1->c_offset; if ((cp = oneline (c2->c_text, c1->c_flags))) putstr(cp, c1->c_flags); if (term == '\n') putstr ("\n", c1->c_flags); while ((cp = oneline (c2->c_text, c1->c_flags))) { lm = count; if (flag == BODYCOMP && !(c1->c_flags & NOCOMPONENT)) putstr (c1->c_text ? c1->c_text : c1->c_name, c1->c_flags); if (*cp) putstr (cp, c1->c_flags); if (term == '\n') putstr ("\n", c1->c_flags); } if (flag == BODYCOMP && term == '\n') c1->c_flags &= ~HDROUTPUT; /* Buffer ended on a newline */ } static char * oneline (char *stuff, long flags) { int spc; char *cp, *ret; if (onelp == NULL) onelp = stuff; if (*onelp == 0) return (onelp = NULL); ret = onelp; term = 0; if (flags & COMPRESS) { for (spc = 1, cp = ret; *onelp; onelp++) if (isspace (*onelp)) { if (*onelp == '\n' && (!onelp[1] || (flags & ADDRFMT))) { term = '\n'; *onelp++ = 0; break; } else if (!spc) { *cp++ = ' '; spc++; } } else { *cp++ = *onelp; spc = 0; } *cp = 0; } else { while (*onelp && *onelp != '\n') onelp++; if (*onelp == '\n') { term = '\n'; *onelp++ = 0; } if (flags & LEFTADJUST) while (*ret == ' ' || *ret == '\t') ret++; } if (*onelp == 0 && term == '\n' && (flags & NONEWLINE)) term = 0; return ret; } static void putstr (char *string, long flags) { if (!column && lm > 0) { while (lm > 0) if (lm >= 8) { putch ('\t', flags); lm -= 8; } else { putch (' ', flags); lm--; } } lm = 0; while (*string) putch (*string++, flags); } static void putch (char ch, long flags) { char buf[BUFSIZ]; if (llim == 0) return; switch (ch) { case '\n': if (llim > 0) llim--; column = 0; row++; if (ontty != ISTTY || row != global.c_length) break; if (global.c_flags & BELL) putchar ('\007'); fflush (stdout); buf[0] = 0; read (fileno (stdout), buf, sizeof(buf)); if (strchr(buf, '\n')) { if (global.c_flags & CLEARSCR) clear_screen (); row = 0; } else { putchar ('\n'); row = global.c_length / 3; } return; case '\t': column |= 07; column++; break; case '\b': column--; break; case '\r': column = 0; break; default: /* * If we are forwarding this message, and the first * column contains a dash, then add a dash and a space. */ if (column == 0 && forwflg && (dashstuff >= 0) && ch == '-') { putchar ('-'); putchar (' '); } if (ch >= ' ') column++; break; } if (column >= wid && (flags & NOWRAP) == 0) { putch ('\n', flags); if (ovoff > 0) lm = ovoff; putstr (ovtxt ? ovtxt : "", flags); putch (ch, flags); return; } putchar (ch); } static void intrser (int i) { NMH_UNUSED (i); discard (stdout); putchar ('\n'); longjmp (env, DONE); } static void pipeser (int i) { NMH_UNUSED (i); done (NOTOK); } static void quitser (int i) { NMH_UNUSED (i); putchar ('\n'); fflush (stdout); done (NOTOK); } static void face_format (struct mcomp *c1) { char *cp; struct mailname *mp; if ((cp = c1->c_text) == NULL) return; if ((cp = getname (cp))) { if ((mp = getm (cp, NULL, 0, AD_NAME, NULL))) { char *h = mp->m_host ? mp->m_host : LocalName (0); c1->c_face = concat ("address ", h, " ", mp->m_mbox, NULL); } while ((cp = getname (cp))) continue; } } /* * faceproc is two elements defining the image agent's location: * Internet host * UDP port */ #include #include #include #include static int doface (struct mcomp *c1) { int result, sd; static int inited = OK; static struct sockaddr_storage ss; static socklen_t socklen; static int socktype; static int protocol; if (inited == OK) { char *cp; char **ap = brkstring (cp = getcpy (faceproc), " ", "\n"); struct addrinfo hints, *res; if (ap[0] == NULL || ap[1] == NULL) { bad_faceproc: ; free (cp); return (inited = NOTOK); } memset(&hints, 0, sizeof(hints)); #ifdef AI_ADDRCONFIG hints.ai_flags = AI_ADDRCONFIG; #endif hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; if (getaddrinfo(ap[0], ap[1], &hints, &res) != 0) goto bad_faceproc; memcpy(&ss, res->ai_addr, res->ai_addrlen); socklen = res->ai_addrlen; socktype = res->ai_socktype; protocol = res->ai_protocol; freeaddrinfo(res); inited = DONE; } if (inited == NOTOK) return NOTOK; if ((sd = socket (ss.ss_family, socktype, protocol)) == NOTOK) return NOTOK; result = sendto (sd, c1->c_text, strlen (c1->c_text), 0, (struct sockaddr *) &ss, socklen); close (sd); return (result != NOTOK ? OK : NOTOK); } /* * COMMENTED OUT * This version doesn't use sockets */ #if 0 static int doface (struct mcomp *c1) { int i, len, vecp; pid_t child_id; int result, pdi[2], pdo[2]; char *bp, *cp; char buffer[BUFSIZ], *vec[10]; if (pipe (pdi) == NOTOK) return NOTOK; if (pipe (pdo) == NOTOK) { close (pdi[0]); close (pdi[1]); return NOTOK; } for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: /* oops... fork error */ return NOTOK; case OK: /* child process */ SIGNAL (SIGINT, SIG_IGN); SIGNAL (SIGQUIT, SIG_IGN); if (pdi[0] != fileno (stdin)) { dup2 (pdi[0], fileno (stdin)); close (pdi[0]); } close (pdi[1]); close (pdo[0]); if (pdo[1] != fileno (stdout)) { dup2 (pdo[1], fileno (stdout)); close (pdo[1]); } vecp = 0; vec[vecp++] = r1bindex (faceproc, '/'); vec[vecp++] = "-e"; if (sleepsw != NOTOK) { vec[vecp++] = "-s"; snprintf (buffer, sizeof(buffer), "%d", sleepsw); vec[vecp++] = buffer; } vec[vecp] = NULL; execvp (faceproc, vec); fprintf (stderr, "unable to exec "); perror (faceproc); _exit (-1); /* NOTREACHED */ default: /* parent process */ close (pdi[0]); i = strlen (c1->c_text); if (write (pdi[1], c1->c_text, i) != i) adios ("pipe", "error writing to"); free (c1->c_text), c1->c_text = NULL; close (pdi[1]); close (pdo[1]); cp = NULL, len = 0; result = DONE; while ((i = read (pdo[0], buffer, strlen (buffer))) > 0) { if (cp) { int j; char *dp; dp = mh_xrealloc (cp, (unsigned) (j = len + i)); memcpy(dp + len, buffer, i); cp = dp, len = j; } else { cp = mh_xmalloc ((unsigned) i); memcpy(cp, buffer, i); len = i; } if (result == DONE) for (bp = buffer + i - 1; bp >= buffer; bp--) if (!isascii (*bp) || iscntrl (*bp)) { result = OK; break; } } close (pdo[0]); /* no waiting for child... */ if (result == OK) { /* binary */ if (write (1, cp, len) != len) adios ("writing", "error"); free (cp); } else /* empty */ if ((c1->c_text = cp) == NULL) result = OK; break; } return result; } #endif /* COMMENTED OUT */ int mhlsbr (int argc, char **argv, FILE *(*action)()) { SIGNAL_HANDLER istat = NULL, pstat = NULL, qstat = NULL; char *cp = NULL; struct mcomp *c1; switch (setjmp (mhlenv)) { case OK: cp = invo_name; sleepsw = 0; /* XXX */ bellflg = clearflg = forwflg = forwall = exitstat = 0; digest = NULL; ontty = NOTTY; mhl_action = action; /* * If signal is at default action, then start ignoring * it, else let it set to its current action. */ if ((istat = SIGNAL (SIGINT, SIG_IGN)) != SIG_DFL) SIGNAL (SIGINT, istat); if ((qstat = SIGNAL (SIGQUIT, SIG_IGN)) != SIG_DFL) SIGNAL (SIGQUIT, qstat); pstat = SIGNAL (SIGPIPE, pipeser); mhl (argc, argv); /* FALL THROUGH! */ default: SIGNAL (SIGINT, istat); SIGNAL (SIGQUIT, qstat); SIGNAL (SIGPIPE, SIG_IGN);/* should probably change to block instead */ if (ontty == PITTY) m_pclose (); SIGNAL (SIGPIPE, pstat); invo_name = cp; if (holder.c_text) { free (holder.c_text); holder.c_text = NULL; } free_queue (&msghd, &msgtl); for (c1 = fmthd; c1; c1 = c1->c_next) c1->c_flags &= ~HDROUTPUT; return exitstat; } } #undef adios #undef done static void mhladios (char *what, char *fmt, ...) { va_list ap; va_start(ap, fmt); advertise (what, NULL, fmt, ap); va_end(ap); mhldone (1); } static void mhldone (int status) { exitstat = status; if (mhl_action) longjmp (mhlenv, DONE); else done (exitstat); } static int m_pid = NOTOK; static int sd = NOTOK; static void m_popen (char *name) { int pd[2]; if (mhl_action && (sd = dup (fileno (stdout))) == NOTOK) adios ("standard output", "unable to dup()"); if (pipe (pd) == NOTOK) adios ("pipe", "unable to"); switch (m_pid = vfork()) { case NOTOK: adios ("fork", "unable to"); case OK: SIGNAL (SIGINT, SIG_DFL); SIGNAL (SIGQUIT, SIG_DFL); close (pd[1]); if (pd[0] != fileno (stdin)) { dup2 (pd[0], fileno (stdin)); close (pd[0]); } execlp (name, r1bindex (name, '/'), NULL); fprintf (stderr, "unable to exec "); perror (name); _exit (-1); default: close (pd[0]); if (pd[1] != fileno (stdout)) { dup2 (pd[1], fileno (stdout)); close (pd[1]); } } } void m_pclose (void) { if (m_pid == NOTOK) return; if (sd != NOTOK) { fflush (stdout); if (dup2 (sd, fileno (stdout)) == NOTOK) adios ("standard output", "unable to dup2()"); clearerr (stdout); close (sd); sd = NOTOK; } else fclose (stdout); pidwait (m_pid, OK); m_pid = NOTOK; } /* * Compile a format string and add it to the list of arguments used by * the formatproc. * * This deserves some explanation. Here's the deal: * * We want to keep track of components used as arguments by formatproc, * but the hash table is reset every time fmt_compile is called. So we * iterate through the function list looking for things that use components * and save the name. And because we might get the same components used * by different arguments we need to keep track to every reference of * every component so we can add them when the message is processed. So * we compile the argument string now (to get the components we use) and * save them for later. */ static int compileargs (struct mcomp *c1, char *nfs) { struct format *fmt; struct arglist *args; char **ap; struct comp *cptr; unsigned int i; i = fmt_compile(nfs, &fmt); /* * Search through and mark any components that are address components */ for (ap = addrcomps; *ap; ap++) { FINDCOMP (cptr, *ap); if (cptr) cptr->c_type |= CT_ADDR; } args = (struct arglist *) mh_xmalloc(sizeof(struct arglist)); if (! args) adios (NULL, "Unable to allocate formatproc args storage"); args->a_fmt = fmt; args->a_nfs = format_string; args->a_next = NULL; c1->c_nargs++; format_string = NULL; if (c1->c_f_tail) c1->c_f_tail->a_next = args; c1->c_f_tail = args; if (! c1->c_f_args) c1->c_f_args = args; if (i == 0) return 0; /* * If wantcomp ever changes size, we need to change the size * of mhlcomp as well */ for (i = 0; i < sizeof(wantcomp)/sizeof(wantcomp[0]); i++) { if (wantcomp[i]) { if (mhlcomp[i]) { struct comp *c; for (c = mhlcomp[i]; c->c_next != NULL; c = c->c_next) ; c->c_next = wantcomp[i]; } else mhlcomp[i] = wantcomp[i]; } } return 0; } /* * Check to see if we are interested in a component. If we are, save * the text. */ static int checkcomp(char *name, char *buf) { int found = 0, i; struct comp *c; int bucket = CHASH(name); char *cp; if ((c = mhlcomp[bucket])) { do { if (mh_strcasecmp(name, c->c_name) == 0) { found++; if (! c->c_text) { c->c_text = strdup(buf); } else { i = strlen(cp = c->c_text) - 1; if (cp[i] == '\n') { if (c->c_type & CT_ADDR) { cp[i] = '\0'; cp = add (",\n\t", cp); } else { cp = add ("\t", cp); } } c->c_text = add (buf, cp); } } } while ((c = c->c_next)); } return found ? bucket : -1; } /* * Add text to an existing component */ static void addcomp(int bucket, char *name, char *buf) { struct comp *c; if (bucket != -1) { c = mhlcomp[bucket]; do { if (mh_strcasecmp(name, c->c_name) == 0) c->c_text = add (buf, c->c_text); } while ((c = c->c_next)); } } /* * Free up saved component structures */ static void freecomps(void) { struct comp *c1, *c2; unsigned int i; for (i = 0; i < sizeof(mhlcomp)/sizeof(mhlcomp[0]); i++) { if ((c1 = mhlcomp[i])) for (; c1; c1 = c2) { c2 = c1->c_next; if (c1->c_text) free(c1->c_text); free(c1); } } } /* * Just free up the component text. */ static void freecomptext(void) { struct comp *c1; unsigned int i; for (i = 0; i < sizeof(mhlcomp)/sizeof(mhlcomp[0]); i++) { if ((c1 = mhlcomp[i])) for (; c1; c1 = c1->c_next) { if (c1->c_text) { free(c1->c_text); c1->c_text = NULL; } } } } /* * Filter the body of a message through a specified format program */ static void filterbody (struct mcomp *c1, char *buf, int bufsz, int state, FILE *fp) { struct mcomp holder; char name[NAMESZ]; int fdinput[2], fdoutput[2], waitstat; ssize_t cc; pid_t writerpid, filterpid; /* * Create pipes so we can communicate with our filter process. */ if (pipe(fdinput) < 0) { adios(NULL, "Unable to create input pipe"); } if (pipe(fdoutput) < 0) { adios(NULL, "Unable to create output pipe"); } /* * Here's what we're doing to do. * * - Fork ourselves and start writing data to the write side of the * input pipe (fdinput[1]). * * - Fork and exec our filter program. We set the standard input of * our filter program to be the read side of our input pipe (fdinput[0]). * Standard output is set to the write side of our output pipe * (fdoutput[1]). * * - We read from the read side of the output pipe (fdoutput[0]). * * We're forking because that's the simplest way to prevent any deadlocks. * (without doing something like switching to non-blocking I/O and using * select or poll, and I'm not interested in doing that). */ switch (writerpid = fork()) { case 0: /* * Our child process - just write to the filter input (fdinput[1]). * Close all other descriptors that we don't need. */ close(fdinput[0]); close(fdoutput[0]); close(fdoutput[1]); /* * Call m_getfld() until we're no longer in the BODY state */ while (state == BODY) { write(fdinput[1], buf, strlen(buf)); state = m_getfld(state, name, buf, bufsz, fp); } /* * We should be done; time to exit. */ close(fdinput[1]); /* * Make sure we call _exit(), otherwise we may flush out the stdio * buffers that we have duplicated from the parent. */ _exit(0); break; case -1: adios(NULL, "Unable to fork for filter writer process"); break; } /* * Fork and exec() our filter program, after redirecting standard in * and standard out appropriately. */ switch (filterpid = fork()) { char **args; struct arglist *a; int i, dat[5], s; case 0: /* * Allocate an argument array for us */ args = (char **) mh_xmalloc((c1->c_nargs + 2) * sizeof(char *)); args[0] = formatproc; args[c1->c_nargs + 1] = NULL; dat[0] = 0; dat[1] = 0; dat[2] = 0; dat[3] = BUFSIZ; dat[4] = 0; /* * Pull out each argument and scan them. */ for (a = c1->c_f_args, i = 1; a != NULL; a = a->a_next, i++) { args[i] = mh_xmalloc(BUFSIZ); fmt_scan(a->a_fmt, args[i], BUFSIZ, dat); /* * fmt_scan likes to put a trailing newline at the end of the * format string. If we have one, get rid of it. */ s = strlen(args[i]); if (args[i][s - 1] == '\n') args[i][s - 1] = '\0'; } if (dup2(fdinput[0], STDIN_FILENO) < 0) { adios("formatproc", "Unable to dup2() standard input"); } if (dup2(fdoutput[1], STDOUT_FILENO) < 0) { adios("formatproc", "Unable to dup2() standard output"); } /* * Close everything (especially the old input and output * descriptors, since they've been dup'd to stdin and stdout), * and exec the formatproc. */ close(fdinput[0]); close(fdinput[1]); close(fdoutput[0]); close(fdoutput[1]); execvp(formatproc, args); adios(formatproc, "Unable to execute filter"); break; case -1: adios(NULL, "Unable to fork format program"); } /* * Close everything except our reader (fdoutput[0]); */ close(fdinput[0]); close(fdinput[1]); close(fdoutput[1]); /* * As we read in this data, send it to putcomp */ holder.c_text = buf; while ((cc = read(fdoutput[0], buf, bufsz - 1)) > 0) { buf[cc] = '\0'; putcomp(c1, &holder, BODYCOMP); } if (cc < 0) { adios(NULL, "reading from formatproc"); } /* * See if we got any errors along the way. I'm a little leery of calling * waitpid() without WNOHANG, but it seems to be the most correct solution. */ if (waitpid(filterpid, &waitstat, 0) < 0) { if (errno != ECHILD) { adios("filterproc", "Unable to determine status"); } } else { if (! (WIFEXITED(waitstat) && WEXITSTATUS(waitstat) == 0)) { pidstatus(waitstat, stderr, "filterproc"); } } if (waitpid(writerpid, &waitstat, 0) < 0) { if (errno != ECHILD) { adios("writer process", "Unable to determine status"); done(1); } } else { if (! (WIFEXITED(waitstat) && WEXITSTATUS(waitstat) == 0)) { pidstatus(waitstat, stderr, "writer process"); done(1); } } close(fdoutput[0]); } nmh-1.5/uip/mhmail.c000644 007761 000765 00000011310 11765267273 014316 0ustar00kenhkenh000000 000000 /* * mhmail.c -- simple mail program * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include static struct swit switches[] = { #define BODYSW 0 { "body text", 0 }, #define CCSW 1 { "cc addrs ...", 0 }, #define FROMSW 2 { "from addr", 0 }, #define SUBJSW 3 { "subject text", 0 }, #define VERSIONSW 4 { "version", 0 }, #define HELPSW 5 { "help", 0 }, #define RESNDSW 6 { "resent", -6 }, #define QUEUESW 7 { "queued", -6 }, { NULL, 0 } }; static char tmpfil[BUFSIZ]; /* * static prototypes */ static void intrser (int); int main (int argc, char **argv) { pid_t child_id; int status, iscc = 0, nvec; size_t i; int queued = 0, resent = 0, somebody; char *cp, *tolist = NULL, *cclist = NULL, *subject = NULL; char *from = NULL, *body = NULL, **argp, **arguments; char *vec[5], buf[BUFSIZ]; FILE *out; char *tfile = NULL; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* foil search of user profile/context */ if (context_foil (NULL) == -1) done (1); /* If no arguments, just incorporate new mail */ if (argc == 1) { execlp (incproc, r1bindex (incproc, '/'), NULL); adios (incproc, "unable to exec"); } arguments = getarguments (invo_name, argc, argv, 0); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [addrs ... [switches]]", invo_name); print_help (buf, switches, 0); done (1); case VERSIONSW: print_version(invo_name); done (1); case FROMSW: if (!(from = *argp++) || *from == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case BODYSW: if (!(body = *argp++) || *body == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case CCSW: iscc++; continue; case SUBJSW: if (!(subject = *argp++) || *subject == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case RESNDSW: resent++; continue; case QUEUESW: queued++; continue; } } if (iscc) cclist = cclist ? add (cp, add (", ", cclist)) : getcpy (cp); else tolist = tolist ? add (cp, add (", ", tolist)) : getcpy (cp); } if (tolist == NULL) adios (NULL, "usage: %s addrs ... [switches]", invo_name); tfile = m_mktemp2(NULL, invo_name, NULL, &out); if (tfile == NULL) adios("mhmail", "unable to create temporary file"); chmod(tfile, 0600); strncpy (tmpfil, tfile, sizeof(tmpfil)); SIGNAL2 (SIGINT, intrser); fprintf (out, "%sTo: %s\n", resent ? "Resent-" : "", tolist); if (cclist) fprintf (out, "%scc: %s\n", resent ? "Resent-" : "", cclist); if (subject) fprintf (out, "%sSubject: %s\n", resent ? "Resent-" : "", subject); if (from) fprintf (out, "%sFrom: %s\n", resent ? "Resent-" : "", from); if (!resent) fputs ("\n", out); if (body) { fprintf (out, "%s", body); if (*body && *(body + strlen (body) - 1) != '\n') fputs ("\n", out); } else { for (somebody = 0; (i = fread (buf, sizeof(*buf), sizeof(buf), stdin)) > 0; somebody++) if (fwrite (buf, sizeof(*buf), i, out) != i) adios (tmpfil, "error writing"); if (!somebody) { unlink (tmpfil); done (1); } } fclose (out); nvec = 0; vec[nvec++] = r1bindex (postproc, '/'); vec[nvec++] = tmpfil; if (resent) vec[nvec++] = "-dist"; if (queued) vec[nvec++] = "-queued"; vec[nvec] = NULL; for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); if (child_id == NOTOK) { /* report failure and then send it */ adios (NULL, "unable to fork"); } else if (child_id) { /* parent process */ if ((status = pidXwait(child_id, postproc))) { fprintf (stderr, "Letter saved in dead.letter\n"); execl ("/bin/mv", "mv", tmpfil, "dead.letter", NULL); execl ("/usr/bin/mv", "mv", tmpfil, "dead.letter", NULL); perror ("mv"); _exit (-1); } unlink (tmpfil); done (status ? 1 : 0); } else { /* child process */ execvp (postproc, vec); fprintf (stderr, "unable to exec "); perror (postproc); _exit (-1); } return 0; /* dead code to satisfy the compiler */ } static void intrser (int i) { unlink (tmpfil); done (i != 0 ? 1 : 0); } nmh-1.5/uip/mhmisc.c000644 007761 000765 00000010035 11762736347 014332 0ustar00kenhkenh000000 000000 /* * mhparse.c -- misc routines to process MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include extern int debugsw; /* * limit actions to specified parts or content types */ int npart = 0; int ntype = 0; char *parts[NPARTS + 1]; char *types[NTYPES + 1]; int endian = 0; /* little or big endian */ int userrs = 0; static char *errs = NULL; /* * prototypes */ int part_ok (CT, int); int type_ok (CT, int); void content_error (char *, CT, char *, ...); void flush_errors (void); int part_ok (CT ct, int sP) { char **ap; int len; if (npart == 0 || (ct->c_type == CT_MULTIPART && (sP || ct->c_subtype))) return 1; for (ap = parts; *ap; ap++) { len = strlen(*ap); if (!strncmp (*ap, ct->c_partno, len) && (!ct->c_partno[len] || ct->c_partno[len] == '.' )) return 1; } return 0; } int type_ok (CT ct, int sP) { char **ap; char buffer[BUFSIZ]; CI ci = &ct->c_ctinfo; if (ntype == 0 || (ct->c_type == CT_MULTIPART && (sP || ct->c_subtype))) return 1; snprintf (buffer, sizeof(buffer), "%s/%s", ci->ci_type, ci->ci_subtype); for (ap = types; *ap; ap++) if (!mh_strcasecmp (*ap, ci->ci_type) || !mh_strcasecmp (*ap, buffer)) return 1; return 0; } void set_endian (void) { union { long l; char c[sizeof(long)]; } un; un.l = 1; endian = un.c[0] ? -1 : 1; if (debugsw) fprintf (stderr, "%s endian architecture\n", endian > 0 ? "big" : "little"); } int make_intermediates (char *file) { char *cp; for (cp = file + 1; (cp = strchr(cp, '/')); cp++) { struct stat st; *cp = '\0'; if (stat (file, &st) == NOTOK) { int answer; char *ep; if (errno != ENOENT) { advise (file, "error on directory"); losing_directory: *cp = '/'; return NOTOK; } ep = concat ("Create directory \"", file, "\"? ", NULL); answer = getanswer (ep); free (ep); if (!answer) goto losing_directory; if (!makedir (file)) { advise (NULL, "unable to create directory %s", file); goto losing_directory; } } *cp = '/'; } return OK; } /* * Construct error message for content */ void content_error (char *what, CT ct, char *fmt, ...) { va_list arglist; int i, len, buflen; char *bp, buffer[BUFSIZ]; CI ci; bp = buffer; buflen = sizeof(buffer); if (userrs && invo_name && *invo_name) { snprintf (bp, buflen, "%s: ", invo_name); len = strlen (bp); bp += len; buflen -= len; } va_start (arglist, fmt); vsnprintf (bp, buflen, fmt, arglist); len = strlen (bp); bp += len; buflen -= len; ci = &ct->c_ctinfo; if (what) { char *s; if (*what) { snprintf (bp, buflen, " %s: ", what); len = strlen (bp); bp += len; buflen -= len; } if ((s = strerror (errno))) snprintf (bp, buflen, "%s", s); else snprintf (bp, buflen, "Error %d", errno); len = strlen (bp); bp += len; buflen -= len; } i = strlen (invo_name) + 2; /* Now add content type and subtype */ snprintf (bp, buflen, "\n%*.*s(content %s/%s", i, i, "", ci->ci_type, ci->ci_subtype); len = strlen (bp); bp += len; buflen -= len; /* Now add the message/part number */ if (ct->c_file) { snprintf (bp, buflen, " in message %s", ct->c_file); len = strlen (bp); bp += len; buflen -= len; if (ct->c_partno) { snprintf (bp, buflen, ", part %s", ct->c_partno); len = strlen (bp); bp += len; buflen -= len; } } snprintf (bp, buflen, ")"); len = strlen (bp); bp += len; buflen -= len; if (userrs) { *bp++ = '\n'; *bp = '\0'; buflen--; errs = add (buffer, errs); } else { advise (NULL, "%s", buffer); } } void flush_errors (void) { if (errs) { fflush (stdout); fprintf (stderr, "%s", errs); free (errs); errs = NULL; } } nmh-1.5/uip/mhn.c000644 007761 000765 00000035002 11765267273 013635 0ustar00kenhkenh000000 000000 /* * mhn.c -- display, list, cache, or store the contents of MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include static struct swit switches[] = { #define AUTOSW 0 { "auto", 0 }, #define NAUTOSW 1 { "noauto", 0 }, #define CACHESW 2 { "cache", 0 }, #define NCACHESW 3 { "nocache", 0 }, #define CHECKSW 4 { "check", 0 }, #define NCHECKSW 5 { "nocheck", 0 }, #define HEADSW 6 { "headers", 0 }, #define NHEADSW 7 { "noheaders", 0 }, #define LISTSW 8 { "list", 0 }, #define NLISTSW 9 { "nolist", 0 }, #define PAUSESW 10 { "pause", 0 }, #define NPAUSESW 11 { "nopause", 0 }, #define SIZESW 12 { "realsize", 0 }, #define NSIZESW 13 { "norealsize", 0 }, #define SERIALSW 14 { "serialonly", 0 }, #define NSERIALSW 15 { "noserialonly", 0 }, #define SHOWSW 16 { "show", 0 }, #define NSHOWSW 17 { "noshow", 0 }, #define STORESW 18 { "store", 0 }, #define NSTORESW 19 { "nostore", 0 }, #define VERBSW 20 { "verbose", 0 }, #define NVERBSW 21 { "noverbose", 0 }, #define FILESW 22 /* interface from show */ { "file file", 0 }, #define FORMSW 23 { "form formfile", 0 }, #define PARTSW 24 { "part number", 0 }, #define TYPESW 25 { "type content", 0 }, #define RCACHESW 26 { "rcache policy", 0 }, #define WCACHESW 27 { "wcache policy", 0 }, #define VERSIONSW 28 { "version", 0 }, #define HELPSW 29 { "help", 0 }, /* * switches for debugging */ #define DEBUGSW 30 { "debug", -5 }, /* * switches for moreproc/mhlproc */ #define PROGSW 31 { "moreproc program", -4 }, #define NPROGSW 32 { "nomoreproc", -3 }, #define LENSW 33 { "length lines", -4 }, #define WIDTHSW 34 { "width columns", -4 }, /* * switches for mhbuild */ #define BUILDSW 35 { "build", -5 }, #define NBUILDSW 36 { "nobuild", -7 }, #define EBCDICSW 37 { "ebcdicsafe", -10 }, #define NEBCDICSW 38 { "noebcdicsafe", -12 }, #define RFC934SW 39 { "rfc934mode", -10 }, #define NRFC934SW 40 { "norfc934mode", -12 }, { NULL, 0 } }; /* mhparse.c */ extern char *tmp; /* directory to place temp files */ /* mhcachesbr.c */ extern int rcachesw; extern int wcachesw; extern char *cache_public; extern char *cache_private; /* mhshowsbr.c */ extern int pausesw; extern int serialsw; extern char *progsw; extern int nolist; extern int nomore; /* flags for moreproc/header display */ extern char *formsw; /* mhstoresbr.c */ extern int autosw; extern char *cwd; /* cache current working directory */ /* mhmisc.c */ extern int npart; extern int ntype; extern char *parts[NPARTS + 1]; extern char *types[NTYPES + 1]; extern int userrs; int debugsw = 0; int verbosw = 0; /* * variables for mhbuild (mhn -build) */ static int buildsw = 0; static int ebcdicsw = 0; static int rfc934sw = 0; /* * what action to take? */ static int cachesw = 0; static int listsw = 0; static int showsw = 0; static int storesw = 0; #define quitser pipeser /* mhparse.c */ CT parse_mime (char *); /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void flush_errors (void); /* mhshowsbr.c */ void show_all_messages (CT *); /* mhlistsbr.c */ void list_all_messages (CT *, int, int, int, int); /* mhstoresbr.c */ void store_all_messages (CT *); /* mhcachesbr.c */ void cache_all_messages (CT *); /* mhfree.c */ void free_content (CT); extern CT *cts; void freects_done (int) NORETURN; /* * static prototypes */ static void pipeser (int); int main (int argc, char **argv) { int sizesw = 1, headsw = 1; int msgnum, *icachesw; char *cp, *file = NULL, *folder = NULL; char *maildir, buf[100], **argp; char **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp = NULL; CT ct, *ctp; FILE *fp; done=freects_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case AUTOSW: autosw++; continue; case NAUTOSW: autosw = 0; continue; case CACHESW: cachesw++; continue; case NCACHESW: cachesw = 0; continue; case RCACHESW: icachesw = &rcachesw; goto do_cache; case WCACHESW: icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, caches)) { case AMBIGSW: ambigsw (cp, caches); done (1); case UNKWNSW: adios (NULL, "%s unknown", cp); default: break; } continue; case CHECKSW: checksw++; continue; case NCHECKSW: checksw = 0; continue; case HEADSW: headsw = 1; continue; case NHEADSW: headsw = 0; continue; case LISTSW: listsw = 1; continue; case NLISTSW: listsw = 0; continue; case PAUSESW: pausesw = 1; continue; case NPAUSESW: pausesw = 0; continue; case SERIALSW: serialsw = 1; continue; case NSERIALSW: serialsw = 0; continue; case SHOWSW: showsw = 1; continue; case NSHOWSW: showsw = 0; continue; case SIZESW: sizesw = 1; continue; case NSIZESW: sizesw = 0; continue; case STORESW: storesw = 1; continue; case NSTORESW: storesw = 0; continue; case PARTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (npart >= NPARTS) adios (NULL, "too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (ntype >= NTYPES) adios (NULL, "too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios (NULL, "missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; case FORMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (formsw) free (formsw); formsw = getcpy (etcpath (cp)); continue; /* * Switches for moreproc/mhlproc */ case PROGSW: if (!(progsw = *argp++) || *progsw == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NPROGSW: nomore++; continue; case LENSW: case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; /* * Switches for mhbuild */ case BUILDSW: buildsw = 1; continue; case NBUILDSW: buildsw = 0; continue; case RFC934SW: rfc934sw = 1; continue; case NRFC934SW: rfc934sw = -1; continue; case EBCDICSW: ebcdicsw = 1; continue; case NEBCDICSW: ebcdicsw = -1; continue; case VERBSW: verbosw = 1; continue; case NVERBSW: verbosw = 0; continue; case DEBUGSW: debugsw = 1; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } /* null terminate the list of acceptable parts/types */ parts[npart] = NULL; types[ntype] = NULL; set_endian (); if ((cp = getenv ("MM_NOASK")) && !strcmp (cp, "1")) { nolist = 1; listsw = 0; pausesw = 0; } /* * Check if we've specified an additional profile */ if ((cp = getenv ("MHN"))) { if ((fp = fopen (cp, "r"))) { readconfig ((struct node **) 0, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHN profile (%s)", cp); } } /* * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { readconfig ((struct node **) 0, fp, cp, 0); fclose (fp); } /* Check for public cache location */ if ((cache_public = context_find (nmhcache)) && *cache_public != '/') cache_public = NULL; /* Check for private cache location */ if (!(cache_private = context_find (nmhprivcache))) cache_private = ".cache"; cache_private = getcpy (m_maildir (cache_private)); /* * Cache the current directory before we do any chdirs()'s. */ cwd = getcpy (pwd()); /* * Check for storage directory. If specified, * then store temporary files there. Else we * store them in standard nmh directory. */ if ((cp = context_find (nmhstorage)) && *cp) tmp = concat (cp, "/", invo_name, NULL); else tmp = add (m_maildir (invo_name), NULL); if (!context_find ("path")) free (path ("./", TFOLDER)); /* * Process a mhn composition file (mhn -build) */ if (buildsw) { char *vec[MAXARGS]; int vecp; if (showsw || storesw || cachesw) adios (NULL, "cannot use -build with -show, -store, -cache"); if (msgs.size < 1) adios (NULL, "need to specify a %s composition file", invo_name); if (msgs.size > 1) adios (NULL, "only one %s composition file at a time", invo_name); vecp = 0; vec[vecp++] = "mhbuild"; if (ebcdicsw == 1) vec[vecp++] = "-ebcdicsafe"; else if (ebcdicsw == -1) vec[vecp++] = "-noebcdicsafe"; if (rfc934sw == 1) vec[vecp++] = "-rfc934mode"; else if (rfc934sw == -1) vec[vecp++] = "-norfc934mode"; vec[vecp++] = msgs.msgs[0]; vec[vecp] = NULL; execvp ("mhbuild", vec); fprintf (stderr, "unable to exec "); _exit (-1); } /* * Process a mhn composition file (old MH style) */ if (msgs.size == 1 && !folder && !npart && !cachesw && !showsw && !storesw && !ntype && !file && (cp = getenv ("mhdraft")) && strcmp (cp, msgs.msgs[0]) == 0) { char *vec[MAXARGS]; int vecp; vecp = 0; vec[vecp++] = "mhbuild"; if (ebcdicsw == 1) vec[vecp++] = "-ebcdicsafe"; else if (ebcdicsw == -1) vec[vecp++] = "-noebcdicsafe"; if (rfc934sw == 1) vec[vecp++] = "-rfc934mode"; else if (rfc934sw == -1) vec[vecp++] = "-norfc934mode"; vec[vecp++] = cp; vec[vecp] = NULL; execvp ("mhbuild", vec); fprintf (stderr, "unable to exec "); _exit (-1); } if (file && msgs.size) adios (NULL, "cannot specify msg and file at same time!"); /* * check if message is coming from file */ if (file) { if (!(cts = (CT *) calloc ((size_t) 2, sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; if ((ct = parse_mime (file))) *ctp++ = ct; } else { /* * message(s) are coming from a folder */ if (!msgs.size) app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ if (!(cts = (CT *) calloc ((size_t) (mp->numsel + 1), sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { char *msgnam; msgnam = m_name (msgnum); if ((ct = parse_mime (msgnam))) *ctp++ = ct; } } } if (!*cts) done (1); /* * You can't give more than one of these flags * at a time. */ if (showsw + listsw + storesw + cachesw > 1) adios (NULL, "can only use one of -show, -list, -store, -cache at same time"); /* If no action is specified, assume -show */ if (!listsw && !showsw && !storesw && !cachesw) showsw = 1; userrs = 1; SIGNAL (SIGQUIT, quitser); SIGNAL (SIGPIPE, pipeser); /* * Get the associated umask for the relevant contents. */ for (ctp = cts; *ctp; ctp++) { struct stat st; ct = *ctp; if (type_ok (ct, 1) && !ct->c_umask) { if (stat (ct->c_file, &st) != NOTOK) ct->c_umask = ~(st.st_mode & 0777); else ct->c_umask = ~m_gmprot(); } } /* * List the message content */ if (listsw) list_all_messages (cts, headsw, sizesw, verbosw, debugsw); /* * Store the message content */ if (storesw) store_all_messages (cts); /* * Cache the message content */ if (cachesw) cache_all_messages (cts); /* * Show the message content */ if (showsw) show_all_messages (cts); /* Now free all the structures for the content */ for (ctp = cts; *ctp; ctp++) free_content (*ctp); free ((char *) cts); cts = NULL; /* If reading from a folder, do some updating */ if (mp) { context_replace (pfolder, folder);/* update current folder */ seq_setcur (mp, mp->hghsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } done (0); return 1; } static void pipeser (int i) { if (i == SIGQUIT) { unlink ("core"); fflush (stdout); fprintf (stderr, "\n"); fflush (stderr); } done (1); /* NOTREACHED */ } nmh-1.5/uip/mhoutsbr.c000644 007761 000765 00000022705 11762736347 014724 0ustar00kenhkenh000000 000000 /* * mhoutsbr.c -- routines to output MIME messages * -- given a Content structure * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include extern int ebcdicsw; static char ebcdicsafe[0x100] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static char nib2b64[0x40+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /* * prototypes */ int output_message (CT, char *); int output_message_fp (CT, FILE *, char *); /* * static prototypes */ static int output_content (CT, FILE *); static void output_headers (CT, FILE *); static int writeExternalBody (CT, FILE *); static int write8Bit (CT, FILE *); static int writeQuoted (CT, FILE *); static int writeBase64 (CT, FILE *); /* * Main routine to output a MIME message contained * in a Content structure, to a file. Any necessary * transfer encoding is added. */ int output_message_fp (CT ct, FILE *fp, char *file) { if (output_content (ct, fp) == NOTOK) return NOTOK; if (fflush (fp)) { advise ((file?file:""), "error writing to"); return NOTOK; } return OK; } int output_message (CT ct, char *file) { FILE *fp; int status; if ((fp = fopen (file, "w")) == NULL) { advise (file, "unable to open for writing"); return NOTOK; } status = output_message_fp(ct, fp, file); fclose(fp); return status; } /* * Output a Content structure to a file. */ static int output_content (CT ct, FILE *out) { int result = 0; CI ci = &ct->c_ctinfo; /* * Output all header fields for this content */ output_headers (ct, out); /* * If this is the internal content structure for a * "message/external", then we are done with the * headers (since it has no body). */ if (ct->c_ctexbody) return OK; /* * Now output the content bodies. */ switch (ct->c_type) { case CT_MULTIPART: { struct multipart *m; struct part *part; if (ct->c_rfc934) putc ('\n', out); m = (struct multipart *) ct->c_ctparams; for (part = m->mp_parts; part; part = part->mp_next) { CT p = part->mp_part; fprintf (out, "\n--%s\n", ci->ci_values[0]); if (output_content (p, out) == NOTOK) return NOTOK; } fprintf (out, "\n--%s--\n", ci->ci_values[0]); } break; case CT_MESSAGE: putc ('\n', out); if (ct->c_subtype == MESSAGE_EXTERNAL) { struct exbody *e; e = (struct exbody *) ct->c_ctparams; if (output_content (e->eb_content, out) == NOTOK) return NOTOK; /* output phantom body for access-type "mail-server" */ if (e->eb_body) writeExternalBody (ct, out); } else { result = write8Bit (ct, out); } break; /* * Handle discrete types (text/application/audio/image/video) */ default: switch (ct->c_encoding) { case CE_7BIT: putc ('\n', out); result = write8Bit (ct, out); break; case CE_8BIT: putc ('\n', out); result = write8Bit (ct, out); break; case CE_QUOTED: putc ('\n', out); result = writeQuoted (ct, out); break; case CE_BASE64: putc ('\n', out); result = writeBase64 (ct, out); break; case CE_BINARY: advise (NULL, "can't handle binary transfer encoding in content"); result = NOTOK; break; default: advise (NULL, "unknown transfer encoding in content"); result = NOTOK; break; } break; } return result; } /* * Output all the header fields for a content */ static void output_headers (CT ct, FILE *out) { HF hp; hp = ct->c_first_hf; while (hp) { fprintf (out, "%s:%s", hp->name, hp->value); hp = hp->next; } } /* * Write the phantom body for access-type "mail-server". */ static int writeExternalBody (CT ct, FILE *out) { char **ap, **ep, *cp; struct exbody *e = (struct exbody *) ct->c_ctparams; putc ('\n', out); for (cp = e->eb_body; *cp; cp++) { CT ct2 = e->eb_content; CI ci2 = &ct2->c_ctinfo; if (*cp == '\\') { switch (*++cp) { case 'I': if (ct2->c_id) { char *dp = trimcpy (ct2->c_id); fputs (dp, out); free (dp); } continue; case 'N': for (ap = ci2->ci_attrs, ep = ci2->ci_values; *ap; ap++, ep++) if (!mh_strcasecmp (*ap, "name")) { fprintf (out, "%s", *ep); break; } continue; case 'T': fprintf (out, "%s/%s", ci2->ci_type, ci2->ci_subtype); for (ap = ci2->ci_attrs, ep = ci2->ci_values; *ap; ap++, ep++) fprintf (out, "; %s=\"%s\"", *ap, *ep); continue; case 'n': putc ('\n', out); continue; case 't': putc ('\t', out); continue; case '\0': cp--; break; case '\\': case '"': break; default: putc ('\\', out); break; } } putc (*cp, out); } putc ('\n', out); return OK; } /* * Output a content without any transfer encoding */ static int write8Bit (CT ct, FILE *out) { int fd; char c, *file, buffer[BUFSIZ]; CE ce = ct->c_cefile; file = NULL; if ((fd = (*ct->c_ceopenfnx) (ct, &file)) == NOTOK) return NOTOK; c = '\n'; while (fgets (buffer, sizeof(buffer) - 1, ce->ce_fp)) { c = buffer[strlen (buffer) - 1]; fputs (buffer, out); } if (c != '\n') putc ('\n', out); (*ct->c_ceclosefnx) (ct); return OK; } /* * Output a content using quoted-printable */ static int writeQuoted (CT ct, FILE *out) { int fd; char *cp, *file; char c, buffer[BUFSIZ]; CE ce = ct->c_cefile; file = NULL; if ((fd = (*ct->c_ceopenfnx) (ct, &file)) == NOTOK) return NOTOK; while (fgets (buffer, sizeof(buffer) - 1, ce->ce_fp)) { int n; cp = buffer + strlen (buffer) - 1; if ((c = *cp) == '\n') *cp = '\0'; if (strncmp (cp = buffer, "From ", sizeof("From ") - 1) == 0) { fprintf (out, "=%02X", *cp++ & 0xff); n = 3; } else { n = 0; } for (; *cp; cp++) { if (n > CPERLIN - 3) { fputs ("=\n", out); n = 0; } switch (*cp) { case ' ': case '\t': putc (*cp, out); n++; break; default: if (*cp < '!' || *cp > '~' || (ebcdicsw && !ebcdicsafe[*cp & 0xff])) goto three_print; putc (*cp, out); n++; break; case '=': three_print: fprintf (out, "=%02X", *cp & 0xff); n += 3; break; } } if (c == '\n') { if (cp > buffer && (*--cp == ' ' || *cp == '\t')) fputs ("=\n", out); putc ('\n', out); } else { fputs ("=\n", out); } } (*ct->c_ceclosefnx) (ct); return OK; } /* * Output a content using base64 */ static int writeBase64 (CT ct, FILE *out) { int fd, result; char *file; CE ce = ct->c_cefile; file = NULL; if ((fd = (*ct->c_ceopenfnx) (ct, &file)) == NOTOK) return NOTOK; result = writeBase64aux (ce->ce_fp, out); (*ct->c_ceclosefnx) (ct); return result; } int writeBase64aux (FILE *in, FILE *out) { unsigned int cc, n; char inbuf[3]; n = BPERLIN; while ((cc = fread (inbuf, sizeof(*inbuf), sizeof(inbuf), in)) > 0) { unsigned long bits; char *bp; char outbuf[4]; if (cc < sizeof(inbuf)) { inbuf[2] = 0; if (cc < sizeof(inbuf) - 1) inbuf[1] = 0; } bits = (inbuf[0] & 0xff) << 16; bits |= (inbuf[1] & 0xff) << 8; bits |= inbuf[2] & 0xff; for (bp = outbuf + sizeof(outbuf); bp > outbuf; bits >>= 6) *--bp = nib2b64[bits & 0x3f]; if (cc < sizeof(inbuf)) { outbuf[3] = '='; if (cc < sizeof inbuf - 1) outbuf[2] = '='; } fwrite (outbuf, sizeof(*outbuf), sizeof(outbuf), out); if (cc < sizeof(inbuf)) { putc ('\n', out); return OK; } if (--n <= 0) { n = BPERLIN; putc ('\n', out); } } if (n != BPERLIN) putc ('\n', out); return OK; } nmh-1.5/uip/mhparam.c000644 007761 000765 00000010203 11765267273 014474 0ustar00kenhkenh000000 000000 /* * mhparam.c -- print mh_profile values * * Originally contributed by * Jeffrey C Honig * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include extern char *mhlibdir; extern char *mhetcdir; char *sbackup = BACKUP_PREFIX; static struct swit switches[] = { #define COMPSW 0 { "components", 0 }, #define NCOMPSW 1 { "nocomponents", 0 }, #define ALLSW 2 { "all", 0 }, #define VERSIONSW 3 { "version", 0 }, #define HELPSW 4 { "help", 0 }, #define DEBUGSW 5 { "debug", -5 }, { NULL, 0 } }; struct proc { char *p_name; char **p_field; }; static struct proc procs [] = { { "context", &context }, { "mh-sequences", &mh_seq }, { "buildmimeproc", &buildmimeproc }, { "faceproc", &faceproc }, { "fileproc", &fileproc }, { "foldprot", &foldprot }, { "formatproc", &formatproc }, { "incproc", &incproc }, { "installproc", &installproc }, { "lproc", &lproc }, { "mailproc", &mailproc }, { "mhlproc", &mhlproc }, { "moreproc", &moreproc }, { "msgprot", &msgprot }, { "mshproc", &mshproc }, { "packproc", &packproc }, { "postproc", &postproc }, { "rmmproc", &rmmproc }, { "sendproc", &sendproc }, { "showmimeproc", &showmimeproc }, { "showproc", &showproc }, { "version", &version_num }, { "vmhproc", &vmhproc }, { "whatnowproc", &whatnowproc }, { "whomproc", &whomproc }, { "etcdir", &mhetcdir }, { "libdir", &mhlibdir }, { "sbackup", &sbackup }, { NULL, NULL }, }; /* * static prototypes */ static char *p_find(char *); int main(int argc, char **argv) { int i, compp = 0, missed = 0; int all = 0, debug = 0; int components = -1; char *cp, buf[BUFSIZ], **argp; char **arguments, *comps[MAXARGS]; invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [profile-components] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case COMPSW: components = 1; break; case NCOMPSW: components = 0; break; case ALLSW: all = 1; break; case DEBUGSW: debug = 1; break; } } else { comps[compp++] = cp; } } if (all) { struct node *np; if (compp) advise(NULL, "profile-components ignored with -all"); if (components >= 0) advise(NULL, "-%scomponents ignored with -all", components ? "" : "no"); /* print all entries in context/profile list */ for (np = m_defs; np; np = np->n_next) printf("%s: %s\n", np->n_name, np->n_field); } else if (debug) { struct proc *ps; /* * Print the current value of everything in * procs array. This will show their current * value (as determined after context is read). */ for (ps = procs; ps->p_name; ps++) printf ("%s: %s\n", ps->p_name, *ps->p_field ? *ps->p_field : ""); } else { if (components < 0) components = compp > 1; for (i = 0; i < compp; i++) { register char *value; value = context_find (comps[i]); if (!value) value = p_find (comps[i]); if (value) { if (components) printf("%s: ", comps[i]); printf("%s\n", value); } else missed++; } } done (missed); return 1; } static char * p_find(char *str) { struct proc *ps; for (ps = procs; ps->p_name; ps++) if (!mh_strcasecmp (ps->p_name, str)) return (*ps->p_field); return NULL; } nmh-1.5/uip/mhparse.c000644 007761 000765 00000200141 11762736347 014510 0ustar00kenhkenh000000 000000 /* * mhparse.c -- routines to parse the contents of MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include extern int debugsw; extern int endian; /* mhmisc.c */ extern pid_t xpid; /* mhshowsbr.c */ /* cache policies */ extern int rcachesw; /* mhcachesbr.c */ extern int wcachesw; /* mhcachesbr.c */ int checksw = 0; /* check Content-MD5 field */ /* * Directory to place temp files. This must * be set before these routines are called. */ char *tmp; /* * Structures for TEXT messages */ struct k2v SubText[] = { { "plain", TEXT_PLAIN }, { "richtext", TEXT_RICHTEXT }, /* defined in RFC-1341 */ { "enriched", TEXT_ENRICHED }, /* defined in RFC-1896 */ { NULL, TEXT_UNKNOWN } /* this one must be last! */ }; struct k2v Charset[] = { { "us-ascii", CHARSET_USASCII }, { "iso-8859-1", CHARSET_LATIN }, { NULL, CHARSET_UNKNOWN } /* this one must be last! */ }; /* * Structures for MULTIPART messages */ struct k2v SubMultiPart[] = { { "mixed", MULTI_MIXED }, { "alternative", MULTI_ALTERNATE }, { "digest", MULTI_DIGEST }, { "parallel", MULTI_PARALLEL }, { NULL, MULTI_UNKNOWN } /* this one must be last! */ }; /* * Structures for MESSAGE messages */ struct k2v SubMessage[] = { { "rfc822", MESSAGE_RFC822 }, { "partial", MESSAGE_PARTIAL }, { "external-body", MESSAGE_EXTERNAL }, { NULL, MESSAGE_UNKNOWN } /* this one must be last! */ }; /* * Structure for APPLICATION messages */ struct k2v SubApplication[] = { { "octet-stream", APPLICATION_OCTETS }, { "postscript", APPLICATION_POSTSCRIPT }, { NULL, APPLICATION_UNKNOWN } /* this one must be last! */ }; /* mhcachesbr.c */ int find_cache (CT, int, int *, char *, char *, int); /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void content_error (char *, CT, char *, ...); /* mhfree.c */ void free_content (CT); void free_encoding (CT, int); /* * static prototypes */ static CT get_content (FILE *, char *, int); static int get_comment (CT, unsigned char **, int); static int InitGeneric (CT); static int InitText (CT); static int InitMultiPart (CT); static void reverse_parts (CT); static int InitMessage (CT); static int InitApplication (CT); static int init_encoding (CT, OpenCEFunc); static unsigned long size_encoding (CT); static int InitBase64 (CT); static int openBase64 (CT, char **); static int InitQuoted (CT); static int openQuoted (CT, char **); static int Init7Bit (CT); static int openExternal (CT, CT, CE, char **, int *); static int InitFile (CT); static int openFile (CT, char **); static int InitFTP (CT); static int openFTP (CT, char **); static int InitMail (CT); static int openMail (CT, char **); static int readDigest (CT, char *); struct str2init str2cts[] = { { "application", CT_APPLICATION, InitApplication }, { "audio", CT_AUDIO, InitGeneric }, { "image", CT_IMAGE, InitGeneric }, { "message", CT_MESSAGE, InitMessage }, { "multipart", CT_MULTIPART, InitMultiPart }, { "text", CT_TEXT, InitText }, { "video", CT_VIDEO, InitGeneric }, { NULL, CT_EXTENSION, NULL }, /* these two must be last! */ { NULL, CT_UNKNOWN, NULL }, }; struct str2init str2ces[] = { { "base64", CE_BASE64, InitBase64 }, { "quoted-printable", CE_QUOTED, InitQuoted }, { "8bit", CE_8BIT, Init7Bit }, { "7bit", CE_7BIT, Init7Bit }, { "binary", CE_BINARY, Init7Bit }, { NULL, CE_EXTENSION, NULL }, /* these two must be last! */ { NULL, CE_UNKNOWN, NULL }, }; /* * NOTE WELL: si_key MUST NOT have value of NOTOK * * si_key is 1 if access method is anonymous. */ struct str2init str2methods[] = { { "afs", 1, InitFile }, { "anon-ftp", 1, InitFTP }, { "ftp", 0, InitFTP }, { "local-file", 0, InitFile }, { "mail-server", 0, InitMail }, { NULL, 0, NULL } }; int pidcheck (int status) { if ((status & 0xff00) == 0xff00 || (status & 0x007f) != SIGQUIT) return status; fflush (stdout); fflush (stderr); done (1); return 1; } /* * Main entry point for parsing a MIME message or file. * It returns the Content structure for the top level * entity in the file. */ CT parse_mime (char *file) { int is_stdin; char buffer[BUFSIZ]; FILE *fp; CT ct; /* * Check if file is actually standard input */ if ((is_stdin = !(strcmp (file, "-")))) { char *tfile = m_mktemp2(NULL, invo_name, NULL, &fp); if (tfile == NULL) { advise("mhparse", "unable to create temporary file"); return NULL; } file = add (tfile, NULL); chmod (file, 0600); while (fgets (buffer, sizeof(buffer), stdin)) fputs (buffer, fp); fflush (fp); if (ferror (stdin)) { unlink (file); advise ("stdin", "error reading"); return NULL; } if (ferror (fp)) { unlink (file); advise (file, "error writing"); return NULL; } fseek (fp, 0L, SEEK_SET); } else if ((fp = fopen (file, "r")) == NULL) { advise (file, "unable to read"); return NULL; } if (!(ct = get_content (fp, file, 1))) { if (is_stdin) unlink (file); advise (NULL, "unable to decode %s", file); return NULL; } if (is_stdin) ct->c_unlink = 1; /* temp file to remove */ ct->c_fp = NULL; if (ct->c_end == 0L) { fseek (fp, 0L, SEEK_END); ct->c_end = ftell (fp); } if (ct->c_ctinitfnx && (*ct->c_ctinitfnx) (ct) == NOTOK) { fclose (fp); free_content (ct); return NULL; } fclose (fp); return ct; } /* * Main routine for reading/parsing the headers * of a message content. * * toplevel = 1 # we are at the top level of the message * toplevel = 0 # we are inside message type or multipart type * # other than multipart/digest * toplevel = -1 # we are inside multipart/digest * NB: on failure we will fclose(in)! */ static CT get_content (FILE *in, char *file, int toplevel) { int compnum, state; char buf[BUFSIZ], name[NAMESZ]; char *np, *vp; CT ct; HF hp; /* allocate the content structure */ if (!(ct = (CT) calloc (1, sizeof(*ct)))) adios (NULL, "out of memory"); ct->c_fp = in; ct->c_file = add (file, NULL); ct->c_begin = ftell (ct->c_fp) + 1; /* * Parse the header fields for this * content into a linked list. */ for (compnum = 1, state = FLD;;) { switch (state = m_getfld (state, name, buf, sizeof(buf), in)) { case FLD: case FLDPLUS: case FLDEOF: compnum++; /* get copies of the buffers */ np = add (name, NULL); vp = add (buf, NULL); /* if necessary, get rest of field */ while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), in); vp = add (buf, vp); /* add to previous value */ } /* Now add the header data to the list */ add_header (ct, np, vp); /* continue, if this isn't the last header field */ if (state != FLDEOF) { ct->c_begin = ftell (in) + 1; continue; } /* else fall... */ case BODY: case BODYEOF: ct->c_begin = ftell (in) - strlen (buf); break; case FILEEOF: ct->c_begin = ftell (in); break; case LENERR: case FMTERR: adios (NULL, "message format error in component #%d", compnum); default: adios (NULL, "getfld() returned %d", state); } /* break out of the loop */ break; } /* * Read the content headers. We will parse the * MIME related header fields into their various * structures and set internal flags related to * content type/subtype, etc. */ hp = ct->c_first_hf; /* start at first header field */ while (hp) { /* Get MIME-Version field */ if (!mh_strcasecmp (hp->name, VRSN_FIELD)) { int ucmp; char c; unsigned char *cp, *dp; if (ct->c_vrsn) { advise (NULL, "message %s has multiple %s: fields", ct->c_file, VRSN_FIELD); goto next_header; } ct->c_vrsn = add (hp->value, NULL); /* Now, cleanup this field */ cp = ct->c_vrsn; while (isspace (*cp)) cp++; for (dp = strchr(cp, '\n'); dp; dp = strchr(dp, '\n')) *dp++ = ' '; for (dp = cp + strlen (cp) - 1; dp >= cp; dp--) if (!isspace (*dp)) break; *++dp = '\0'; if (debugsw) fprintf (stderr, "%s: %s\n", VRSN_FIELD, cp); if (*cp == '(' && get_comment (ct, &cp, 0) == NOTOK) goto out; for (dp = cp; istoken (*dp); dp++) continue; c = *dp; *dp = '\0'; ucmp = !mh_strcasecmp (cp, VRSN_VALUE); *dp = c; if (!ucmp) { admonish (NULL, "message %s has unknown value for %s: field (%s)", ct->c_file, VRSN_FIELD, cp); } } else if (!mh_strcasecmp (hp->name, TYPE_FIELD)) { /* Get Content-Type field */ struct str2init *s2i; CI ci = &ct->c_ctinfo; /* Check if we've already seen a Content-Type header */ if (ct->c_ctline) { advise (NULL, "message %s has multiple %s: fields", ct->c_file, TYPE_FIELD); goto next_header; } /* Parse the Content-Type field */ if (get_ctinfo (hp->value, ct, 0) == NOTOK) goto out; /* * Set the Init function and the internal * flag for this content type. */ for (s2i = str2cts; s2i->si_key; s2i++) if (!mh_strcasecmp (ci->ci_type, s2i->si_key)) break; if (!s2i->si_key && !uprf (ci->ci_type, "X-")) s2i++; ct->c_type = s2i->si_val; ct->c_ctinitfnx = s2i->si_init; } else if (!mh_strcasecmp (hp->name, ENCODING_FIELD)) { /* Get Content-Transfer-Encoding field */ char c; unsigned char *cp, *dp; struct str2init *s2i; /* * Check if we've already seen the * Content-Transfer-Encoding field */ if (ct->c_celine) { advise (NULL, "message %s has multiple %s: fields", ct->c_file, ENCODING_FIELD); goto next_header; } /* get copy of this field */ ct->c_celine = cp = add (hp->value, NULL); while (isspace (*cp)) cp++; for (dp = cp; istoken (*dp); dp++) continue; c = *dp; *dp = '\0'; /* * Find the internal flag and Init function * for this transfer encoding. */ for (s2i = str2ces; s2i->si_key; s2i++) if (!mh_strcasecmp (cp, s2i->si_key)) break; if (!s2i->si_key && !uprf (cp, "X-")) s2i++; *dp = c; ct->c_encoding = s2i->si_val; /* Call the Init function for this encoding */ if (s2i->si_init && (*s2i->si_init) (ct) == NOTOK) goto out; } else if (!mh_strcasecmp (hp->name, MD5_FIELD)) { /* Get Content-MD5 field */ unsigned char *cp, *dp; char *ep; if (!checksw) goto next_header; if (ct->c_digested) { advise (NULL, "message %s has multiple %s: fields", ct->c_file, MD5_FIELD); goto next_header; } ep = cp = add (hp->value, NULL); /* get a copy */ while (isspace (*cp)) cp++; for (dp = strchr(cp, '\n'); dp; dp = strchr(dp, '\n')) *dp++ = ' '; for (dp = cp + strlen (cp) - 1; dp >= cp; dp--) if (!isspace (*dp)) break; *++dp = '\0'; if (debugsw) fprintf (stderr, "%s: %s\n", MD5_FIELD, cp); if (*cp == '(' && get_comment (ct, &cp, 0) == NOTOK) { free (ep); goto out; } for (dp = cp; *dp && !isspace (*dp); dp++) continue; *dp = '\0'; readDigest (ct, cp); free (ep); ct->c_digested++; } else if (!mh_strcasecmp (hp->name, ID_FIELD)) { /* Get Content-ID field */ ct->c_id = add (hp->value, ct->c_id); } else if (!mh_strcasecmp (hp->name, DESCR_FIELD)) { /* Get Content-Description field */ ct->c_descr = add (hp->value, ct->c_descr); } else if (!mh_strcasecmp (hp->name, DISPO_FIELD)) { /* Get Content-Disposition field */ ct->c_dispo = add (hp->value, ct->c_dispo); } next_header: hp = hp->next; /* next header field */ } /* * Check if we saw a Content-Type field. * If not, then assign a default value for * it, and the Init function. */ if (!ct->c_ctline) { /* * If we are inside a multipart/digest message, * so default type is message/rfc822 */ if (toplevel < 0) { if (get_ctinfo ("message/rfc822", ct, 0) == NOTOK) goto out; ct->c_type = CT_MESSAGE; ct->c_ctinitfnx = InitMessage; } else { /* * Else default type is text/plain */ if (get_ctinfo ("text/plain", ct, 0) == NOTOK) goto out; ct->c_type = CT_TEXT; ct->c_ctinitfnx = InitText; } } /* Use default Transfer-Encoding, if necessary */ if (!ct->c_celine) { ct->c_encoding = CE_7BIT; Init7Bit (ct); } return ct; out: free_content (ct); return NULL; } /* * small routine to add header field to list */ int add_header (CT ct, char *name, char *value) { HF hp; /* allocate header field structure */ hp = mh_xmalloc (sizeof(*hp)); /* link data into header structure */ hp->name = name; hp->value = value; hp->next = NULL; /* link header structure into the list */ if (ct->c_first_hf == NULL) { ct->c_first_hf = hp; /* this is the first */ ct->c_last_hf = hp; } else { ct->c_last_hf->next = hp; /* add it to the end */ ct->c_last_hf = hp; } return 0; } /* Make sure that buf contains at least one appearance of name, followed by =. If not, insert both name and value, just after first semicolon, if any. Note that name should not contain a trailing =. And quotes will be added around the value. Typical usage: make sure that a Content-Disposition header contains filename="foo". If it doesn't and value does, use value from that. */ static char * incl_name_value (unsigned char *buf, char *name, char *value) { char *newbuf = buf; /* Assume that name is non-null. */ if (buf && value) { char *name_plus_equal = concat (name, "=", NULL); if (! strstr (buf, name_plus_equal)) { char *insertion; unsigned char *cp; char *prefix, *suffix; /* Trim trailing space, esp. newline. */ for (cp = &buf[strlen (buf) - 1]; cp >= buf && isspace (*cp); --cp) { *cp = '\0'; } insertion = concat ("; ", name, "=", "\"", value, "\"", NULL); /* Insert at first semicolon, if any. If none, append to end. */ prefix = add (buf, NULL); if ((cp = strchr (prefix, ';'))) { suffix = concat (cp, NULL); *cp = '\0'; newbuf = concat (prefix, insertion, suffix, "\n", NULL); free (suffix); } else { /* Append to end. */ newbuf = concat (buf, insertion, "\n", NULL); } free (prefix); free (insertion); free (buf); } free (name_plus_equal); } return newbuf; } /* Extract just name_suffix="foo", if any, from value. If there isn't one, return the entire value. Note that, for example, a name_suffix of name will match filename="foo", and return foo. */ static char * extract_name_value (char *name_suffix, char *value) { char *extracted_name_value = value; char *name_suffix_plus_quote = concat (name_suffix, "=\"", NULL); char *name_suffix_equals = strstr (value, name_suffix_plus_quote); char *cp; free (name_suffix_plus_quote); if (name_suffix_equals) { char *name_suffix_begin; /* Find first \". */ for (cp = name_suffix_equals; *cp != '"'; ++cp) /* empty */; name_suffix_begin = ++cp; /* Find second \". */ for (; *cp != '"'; ++cp) /* empty */; extracted_name_value = mh_xmalloc (cp - name_suffix_begin + 1); memcpy (extracted_name_value, name_suffix_begin, cp - name_suffix_begin); extracted_name_value[cp - name_suffix_begin] = '\0'; } return extracted_name_value; } /* * Parse Content-Type line and (if `magic' is non-zero) mhbuild composition * directives. Fills in the information of the CTinfo structure. */ int get_ctinfo (unsigned char *cp, CT ct, int magic) { int i; unsigned char *dp; char **ap, **ep; char c; CI ci; ci = &ct->c_ctinfo; i = strlen (invo_name) + 2; /* store copy of Content-Type line */ cp = ct->c_ctline = add (cp, NULL); while (isspace (*cp)) /* trim leading spaces */ cp++; /* change newlines to spaces */ for (dp = strchr(cp, '\n'); dp; dp = strchr(dp, '\n')) *dp++ = ' '; /* trim trailing spaces */ for (dp = cp + strlen (cp) - 1; dp >= cp; dp--) if (!isspace (*dp)) break; *++dp = '\0'; if (debugsw) fprintf (stderr, "%s: %s\n", TYPE_FIELD, cp); if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK) return NOTOK; for (dp = cp; istoken (*dp); dp++) continue; c = *dp, *dp = '\0'; ci->ci_type = add (cp, NULL); /* store content type */ *dp = c, cp = dp; if (!*ci->ci_type) { advise (NULL, "invalid %s: field in message %s (empty type)", TYPE_FIELD, ct->c_file); return NOTOK; } /* down case the content type string */ for (dp = ci->ci_type; *dp; dp++) if (isalpha(*dp) && isupper (*dp)) *dp = tolower (*dp); while (isspace (*cp)) cp++; if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK) return NOTOK; if (*cp != '/') { if (!magic) ci->ci_subtype = add ("", NULL); goto magic_skip; } cp++; while (isspace (*cp)) cp++; if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK) return NOTOK; for (dp = cp; istoken (*dp); dp++) continue; c = *dp, *dp = '\0'; ci->ci_subtype = add (cp, NULL); /* store the content subtype */ *dp = c, cp = dp; if (!*ci->ci_subtype) { advise (NULL, "invalid %s: field in message %s (empty subtype for \"%s\")", TYPE_FIELD, ct->c_file, ci->ci_type); return NOTOK; } /* down case the content subtype string */ for (dp = ci->ci_subtype; *dp; dp++) if (isalpha(*dp) && isupper (*dp)) *dp = tolower (*dp); magic_skip: while (isspace (*cp)) cp++; if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK) return NOTOK; /* * Parse attribute/value pairs given with Content-Type */ ep = (ap = ci->ci_attrs) + NPARMS; while (*cp == ';') { char *vp; unsigned char *up; if (ap >= ep) { advise (NULL, "too many parameters in message %s's %s: field (%d max)", ct->c_file, TYPE_FIELD, NPARMS); return NOTOK; } cp++; while (isspace (*cp)) cp++; if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK) return NOTOK; if (*cp == 0) { advise (NULL, "extraneous trailing ';' in message %s's %s: parameter list", ct->c_file, TYPE_FIELD); return OK; } /* down case the attribute name */ for (dp = cp; istoken (*dp); dp++) if (isalpha(*dp) && isupper (*dp)) *dp = tolower (*dp); for (up = dp; isspace (*dp);) dp++; if (dp == cp || *dp != '=') { advise (NULL, "invalid parameter in message %s's %s: field\n%*.*sparameter %s (error detected at offset %d)", ct->c_file, TYPE_FIELD, i, i, "", cp, dp - cp); return NOTOK; } vp = (*ap = add (cp, NULL)) + (up - cp); *vp = '\0'; for (dp++; isspace (*dp);) dp++; /* now add the attribute value */ ci->ci_values[ap - ci->ci_attrs] = vp = *ap + (dp - cp); if (*dp == '"') { for (cp = ++dp, dp = vp;;) { switch (c = *cp++) { case '\0': bad_quote: advise (NULL, "invalid quoted-string in message %s's %s: field\n%*.*s(parameter %s)", ct->c_file, TYPE_FIELD, i, i, "", *ap); return NOTOK; case '\\': *dp++ = c; if ((c = *cp++) == '\0') goto bad_quote; /* else fall... */ default: *dp++ = c; continue; case '"': *dp = '\0'; break; } break; } } else { for (cp = dp, dp = vp; istoken (*cp); cp++, dp++) continue; *dp = '\0'; } if (!*vp) { advise (NULL, "invalid parameter in message %s's %s: field\n%*.*s(parameter %s)", ct->c_file, TYPE_FIELD, i, i, "", *ap); return NOTOK; } ap++; while (isspace (*cp)) cp++; if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK) return NOTOK; } /* * Get any given in buffer */ if (magic && *cp == '<') { if (ct->c_id) { free (ct->c_id); ct->c_id = NULL; } if (!(dp = strchr(ct->c_id = ++cp, '>'))) { advise (NULL, "invalid ID in message %s", ct->c_file); return NOTOK; } c = *dp; *dp = '\0'; if (*ct->c_id) ct->c_id = concat ("<", ct->c_id, ">\n", NULL); else ct->c_id = NULL; *dp++ = c; cp = dp; while (isspace (*cp)) cp++; } /* * Get any [Content-Description] given in buffer. */ if (magic && *cp == '[') { ct->c_descr = ++cp; for (dp = cp + strlen (cp) - 1; dp >= cp; dp--) if (*dp == ']') break; if (dp < cp) { advise (NULL, "invalid description in message %s", ct->c_file); ct->c_descr = NULL; return NOTOK; } c = *dp; *dp = '\0'; if (*ct->c_descr) ct->c_descr = concat (ct->c_descr, "\n", NULL); else ct->c_descr = NULL; *dp++ = c; cp = dp; while (isspace (*cp)) cp++; } /* * Get any {Content-Disposition} given in buffer. */ if (magic && *cp == '{') { ct->c_dispo = ++cp; for (dp = cp + strlen (cp) - 1; dp >= cp; dp--) if (*dp == '}') break; if (dp < cp) { advise (NULL, "invalid disposition in message %s", ct->c_file); ct->c_dispo = NULL; return NOTOK; } c = *dp; *dp = '\0'; if (*ct->c_dispo) ct->c_dispo = concat (ct->c_dispo, "\n", NULL); else ct->c_dispo = NULL; *dp++ = c; cp = dp; while (isspace (*cp)) cp++; } /* * Check if anything is left over */ if (*cp) { if (magic) { ci->ci_magic = add (cp, NULL); /* If there is a Content-Disposition header and it doesn't have a *filename=, extract it from the magic contents. The r1bindex call skips any leading directory components. */ if (ct->c_dispo) ct->c_dispo = incl_name_value (ct->c_dispo, "filename", r1bindex (extract_name_value ("name", ci-> ci_magic), '/')); } else advise (NULL, "extraneous information in message %s's %s: field\n%*.*s(%s)", ct->c_file, TYPE_FIELD, i, i, "", cp); } return OK; } static int get_comment (CT ct, unsigned char **ap, int istype) { int i; char *bp; unsigned char *cp; char c, buffer[BUFSIZ], *dp; CI ci; ci = &ct->c_ctinfo; cp = *ap; bp = buffer; cp++; for (i = 0;;) { switch (c = *cp++) { case '\0': invalid: advise (NULL, "invalid comment in message %s's %s: field", ct->c_file, istype ? TYPE_FIELD : VRSN_FIELD); return NOTOK; case '\\': *bp++ = c; if ((c = *cp++) == '\0') goto invalid; *bp++ = c; continue; case '(': i++; /* and fall... */ default: *bp++ = c; continue; case ')': if (--i < 0) break; *bp++ = c; continue; } break; } *bp = '\0'; if (istype) { if ((dp = ci->ci_comment)) { ci->ci_comment = concat (dp, " ", buffer, NULL); free (dp); } else { ci->ci_comment = add (buffer, NULL); } } while (isspace (*cp)) cp++; *ap = cp; return OK; } /* * CONTENTS * * Handles content types audio, image, and video. * There's not much to do right here. */ static int InitGeneric (CT ct) { NMH_UNUSED (ct); return OK; /* not much to do here */ } /* * TEXT */ static int InitText (CT ct) { char buffer[BUFSIZ]; char *chset = NULL; char **ap, **ep, *cp; struct k2v *kv; struct text *t; CI ci = &ct->c_ctinfo; /* check for missing subtype */ if (!*ci->ci_subtype) ci->ci_subtype = add ("plain", ci->ci_subtype); /* match subtype */ for (kv = SubText; kv->kv_key; kv++) if (!mh_strcasecmp (ci->ci_subtype, kv->kv_key)) break; ct->c_subtype = kv->kv_value; /* allocate text character set structure */ if ((t = (struct text *) calloc (1, sizeof(*t))) == NULL) adios (NULL, "out of memory"); ct->c_ctparams = (void *) t; /* scan for charset parameter */ for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) if (!mh_strcasecmp (*ap, "charset")) break; /* check if content specified a character set */ if (*ap) { /* match character set or set to CHARSET_UNKNOWN */ for (kv = Charset; kv->kv_key; kv++) { if (!mh_strcasecmp (*ep, kv->kv_key)) { chset = *ep; break; } } t->tx_charset = kv->kv_value; } else { t->tx_charset = CHARSET_UNSPECIFIED; } /* * If we can not handle character set natively, * then check profile for string to modify the * terminal or display method. * * termproc is for mhshow, though mhlist -debug prints it, too. */ if (chset != NULL && !check_charset (chset, strlen (chset))) { snprintf (buffer, sizeof(buffer), "%s-charset-%s", invo_name, chset); if ((cp = context_find (buffer))) ct->c_termproc = getcpy (cp); } return OK; } /* * MULTIPART */ static int InitMultiPart (CT ct) { int inout; long last, pos; unsigned char *cp, *dp; char **ap, **ep; char *bp, buffer[BUFSIZ]; struct multipart *m; struct k2v *kv; struct part *part, **next; CI ci = &ct->c_ctinfo; CT p; FILE *fp; /* * The encoding for multipart messages must be either * 7bit, 8bit, or binary (per RFC2045). */ if (ct->c_encoding != CE_7BIT && ct->c_encoding != CE_8BIT && ct->c_encoding != CE_BINARY) { admonish (NULL, "\"%s/%s\" type in message %s must be encoded in 7bit, 8bit, or binary", ci->ci_type, ci->ci_subtype, ct->c_file); return NOTOK; } /* match subtype */ for (kv = SubMultiPart; kv->kv_key; kv++) if (!mh_strcasecmp (ci->ci_subtype, kv->kv_key)) break; ct->c_subtype = kv->kv_value; /* * Check for "boundary" parameter, which is * required for multipart messages. */ bp = 0; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { if (!mh_strcasecmp (*ap, "boundary")) { bp = *ep; break; } } /* complain if boundary parameter is missing */ if (!*ap) { advise (NULL, "a \"boundary\" parameter is mandatory for \"%s/%s\" type in message %s's %s: field", ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } /* allocate primary structure for multipart info */ if ((m = (struct multipart *) calloc (1, sizeof(*m))) == NULL) adios (NULL, "out of memory"); ct->c_ctparams = (void *) m; /* check if boundary parameter contains only whitespace characters */ for (cp = bp; isspace (*cp); cp++) continue; if (!*cp) { advise (NULL, "invalid \"boundary\" parameter for \"%s/%s\" type in message %s's %s: field", ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } /* remove trailing whitespace from boundary parameter */ for (cp = bp, dp = cp + strlen (cp) - 1; dp > cp; dp--) if (!isspace (*dp)) break; *++dp = '\0'; /* record boundary separators */ m->mp_start = concat (bp, "\n", NULL); m->mp_stop = concat (bp, "--\n", NULL); if (!ct->c_fp && (ct->c_fp = fopen (ct->c_file, "r")) == NULL) { advise (ct->c_file, "unable to open for reading"); return NOTOK; } fseek (fp = ct->c_fp, pos = ct->c_begin, SEEK_SET); last = ct->c_end; next = &m->mp_parts; part = NULL; inout = 1; while (fgets (buffer, sizeof(buffer) - 1, fp)) { if (pos > last) break; pos += strlen (buffer); if (buffer[0] != '-' || buffer[1] != '-') continue; if (inout) { if (strcmp (buffer + 2, m->mp_start)) continue; next_part: if ((part = (struct part *) calloc (1, sizeof(*part))) == NULL) adios (NULL, "out of memory"); *next = part; next = &part->mp_next; if (!(p = get_content (fp, ct->c_file, ct->c_subtype == MULTI_DIGEST ? -1 : 0))) { ct->c_fp = NULL; return NOTOK; } p->c_fp = NULL; part->mp_part = p; pos = p->c_begin; fseek (fp, pos, SEEK_SET); inout = 0; } else { if (strcmp (buffer + 2, m->mp_start) == 0) { inout = 1; end_part: p = part->mp_part; p->c_end = ftell(fp) - (strlen(buffer) + 1); if (p->c_end < p->c_begin) p->c_begin = p->c_end; if (inout) goto next_part; goto last_part; } else { if (strcmp (buffer + 2, m->mp_stop) == 0) goto end_part; } } } advise (NULL, "bogus multipart content in message %s", ct->c_file); if (!inout && part) { p = part->mp_part; p->c_end = ct->c_end; if (p->c_begin >= p->c_end) { for (next = &m->mp_parts; *next != part; next = &((*next)->mp_next)) continue; *next = NULL; free_content (p); free ((char *) part); } } last_part: /* reverse the order of the parts for multipart/alternative */ if (ct->c_subtype == MULTI_ALTERNATE) reverse_parts (ct); /* * label all subparts with part number, and * then initialize the content of the subpart. */ { int partnum; char *pp; char partnam[BUFSIZ]; if (ct->c_partno) { snprintf (partnam, sizeof(partnam), "%s.", ct->c_partno); pp = partnam + strlen (partnam); } else { pp = partnam; } for (part = m->mp_parts, partnum = 1; part; part = part->mp_next, partnum++) { p = part->mp_part; sprintf (pp, "%d", partnum); p->c_partno = add (partnam, NULL); /* initialize the content of the subparts */ if (p->c_ctinitfnx && (*p->c_ctinitfnx) (p) == NOTOK) { fclose (ct->c_fp); ct->c_fp = NULL; return NOTOK; } } } fclose (ct->c_fp); ct->c_fp = NULL; return OK; } /* * reverse the order of the parts of a multipart */ static void reverse_parts (CT ct) { int i; struct multipart *m; struct part **base, **bmp, **next, *part; m = (struct multipart *) ct->c_ctparams; /* if only one part, just return */ if (!m->mp_parts || !m->mp_parts->mp_next) return; /* count number of parts */ i = 0; for (part = m->mp_parts; part; part = part->mp_next) i++; /* allocate array of pointers to the parts */ if (!(base = (struct part **) calloc ((size_t) (i + 1), sizeof(*base)))) adios (NULL, "out of memory"); bmp = base; /* point at all the parts */ for (part = m->mp_parts; part; part = part->mp_next) *bmp++ = part; *bmp = NULL; /* reverse the order of the parts */ next = &m->mp_parts; for (bmp--; bmp >= base; bmp--) { part = *bmp; *next = part; next = &part->mp_next; } *next = NULL; /* free array of pointers */ free ((char *) base); } /* * MESSAGE */ static int InitMessage (CT ct) { struct k2v *kv; CI ci = &ct->c_ctinfo; if ((ct->c_encoding != CE_7BIT) && (ct->c_encoding != CE_8BIT)) { admonish (NULL, "\"%s/%s\" type in message %s should be encoded in 7bit or 8bit", ci->ci_type, ci->ci_subtype, ct->c_file); return NOTOK; } /* check for missing subtype */ if (!*ci->ci_subtype) ci->ci_subtype = add ("rfc822", ci->ci_subtype); /* match subtype */ for (kv = SubMessage; kv->kv_key; kv++) if (!mh_strcasecmp (ci->ci_subtype, kv->kv_key)) break; ct->c_subtype = kv->kv_value; switch (ct->c_subtype) { case MESSAGE_RFC822: break; case MESSAGE_PARTIAL: { char **ap, **ep; struct partial *p; if ((p = (struct partial *) calloc (1, sizeof(*p))) == NULL) adios (NULL, "out of memory"); ct->c_ctparams = (void *) p; /* scan for parameters "id", "number", and "total" */ for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { if (!mh_strcasecmp (*ap, "id")) { p->pm_partid = add (*ep, NULL); continue; } if (!mh_strcasecmp (*ap, "number")) { if (sscanf (*ep, "%d", &p->pm_partno) != 1 || p->pm_partno < 1) { invalid_param: advise (NULL, "invalid %s parameter for \"%s/%s\" type in message %s's %s field", *ap, ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } continue; } if (!mh_strcasecmp (*ap, "total")) { if (sscanf (*ep, "%d", &p->pm_maxno) != 1 || p->pm_maxno < 1) goto invalid_param; continue; } } if (!p->pm_partid || !p->pm_partno || (p->pm_maxno && p->pm_partno > p->pm_maxno)) { advise (NULL, "invalid parameters for \"%s/%s\" type in message %s's %s field", ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } } break; case MESSAGE_EXTERNAL: { int exresult; struct exbody *e; CT p; FILE *fp; if ((e = (struct exbody *) calloc (1, sizeof(*e))) == NULL) adios (NULL, "out of memory"); ct->c_ctparams = (void *) e; if (!ct->c_fp && (ct->c_fp = fopen (ct->c_file, "r")) == NULL) { advise (ct->c_file, "unable to open for reading"); return NOTOK; } fseek (fp = ct->c_fp, ct->c_begin, SEEK_SET); if (!(p = get_content (fp, ct->c_file, 0))) { ct->c_fp = NULL; return NOTOK; } e->eb_parent = ct; e->eb_content = p; p->c_ctexbody = e; if ((exresult = params_external (ct, 0)) != NOTOK && p->c_ceopenfnx == openMail) { int cc, size; char *bp; if ((size = ct->c_end - p->c_begin) <= 0) { if (!e->eb_subject) content_error (NULL, ct, "empty body for access-type=mail-server"); goto no_body; } e->eb_body = bp = mh_xmalloc ((unsigned) size); fseek (p->c_fp, p->c_begin, SEEK_SET); while (size > 0) switch (cc = fread (bp, sizeof(*bp), size, p->c_fp)) { case NOTOK: adios ("failed", "fread"); case OK: adios (NULL, "unexpected EOF from fread"); default: bp += cc, size -= cc; break; } *bp = 0; } no_body: p->c_fp = NULL; p->c_end = p->c_begin; fclose (ct->c_fp); ct->c_fp = NULL; if (exresult == NOTOK) return NOTOK; if (e->eb_flags == NOTOK) return OK; switch (p->c_type) { case CT_MULTIPART: break; case CT_MESSAGE: if (p->c_subtype != MESSAGE_RFC822) break; /* else fall... */ default: e->eb_partno = ct->c_partno; if (p->c_ctinitfnx) (*p->c_ctinitfnx) (p); break; } } break; default: break; } return OK; } int params_external (CT ct, int composing) { char **ap, **ep; struct exbody *e = (struct exbody *) ct->c_ctparams; CI ci = &ct->c_ctinfo; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { if (!mh_strcasecmp (*ap, "access-type")) { struct str2init *s2i; CT p = e->eb_content; for (s2i = str2methods; s2i->si_key; s2i++) if (!mh_strcasecmp (*ep, s2i->si_key)) break; if (!s2i->si_key) { e->eb_access = *ep; e->eb_flags = NOTOK; p->c_encoding = CE_EXTERNAL; continue; } e->eb_access = s2i->si_key; e->eb_flags = s2i->si_val; p->c_encoding = CE_EXTERNAL; /* Call the Init function for this external type */ if ((*s2i->si_init)(p) == NOTOK) return NOTOK; continue; } if (!mh_strcasecmp (*ap, "name")) { e->eb_name = *ep; continue; } if (!mh_strcasecmp (*ap, "permission")) { e->eb_permission = *ep; continue; } if (!mh_strcasecmp (*ap, "site")) { e->eb_site = *ep; continue; } if (!mh_strcasecmp (*ap, "directory")) { e->eb_dir = *ep; continue; } if (!mh_strcasecmp (*ap, "mode")) { e->eb_mode = *ep; continue; } if (!mh_strcasecmp (*ap, "size")) { sscanf (*ep, "%lu", &e->eb_size); continue; } if (!mh_strcasecmp (*ap, "server")) { e->eb_server = *ep; continue; } if (!mh_strcasecmp (*ap, "subject")) { e->eb_subject = *ep; continue; } if (composing && !mh_strcasecmp (*ap, "body")) { e->eb_body = getcpy (*ep); continue; } } if (!e->eb_access) { advise (NULL, "invalid parameters for \"%s/%s\" type in message %s's %s field", ci->ci_type, ci->ci_subtype, ct->c_file, TYPE_FIELD); return NOTOK; } return OK; } /* * APPLICATION */ static int InitApplication (CT ct) { struct k2v *kv; CI ci = &ct->c_ctinfo; /* match subtype */ for (kv = SubApplication; kv->kv_key; kv++) if (!mh_strcasecmp (ci->ci_subtype, kv->kv_key)) break; ct->c_subtype = kv->kv_value; return OK; } /* * TRANSFER ENCODINGS */ static int init_encoding (CT ct, OpenCEFunc openfnx) { CE ce; if ((ce = (CE) calloc (1, sizeof(*ce))) == NULL) adios (NULL, "out of memory"); ct->c_cefile = ce; ct->c_ceopenfnx = openfnx; ct->c_ceclosefnx = close_encoding; ct->c_cesizefnx = size_encoding; return OK; } void close_encoding (CT ct) { CE ce; if (!(ce = ct->c_cefile)) return; if (ce->ce_fp) { fclose (ce->ce_fp); ce->ce_fp = NULL; } } static unsigned long size_encoding (CT ct) { int fd; unsigned long size; char *file; CE ce; struct stat st; if (!(ce = ct->c_cefile)) return (ct->c_end - ct->c_begin); if (ce->ce_fp && fstat (fileno (ce->ce_fp), &st) != NOTOK) return (long) st.st_size; if (ce->ce_file) { if (stat (ce->ce_file, &st) != NOTOK) return (long) st.st_size; else return 0L; } if (ct->c_encoding == CE_EXTERNAL) return (ct->c_end - ct->c_begin); file = NULL; if ((fd = (*ct->c_ceopenfnx) (ct, &file)) == NOTOK) return (ct->c_end - ct->c_begin); if (fstat (fd, &st) != NOTOK) size = (long) st.st_size; else size = 0L; (*ct->c_ceclosefnx) (ct); return size; } /* * BASE64 */ static unsigned char b642nib[0x80] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff }; static int InitBase64 (CT ct) { return init_encoding (ct, openBase64); } static int openBase64 (CT ct, char **file) { int bitno, cc, digested; int fd, len, skip, own_ct_fp = 0; unsigned long bits; unsigned char value, *b, *b1, *b2, *b3; unsigned char *cp, *ep; char buffer[BUFSIZ]; /* sbeck -- handle suffixes */ CI ci; CE ce; MD5_CTX mdContext; b = (unsigned char *) &bits; b1 = &b[endian > 0 ? 1 : 2]; b2 = &b[endian > 0 ? 2 : 1]; b3 = &b[endian > 0 ? 3 : 0]; ce = ct->c_cefile; if (ce->ce_fp) { fseek (ce->ce_fp, 0L, SEEK_SET); goto ready_to_go; } if (ce->ce_file) { if ((ce->ce_fp = fopen (ce->ce_file, "r")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading"); return NOTOK; } goto ready_to_go; } if (*file == NULL) { ce->ce_file = add (m_mktemp(tmp, NULL, NULL), NULL); ce->ce_unlink = 1; } else { ce->ce_file = add (*file, NULL); ce->ce_unlink = 0; } /* sbeck@cise.ufl.edu -- handle suffixes */ ci = &ct->c_ctinfo; snprintf (buffer, sizeof(buffer), "%s-suffix-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); cp = context_find (buffer); if (cp == NULL || *cp == '\0') { snprintf (buffer, sizeof(buffer), "%s-suffix-%s", invo_name, ci->ci_type); cp = context_find (buffer); } if (cp != NULL && *cp != '\0') { if (ce->ce_unlink) { /* Temporary file already exists, so we rename to version with extension. */ char *file_org = strdup(ce->ce_file); ce->ce_file = add (cp, ce->ce_file); if (rename(file_org, ce->ce_file)) { adios (ce->ce_file, "unable to rename %s to ", file_org); } free(file_org); } else { ce->ce_file = add (cp, ce->ce_file); } } if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); return NOTOK; } if ((len = ct->c_end - ct->c_begin) < 0) adios (NULL, "internal error(1)"); if (! ct->c_fp) { if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) { content_error (ct->c_file, ct, "unable to open for reading"); return NOTOK; } own_ct_fp = 1; } if ((digested = ct->c_digested)) MD5Init (&mdContext); bitno = 18; bits = 0L; skip = 0; lseek (fd = fileno (ct->c_fp), (off_t) ct->c_begin, SEEK_SET); while (len > 0) { switch (cc = read (fd, buffer, sizeof(buffer) - 1)) { case NOTOK: content_error (ct->c_file, ct, "error reading from"); goto clean_up; case OK: content_error (NULL, ct, "premature eof"); goto clean_up; default: if (cc > len) cc = len; len -= cc; for (ep = (cp = buffer) + cc; cp < ep; cp++) { switch (*cp) { default: if (isspace (*cp)) break; if (skip || (*cp & 0x80) || (value = b642nib[*cp & 0x7f]) > 0x3f) { if (debugsw) { fprintf (stderr, "*cp=0x%x pos=%ld skip=%d\n", *cp, (long) (lseek (fd, (off_t) 0, SEEK_CUR) - (ep - cp)), skip); } content_error (NULL, ct, "invalid BASE64 encoding -- continuing"); continue; } bits |= value << bitno; test_end: if ((bitno -= 6) < 0) { putc ((char) *b1, ce->ce_fp); if (digested) MD5Update (&mdContext, b1, 1); if (skip < 2) { putc ((char) *b2, ce->ce_fp); if (digested) MD5Update (&mdContext, b2, 1); if (skip < 1) { putc ((char) *b3, ce->ce_fp); if (digested) MD5Update (&mdContext, b3, 1); } } if (ferror (ce->ce_fp)) { content_error (ce->ce_file, ct, "error writing to"); goto clean_up; } bitno = 18, bits = 0L, skip = 0; } break; case '=': if (++skip > 3) goto self_delimiting; goto test_end; } } } } if (bitno != 18) { if (debugsw) fprintf (stderr, "premature ending (bitno %d)\n", bitno); content_error (NULL, ct, "invalid BASE64 encoding"); goto clean_up; } self_delimiting: fseek (ct->c_fp, 0L, SEEK_SET); if (fflush (ce->ce_fp)) { content_error (ce->ce_file, ct, "error writing to"); goto clean_up; } if (digested) { unsigned char digest[16]; MD5Final (digest, &mdContext); if (memcmp((char *) digest, (char *) ct->c_digest, sizeof(digest) / sizeof(digest[0]))) content_error (NULL, ct, "content integrity suspect (digest mismatch) -- continuing"); else if (debugsw) fprintf (stderr, "content integrity confirmed\n"); } fseek (ce->ce_fp, 0L, SEEK_SET); ready_to_go: *file = ce->ce_file; if (own_ct_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } return fileno (ce->ce_fp); clean_up: if (own_ct_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } free_encoding (ct, 0); return NOTOK; } /* * QUOTED PRINTABLE */ static char hex2nib[0x80] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static int InitQuoted (CT ct) { return init_encoding (ct, openQuoted); } static int openQuoted (CT ct, char **file) { int cc, digested, len, quoted, own_ct_fp = 0; unsigned char *cp, *ep; char buffer[BUFSIZ]; unsigned char mask; CE ce; /* sbeck -- handle suffixes */ CI ci; MD5_CTX mdContext; ce = ct->c_cefile; if (ce->ce_fp) { fseek (ce->ce_fp, 0L, SEEK_SET); goto ready_to_go; } if (ce->ce_file) { if ((ce->ce_fp = fopen (ce->ce_file, "r")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading"); return NOTOK; } goto ready_to_go; } if (*file == NULL) { ce->ce_file = add (m_mktemp(tmp, NULL, NULL), NULL); ce->ce_unlink = 1; } else { ce->ce_file = add (*file, NULL); ce->ce_unlink = 0; } /* sbeck@cise.ufl.edu -- handle suffixes */ ci = &ct->c_ctinfo; snprintf (buffer, sizeof(buffer), "%s-suffix-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); cp = context_find (buffer); if (cp == NULL || *cp == '\0') { snprintf (buffer, sizeof(buffer), "%s-suffix-%s", invo_name, ci->ci_type); cp = context_find (buffer); } if (cp != NULL && *cp != '\0') { if (ce->ce_unlink) { /* Temporary file already exists, so we rename to version with extension. */ char *file_org = strdup(ce->ce_file); ce->ce_file = add (cp, ce->ce_file); if (rename(file_org, ce->ce_file)) { adios (ce->ce_file, "unable to rename %s to ", file_org); } free(file_org); } else { ce->ce_file = add (cp, ce->ce_file); } } if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); return NOTOK; } if ((len = ct->c_end - ct->c_begin) < 0) adios (NULL, "internal error(2)"); if (! ct->c_fp) { if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) { content_error (ct->c_file, ct, "unable to open for reading"); return NOTOK; } own_ct_fp = 1; } if ((digested = ct->c_digested)) MD5Init (&mdContext); quoted = 0; #ifdef lint mask = 0; #endif fseek (ct->c_fp, ct->c_begin, SEEK_SET); while (len > 0) { if (fgets (buffer, sizeof(buffer) - 1, ct->c_fp) == NULL) { content_error (NULL, ct, "premature eof"); goto clean_up; } if ((cc = strlen (buffer)) > len) cc = len; len -= cc; for (ep = (cp = buffer) + cc - 1; cp <= ep; ep--) if (!isspace (*ep)) break; *++ep = '\n', ep++; for (; cp < ep; cp++) { if (quoted > 0) { /* in an escape sequence */ if (quoted == 1) { /* at byte 1 of an escape sequence */ mask = hex2nib[*cp & 0x7f]; /* next is byte 2 */ quoted = 2; } else { /* at byte 2 of an escape sequence */ mask <<= 4; mask |= hex2nib[*cp & 0x7f]; putc (mask, ce->ce_fp); if (digested) MD5Update (&mdContext, &mask, 1); if (ferror (ce->ce_fp)) { content_error (ce->ce_file, ct, "error writing to"); goto clean_up; } /* finished escape sequence; next may be literal or a new * escape sequence */ quoted = 0; } /* on to next byte */ continue; } /* not in an escape sequence */ if (*cp == '=') { /* starting an escape sequence, or invalid '='? */ if (cp + 1 < ep && cp[1] == '\n') { /* "=\n" soft line break, eat the \n */ cp++; continue; } if (cp + 1 >= ep || cp + 2 >= ep) { /* We don't have 2 bytes left, so this is an invalid * escape sequence; just show the raw bytes (below). */ } else if (isxdigit (cp[1]) && isxdigit (cp[2])) { /* Next 2 bytes are hex digits, making this a valid escape * sequence; let's decode it (above). */ quoted = 1; continue; } else { /* One or both of the next 2 is out of range, making this * an invalid escape sequence; just show the raw bytes * (below). */ } } /* Just show the raw byte. */ putc (*cp, ce->ce_fp); if (digested) { if (*cp == '\n') { MD5Update (&mdContext, (unsigned char *) "\r\n",2); } else { MD5Update (&mdContext, (unsigned char *) cp, 1); } } if (ferror (ce->ce_fp)) { content_error (ce->ce_file, ct, "error writing to"); goto clean_up; } } } if (quoted) { content_error (NULL, ct, "invalid QUOTED-PRINTABLE encoding -- end-of-content while still quoting"); goto clean_up; } fseek (ct->c_fp, 0L, SEEK_SET); if (fflush (ce->ce_fp)) { content_error (ce->ce_file, ct, "error writing to"); goto clean_up; } if (digested) { unsigned char digest[16]; MD5Final (digest, &mdContext); if (memcmp((char *) digest, (char *) ct->c_digest, sizeof(digest) / sizeof(digest[0]))) content_error (NULL, ct, "content integrity suspect (digest mismatch) -- continuing"); else if (debugsw) fprintf (stderr, "content integrity confirmed\n"); } fseek (ce->ce_fp, 0L, SEEK_SET); ready_to_go: *file = ce->ce_file; if (own_ct_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } return fileno (ce->ce_fp); clean_up: free_encoding (ct, 0); if (own_ct_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } return NOTOK; } /* * 7BIT */ static int Init7Bit (CT ct) { if (init_encoding (ct, open7Bit) == NOTOK) return NOTOK; ct->c_cesizefnx = NULL; /* no need to decode for real size */ return OK; } int open7Bit (CT ct, char **file) { int cc, fd, len, own_ct_fp = 0; char buffer[BUFSIZ]; /* sbeck -- handle suffixes */ char *cp; CI ci; CE ce; ce = ct->c_cefile; if (ce->ce_fp) { fseek (ce->ce_fp, 0L, SEEK_SET); goto ready_to_go; } if (ce->ce_file) { if ((ce->ce_fp = fopen (ce->ce_file, "r")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading"); return NOTOK; } goto ready_to_go; } if (*file == NULL) { ce->ce_file = add (m_mktemp(tmp, NULL, NULL), NULL); ce->ce_unlink = 1; } else { ce->ce_file = add (*file, NULL); ce->ce_unlink = 0; } /* sbeck@cise.ufl.edu -- handle suffixes */ ci = &ct->c_ctinfo; snprintf (buffer, sizeof(buffer), "%s-suffix-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); cp = context_find (buffer); if (cp == NULL || *cp == '\0') { snprintf (buffer, sizeof(buffer), "%s-suffix-%s", invo_name, ci->ci_type); cp = context_find (buffer); } if (cp != NULL && *cp != '\0') { if (ce->ce_unlink) { /* Temporary file already exists, so we rename to version with extension. */ char *file_org = strdup(ce->ce_file); ce->ce_file = add (cp, ce->ce_file); if (rename(file_org, ce->ce_file)) { adios (ce->ce_file, "unable to rename %s to ", file_org); } free(file_org); } else { ce->ce_file = add (cp, ce->ce_file); } } if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); return NOTOK; } if (ct->c_type == CT_MULTIPART) { char **ap, **ep; CI ci = &ct->c_ctinfo; len = 0; fprintf (ce->ce_fp, "%s: %s/%s", TYPE_FIELD, ci->ci_type, ci->ci_subtype); len += strlen (TYPE_FIELD) + 2 + strlen (ci->ci_type) + 1 + strlen (ci->ci_subtype); for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { putc (';', ce->ce_fp); len++; snprintf (buffer, sizeof(buffer), "%s=\"%s\"", *ap, *ep); if (len + 1 + (cc = strlen (buffer)) >= CPERLIN) { fputs ("\n\t", ce->ce_fp); len = 8; } else { putc (' ', ce->ce_fp); len++; } fprintf (ce->ce_fp, "%s", buffer); len += cc; } if (ci->ci_comment) { if (len + 1 + (cc = 2 + strlen (ci->ci_comment)) >= CPERLIN) { fputs ("\n\t", ce->ce_fp); len = 8; } else { putc (' ', ce->ce_fp); len++; } fprintf (ce->ce_fp, "(%s)", ci->ci_comment); len += cc; } fprintf (ce->ce_fp, "\n"); if (ct->c_id) fprintf (ce->ce_fp, "%s:%s", ID_FIELD, ct->c_id); if (ct->c_descr) fprintf (ce->ce_fp, "%s:%s", DESCR_FIELD, ct->c_descr); if (ct->c_dispo) fprintf (ce->ce_fp, "%s:%s", DISPO_FIELD, ct->c_dispo); fprintf (ce->ce_fp, "\n"); } if ((len = ct->c_end - ct->c_begin) < 0) adios (NULL, "internal error(3)"); if (! ct->c_fp) { if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) { content_error (ct->c_file, ct, "unable to open for reading"); return NOTOK; } own_ct_fp = 1; } lseek (fd = fileno (ct->c_fp), (off_t) ct->c_begin, SEEK_SET); while (len > 0) switch (cc = read (fd, buffer, sizeof(buffer) - 1)) { case NOTOK: content_error (ct->c_file, ct, "error reading from"); goto clean_up; case OK: content_error (NULL, ct, "premature eof"); goto clean_up; default: if (cc > len) cc = len; len -= cc; fwrite (buffer, sizeof(*buffer), cc, ce->ce_fp); if (ferror (ce->ce_fp)) { content_error (ce->ce_file, ct, "error writing to"); goto clean_up; } } fseek (ct->c_fp, 0L, SEEK_SET); if (fflush (ce->ce_fp)) { content_error (ce->ce_file, ct, "error writing to"); goto clean_up; } fseek (ce->ce_fp, 0L, SEEK_SET); ready_to_go: *file = ce->ce_file; if (own_ct_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } return fileno (ce->ce_fp); clean_up: free_encoding (ct, 0); if (own_ct_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } return NOTOK; } /* * External */ static int openExternal (CT ct, CT cb, CE ce, char **file, int *fd) { char cachefile[BUFSIZ]; if (ce->ce_fp) { fseek (ce->ce_fp, 0L, SEEK_SET); goto ready_already; } if (ce->ce_file) { if ((ce->ce_fp = fopen (ce->ce_file, "r")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading"); return NOTOK; } goto ready_already; } if (find_cache (ct, rcachesw, (int *) 0, cb->c_id, cachefile, sizeof(cachefile)) != NOTOK) { if ((ce->ce_fp = fopen (cachefile, "r"))) { ce->ce_file = getcpy (cachefile); ce->ce_unlink = 0; goto ready_already; } else { admonish (cachefile, "unable to fopen for reading"); } } return OK; ready_already: *file = ce->ce_file; *fd = fileno (ce->ce_fp); return DONE; } /* * File */ static int InitFile (CT ct) { return init_encoding (ct, openFile); } static int openFile (CT ct, char **file) { int fd, cachetype; char cachefile[BUFSIZ]; struct exbody *e = ct->c_ctexbody; CE ce = ct->c_cefile; switch (openExternal (e->eb_parent, e->eb_content, ce, file, &fd)) { case NOTOK: return NOTOK; case OK: break; case DONE: return fd; } if (!e->eb_name) { content_error (NULL, ct, "missing name parameter"); return NOTOK; } ce->ce_file = getcpy (e->eb_name); ce->ce_unlink = 0; if ((ce->ce_fp = fopen (ce->ce_file, "r")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading"); return NOTOK; } if ((!e->eb_permission || mh_strcasecmp (e->eb_permission, "read-write")) && find_cache (NULL, wcachesw, &cachetype, e->eb_content->c_id, cachefile, sizeof(cachefile)) != NOTOK) { int mask; FILE *fp; mask = umask (cachetype ? ~m_gmprot () : 0222); if ((fp = fopen (cachefile, "w"))) { int cc; char buffer[BUFSIZ]; FILE *gp = ce->ce_fp; fseek (gp, 0L, SEEK_SET); while ((cc = fread (buffer, sizeof(*buffer), sizeof(buffer), gp)) > 0) fwrite (buffer, sizeof(*buffer), cc, fp); fflush (fp); if (ferror (gp)) { admonish (ce->ce_file, "error reading"); unlink (cachefile); } else if (ferror (fp)) { admonish (cachefile, "error writing"); unlink (cachefile); } fclose (fp); } umask (mask); } fseek (ce->ce_fp, 0L, SEEK_SET); *file = ce->ce_file; return fileno (ce->ce_fp); } /* * FTP */ static int InitFTP (CT ct) { return init_encoding (ct, openFTP); } static int openFTP (CT ct, char **file) { int cachetype, caching, fd; int len, buflen; char *bp, *ftp, *user, *pass; char buffer[BUFSIZ], cachefile[BUFSIZ]; struct exbody *e; CE ce; static char *username = NULL; static char *password = NULL; e = ct->c_ctexbody; ce = ct->c_cefile; if ((ftp = context_find (nmhaccessftp)) && !*ftp) ftp = NULL; if (!ftp) return NOTOK; switch (openExternal (e->eb_parent, e->eb_content, ce, file, &fd)) { case NOTOK: return NOTOK; case OK: break; case DONE: return fd; } if (!e->eb_name || !e->eb_site) { content_error (NULL, ct, "missing %s parameter", e->eb_name ? "site": "name"); return NOTOK; } if (xpid) { if (xpid < 0) xpid = -xpid; pidcheck (pidwait (xpid, NOTOK)); xpid = 0; } /* Get the buffer ready to go */ bp = buffer; buflen = sizeof(buffer); /* * Construct the query message for user */ snprintf (bp, buflen, "Retrieve %s", e->eb_name); len = strlen (bp); bp += len; buflen -= len; if (e->eb_partno) { snprintf (bp, buflen, " (content %s)", e->eb_partno); len = strlen (bp); bp += len; buflen -= len; } snprintf (bp, buflen, "\n using %sFTP from site %s", e->eb_flags ? "anonymous " : "", e->eb_site); len = strlen (bp); bp += len; buflen -= len; if (e->eb_size > 0) { snprintf (bp, buflen, " (%lu octets)", e->eb_size); len = strlen (bp); bp += len; buflen -= len; } snprintf (bp, buflen, "? "); /* * Now, check the answer */ if (!getanswer (buffer)) return NOTOK; if (e->eb_flags) { user = "anonymous"; snprintf (buffer, sizeof(buffer), "%s@%s", getusername (), LocalName (1)); pass = buffer; } else { ruserpass (e->eb_site, &username, &password); user = username; pass = password; } ce->ce_unlink = (*file == NULL); caching = 0; cachefile[0] = '\0'; if ((!e->eb_permission || mh_strcasecmp (e->eb_permission, "read-write")) && find_cache (NULL, wcachesw, &cachetype, e->eb_content->c_id, cachefile, sizeof(cachefile)) != NOTOK) { if (*file == NULL) { ce->ce_unlink = 0; caching = 1; } } if (*file) ce->ce_file = add (*file, NULL); else if (caching) ce->ce_file = add (cachefile, NULL); else ce->ce_file = add (m_mktemp(tmp, NULL, NULL), NULL); if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); return NOTOK; } { int child_id, i, vecp; char *vec[9]; vecp = 0; vec[vecp++] = r1bindex (ftp, '/'); vec[vecp++] = e->eb_site; vec[vecp++] = user; vec[vecp++] = pass; vec[vecp++] = e->eb_dir; vec[vecp++] = e->eb_name; vec[vecp++] = ce->ce_file, vec[vecp++] = e->eb_mode && !mh_strcasecmp (e->eb_mode, "ascii") ? "ascii" : "binary"; vec[vecp] = NULL; fflush (stdout); for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: adios ("fork", "unable to"); /* NOTREACHED */ case OK: close (fileno (ce->ce_fp)); execvp (ftp, vec); fprintf (stderr, "unable to exec "); perror (ftp); _exit (-1); /* NOTREACHED */ default: if (pidXwait (child_id, NULL)) { username = password = NULL; ce->ce_unlink = 1; return NOTOK; } break; } } if (cachefile[0]) { if (caching) chmod (cachefile, cachetype ? m_gmprot () : 0444); else { int mask; FILE *fp; mask = umask (cachetype ? ~m_gmprot () : 0222); if ((fp = fopen (cachefile, "w"))) { int cc; FILE *gp = ce->ce_fp; fseek (gp, 0L, SEEK_SET); while ((cc= fread (buffer, sizeof(*buffer), sizeof(buffer), gp)) > 0) fwrite (buffer, sizeof(*buffer), cc, fp); fflush (fp); if (ferror (gp)) { admonish (ce->ce_file, "error reading"); unlink (cachefile); } else if (ferror (fp)) { admonish (cachefile, "error writing"); unlink (cachefile); } fclose (fp); } umask (mask); } } fseek (ce->ce_fp, 0L, SEEK_SET); *file = ce->ce_file; return fileno (ce->ce_fp); } /* * Mail */ static int InitMail (CT ct) { return init_encoding (ct, openMail); } static int openMail (CT ct, char **file) { int child_id, fd, i, vecp; int len, buflen; char *bp, buffer[BUFSIZ], *vec[7]; struct exbody *e = ct->c_ctexbody; CE ce = ct->c_cefile; switch (openExternal (e->eb_parent, e->eb_content, ce, file, &fd)) { case NOTOK: return NOTOK; case OK: break; case DONE: return fd; } if (!e->eb_server) { content_error (NULL, ct, "missing server parameter"); return NOTOK; } if (xpid) { if (xpid < 0) xpid = -xpid; pidcheck (pidwait (xpid, NOTOK)); xpid = 0; } /* Get buffer ready to go */ bp = buffer; buflen = sizeof(buffer); /* Now, construct query message */ snprintf (bp, buflen, "Retrieve content"); len = strlen (bp); bp += len; buflen -= len; if (e->eb_partno) { snprintf (bp, buflen, " %s", e->eb_partno); len = strlen (bp); bp += len; buflen -= len; } snprintf (bp, buflen, " by asking %s\n\n%s\n? ", e->eb_server, e->eb_subject ? e->eb_subject : e->eb_body); /* Now, check answer */ if (!getanswer (buffer)) return NOTOK; vecp = 0; vec[vecp++] = r1bindex (mailproc, '/'); vec[vecp++] = e->eb_server; vec[vecp++] = "-subject"; vec[vecp++] = e->eb_subject ? e->eb_subject : "mail-server request"; vec[vecp++] = "-body"; vec[vecp++] = e->eb_body; vec[vecp] = NULL; for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: advise ("fork", "unable to"); return NOTOK; case OK: execvp (mailproc, vec); fprintf (stderr, "unable to exec "); perror (mailproc); _exit (-1); /* NOTREACHED */ default: if (pidXwait (child_id, NULL) == OK) advise (NULL, "request sent"); break; } if (*file == NULL) { ce->ce_file = add (m_mktemp(tmp, NULL, NULL), NULL); ce->ce_unlink = 1; } else { ce->ce_file = add (*file, NULL); ce->ce_unlink = 0; } if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); return NOTOK; } /* showproc is for mhshow and mhstore, though mhlist -debug * prints it, too. */ if (ct->c_showproc) free (ct->c_showproc); ct->c_showproc = add ("true", NULL); fseek (ce->ce_fp, 0L, SEEK_SET); *file = ce->ce_file; return fileno (ce->ce_fp); } static int readDigest (CT ct, char *cp) { int bitno, skip; unsigned long bits; char *bp = cp; unsigned char *dp, value, *ep; unsigned char *b, *b1, *b2, *b3; b = (unsigned char *) &bits, b1 = &b[endian > 0 ? 1 : 2], b2 = &b[endian > 0 ? 2 : 1], b3 = &b[endian > 0 ? 3 : 0]; bitno = 18; bits = 0L; skip = 0; for (ep = (dp = ct->c_digest) + sizeof(ct->c_digest) / sizeof(ct->c_digest[0]); *cp; cp++) switch (*cp) { default: if (skip || (*cp & 0x80) || (value = b642nib[*cp & 0x7f]) > 0x3f) { if (debugsw) fprintf (stderr, "invalid BASE64 encoding\n"); return NOTOK; } bits |= value << bitno; test_end: if ((bitno -= 6) < 0) { if (dp + (3 - skip) > ep) goto invalid_digest; *dp++ = *b1; if (skip < 2) { *dp++ = *b2; if (skip < 1) *dp++ = *b3; } bitno = 18; bits = 0L; skip = 0; } break; case '=': if (++skip > 3) goto self_delimiting; goto test_end; } if (bitno != 18) { if (debugsw) fprintf (stderr, "premature ending (bitno %d)\n", bitno); return NOTOK; } self_delimiting: if (dp != ep) { invalid_digest: if (debugsw) { while (*cp) cp++; fprintf (stderr, "invalid MD5 digest (got %d octets)\n", (int)(cp - bp)); } return NOTOK; } if (debugsw) { fprintf (stderr, "MD5 digest="); for (dp = ct->c_digest; dp < ep; dp++) fprintf (stderr, "%02x", *dp & 0xff); fprintf (stderr, "\n"); } return OK; } nmh-1.5/uip/mhpath.c000644 007761 000765 00000006137 11765267273 014343 0ustar00kenhkenh000000 000000 /* * mhpath.c -- print full pathnames of nmh messages and folders * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include static struct swit switches[] = { #define VERSIONSW 0 { "version", 0 }, #define HELPSW 1 { "help", 0 }, { NULL, 0 } }; int main(int argc, char **argv) { int i; char *cp, *maildir, *folder = NULL; char **argp; char **arguments, buf[BUFSIZ]; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } if (!context_find ("path")) free (path ("./", TFOLDER)); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); /* If no messages are given, print folder pathname */ if (!msgs.size) { printf ("%s\n", maildir); done (0); } if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* * We need to make sure there is message status space * for all the message numbers from 1 to "new" since * mhpath can select empty slots. If we are adding * space at the end, we go ahead and add 10 slots. */ if (mp->hghmsg >= mp->hghoff) { if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10))) adios (NULL, "unable to allocate folder storage"); } else if (mp->lowoff > 1) { if (!(mp = folder_realloc (mp, 1, mp->hghoff))) adios (NULL, "unable to allocate folder storage"); } mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */ /* parse all the message ranges/sequences and set SELECTED */ for (i = 0; i < msgs.size; i++) if (!m_convert (mp, msgs.msgs[i])) done (1); seq_setprev (mp); /* set the previous-sequence */ /* print the path of all selected messages */ for (i = mp->lowsel; i <= mp->hghsel; i++) if (is_selected (mp, i)) printf ("%s/%s\n", mp->foldpath, m_name (i)); seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ done (0); return 1; } nmh-1.5/uip/mhshow.c000644 007761 000765 00000024073 11765267273 014366 0ustar00kenhkenh000000 000000 /* * mhshow.c -- display the contents of MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include static struct swit switches[] = { #define CHECKSW 0 { "check", 0 }, #define NCHECKSW 1 { "nocheck", 0 }, #define PAUSESW 2 { "pause", 0 }, #define NPAUSESW 3 { "nopause", 0 }, #define SERIALSW 4 { "serialonly", 0 }, #define NSERIALSW 5 { "noserialonly", 0 }, #define VERBSW 6 { "verbose", 0 }, #define NVERBSW 7 { "noverbose", 0 }, #define FILESW 8 /* interface from show */ { "file file", 0 }, #define FORMSW 9 { "form formfile", 0 }, #define PARTSW 10 { "part number", 0 }, #define TYPESW 11 { "type content", 0 }, #define RCACHESW 12 { "rcache policy", 0 }, #define WCACHESW 13 { "wcache policy", 0 }, #define VERSIONSW 14 { "version", 0 }, #define HELPSW 15 { "help", 0 }, /* * switches for moreproc/mhlproc */ #define PROGSW 16 { "moreproc program", -4 }, #define NPROGSW 17 { "nomoreproc", -3 }, #define LENSW 18 { "length lines", -4 }, #define WIDTHSW 19 { "width columns", -4 }, /* * switches for debugging */ #define DEBUGSW 20 { "debug", -5 }, { NULL, 0 } }; /* mhparse.c */ extern char *tmp; /* directory to place temp files */ /* mhcachesbr.c */ extern int rcachesw; extern int wcachesw; extern char *cache_public; extern char *cache_private; /* mhshowsbr.c */ extern int pausesw; extern int serialsw; extern char *progsw; extern int nolist; extern int nomore; /* flags for moreproc/header display */ extern char *formsw; /* mhmisc.c */ extern int npart; extern int ntype; extern char *parts[NPARTS + 1]; extern char *types[NTYPES + 1]; extern int userrs; int debugsw = 0; int verbosw = 0; #define quitser pipeser /* mhparse.c */ CT parse_mime (char *); /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void flush_errors (void); /* mhshowsbr.c */ void show_all_messages (CT *); /* mhfree.c */ void free_content (CT); extern CT *cts; void freects_done (int) NORETURN; /* * static prototypes */ static void pipeser (int); int main (int argc, char **argv) { int msgnum, *icachesw; char *cp, *file = NULL, *folder = NULL; char *maildir, buf[100], **argp; char **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp = NULL; CT ct, *ctp; FILE *fp; done=freects_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case RCACHESW: icachesw = &rcachesw; goto do_cache; case WCACHESW: icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, caches)) { case AMBIGSW: ambigsw (cp, caches); done (1); case UNKWNSW: adios (NULL, "%s unknown", cp); default: break; } continue; case CHECKSW: checksw++; continue; case NCHECKSW: checksw = 0; continue; case PAUSESW: pausesw = 1; continue; case NPAUSESW: pausesw = 0; continue; case SERIALSW: serialsw = 1; continue; case NSERIALSW: serialsw = 0; continue; case PARTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (npart >= NPARTS) adios (NULL, "too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (ntype >= NTYPES) adios (NULL, "too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios (NULL, "missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; case FORMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (formsw) free (formsw); formsw = getcpy (etcpath (cp)); continue; /* * Switches for moreproc/mhlproc */ case PROGSW: if (!(progsw = *argp++) || *progsw == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NPROGSW: nomore++; continue; case LENSW: case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case VERBSW: verbosw = 1; continue; case NVERBSW: verbosw = 0; continue; case DEBUGSW: debugsw = 1; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } /* null terminate the list of acceptable parts/types */ parts[npart] = NULL; types[ntype] = NULL; set_endian (); if ((cp = getenv ("MM_NOASK")) && !strcmp (cp, "1")) { nolist = 1; pausesw = 0; } /* * Check if we've specified an additional profile */ if ((cp = getenv ("MHSHOW"))) { if ((fp = fopen (cp, "r"))) { readconfig ((struct node **) 0, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHSHOW profile (%s)", cp); } } /* * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { readconfig ((struct node **) 0, fp, cp, 0); fclose (fp); } /* Check for public cache location */ if ((cache_public = context_find (nmhcache)) && *cache_public != '/') cache_public = NULL; /* Check for private cache location */ if (!(cache_private = context_find (nmhprivcache))) cache_private = ".cache"; cache_private = getcpy (m_maildir (cache_private)); /* * Check for storage directory. If specified, * then store temporary files there. Else we * store them in standard nmh directory. */ if ((cp = context_find (nmhstorage)) && *cp) tmp = concat (cp, "/", invo_name, NULL); else tmp = add (m_maildir (invo_name), NULL); if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && msgs.size) adios (NULL, "cannot specify msg and file at same time!"); /* * check if message is coming from file */ if (file) { if (!(cts = (CT *) calloc ((size_t) 2, sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; if ((ct = parse_mime (file))) *ctp++ = ct; } else { /* * message(s) are coming from a folder */ if (!msgs.size) app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); /* * Set the SELECT_UNSEEN bit for all the SELECTED messages, * since we will use that as a tag to know which messages * to remove from the "unseen" sequence. */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected(mp, msgnum)) set_unseen (mp, msgnum); seq_setprev (mp); /* set the Previous-Sequence */ seq_setunseen (mp, 1); /* unset the Unseen-Sequence */ if (!(cts = (CT *) calloc ((size_t) (mp->numsel + 1), sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; /* * Parse all the SELECTED messages. */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { char *msgnam; msgnam = m_name (msgnum); if ((ct = parse_mime (msgnam))) *ctp++ = ct; } } } if (!*cts) done (1); userrs = 1; SIGNAL (SIGQUIT, quitser); SIGNAL (SIGPIPE, pipeser); /* * Get the associated umask for the relevant contents. */ for (ctp = cts; *ctp; ctp++) { struct stat st; ct = *ctp; if (type_ok (ct, 1) && !ct->c_umask) { if (stat (ct->c_file, &st) != NOTOK) ct->c_umask = ~(st.st_mode & 0777); else ct->c_umask = ~m_gmprot(); } } /* * Show the message content */ show_all_messages (cts); /* Now free all the structures for the content */ for (ctp = cts; *ctp; ctp++) free_content (*ctp); free ((char *) cts); cts = NULL; /* If reading from a folder, do some updating */ if (mp) { context_replace (pfolder, folder);/* update current folder */ seq_setcur (mp, mp->hghsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } done (0); return 1; } static void pipeser (int i) { if (i == SIGQUIT) { unlink ("core"); fflush (stdout); fprintf (stderr, "\n"); fflush (stderr); } done (1); /* NOTREACHED */ } nmh-1.5/uip/mhshowsbr.c000644 007761 000765 00000055555 11762736347 015106 0ustar00kenhkenh000000 000000 /* * mhshowsbr.c -- routines to display the contents of MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include #include extern int debugsw; int pausesw = 1; int serialsw = 0; int nolist = 0; char *progsw = NULL; /* flags for moreproc/header display */ int nomore = 0; char *formsw = NULL; pid_t xpid = 0; static sigjmp_buf intrenv; /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void content_error (char *, CT, char *, ...); void flush_errors (void); /* mhlistsbr.c */ int list_switch (CT, int, int, int, int); int list_content (CT, int, int, int, int); /* * prototypes */ void show_all_messages (CT *); int show_content_aux (CT, int, int, char *, char *); /* * static prototypes */ static void show_single_message (CT, char *); static void DisplayMsgHeader (CT, char *); static int show_switch (CT, int, int); static int show_content (CT, int, int); static int show_content_aux2 (CT, int, int, char *, char *, int, int, int, int, int); static int show_text (CT, int, int); static int show_multi (CT, int, int); static int show_multi_internal (CT, int, int); static int show_multi_aux (CT, int, int, char *); static int show_message_rfc822 (CT, int, int); static int show_partial (CT, int, int); static int show_external (CT, int, int); static void intrser (int); /* * Top level entry point to show/display a group of messages */ void show_all_messages (CT *cts) { CT ct, *ctp; /* * If form is not specified, then get default form * for showing headers of MIME messages. */ if (!formsw) formsw = getcpy (etcpath ("mhl.headers")); /* * If form is "mhl.null", suppress display of header. */ if (!strcmp (formsw, "mhl.null")) formsw = NULL; for (ctp = cts; *ctp; ctp++) { ct = *ctp; /* if top-level type is ok, then display message */ if (type_ok (ct, 1)) show_single_message (ct, formsw); } } /* * Entry point to show/display a single message */ static void show_single_message (CT ct, char *form) { sigset_t set, oset; int status; /* Allow user executable bit so that temporary directories created by * the viewer (e.g., lynx) are going to be accessible */ umask (ct->c_umask & ~(0100)); /* * If you have a format file, then display * the message headers. */ if (form) DisplayMsgHeader(ct, form); else xpid = 0; /* Show the body of the message */ show_switch (ct, 1, 0); if (ct->c_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } if (ct->c_ceclosefnx) (*ct->c_ceclosefnx) (ct); /* block a few signals */ sigemptyset (&set); sigaddset (&set, SIGHUP); sigaddset (&set, SIGINT); sigaddset (&set, SIGQUIT); sigaddset (&set, SIGTERM); sigprocmask (SIG_BLOCK, &set, &oset); while (wait (&status) != NOTOK) { pidcheck (status); continue; } /* reset the signal mask */ sigprocmask (SIG_SETMASK, &oset, &set); xpid = 0; flush_errors (); } /* * Use the mhlproc to show the header fields */ static void DisplayMsgHeader (CT ct, char *form) { pid_t child_id; int i, vecp; char *vec[8]; vecp = 0; vec[vecp++] = r1bindex (mhlproc, '/'); vec[vecp++] = "-form"; vec[vecp++] = form; vec[vecp++] = "-nobody"; vec[vecp++] = ct->c_file; /* * If we've specified -(no)moreproc, * then just pass that along. */ if (nomore) { vec[vecp++] = "-nomoreproc"; } else if (progsw) { vec[vecp++] = "-moreproc"; vec[vecp++] = progsw; } vec[vecp] = NULL; fflush (stdout); for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: adios ("fork", "unable to"); /* NOTREACHED */ case OK: execvp (mhlproc, vec); fprintf (stderr, "unable to exec "); perror (mhlproc); _exit (-1); /* NOTREACHED */ default: xpid = -child_id; break; } } /* * Switching routine. Call the correct routine * based on content type. */ static int show_switch (CT ct, int serial, int alternate) { switch (ct->c_type) { case CT_MULTIPART: return show_multi (ct, serial, alternate); break; case CT_MESSAGE: switch (ct->c_subtype) { case MESSAGE_PARTIAL: return show_partial (ct, serial, alternate); break; case MESSAGE_EXTERNAL: return show_external (ct, serial, alternate); break; case MESSAGE_RFC822: default: return show_message_rfc822 (ct, serial, alternate); break; } break; case CT_TEXT: return show_text (ct, serial, alternate); break; case CT_AUDIO: case CT_IMAGE: case CT_VIDEO: case CT_APPLICATION: return show_content (ct, serial, alternate); break; default: adios (NULL, "unknown content type %d", ct->c_type); break; } return 0; /* NOT REACHED */ } /* * Generic method for displaying content */ static int show_content (CT ct, int serial, int alternate) { char *cp, buffer[BUFSIZ]; CI ci = &ct->c_ctinfo; /* Check for mhn-show-type/subtype */ snprintf (buffer, sizeof(buffer), "%s-show-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); if ((cp = context_find (buffer)) && *cp != '\0') return show_content_aux (ct, serial, alternate, cp, NULL); /* Check for mhn-show-type */ snprintf (buffer, sizeof(buffer), "%s-show-%s", invo_name, ci->ci_type); if ((cp = context_find (buffer)) && *cp != '\0') return show_content_aux (ct, serial, alternate, cp, NULL); if ((cp = ct->c_showproc)) return show_content_aux (ct, serial, alternate, cp, NULL); /* complain if we are not a part of a multipart/alternative */ if (!alternate) content_error (NULL, ct, "don't know how to display content"); return NOTOK; } /* * Parse the display string for displaying generic content */ int show_content_aux (CT ct, int serial, int alternate, char *cp, char *cracked) { int fd, len, buflen, quoted; int xstdin, xlist, xpause, xtty; char *bp, *pp, *file, buffer[BUFSIZ]; CI ci = &ct->c_ctinfo; if (!ct->c_ceopenfnx) { if (!alternate) content_error (NULL, ct, "don't know how to decode content"); return NOTOK; } file = NULL; if ((fd = (*ct->c_ceopenfnx) (ct, &file)) == NOTOK) return NOTOK; if (ct->c_showproc && !strcmp (ct->c_showproc, "true")) return (alternate ? DONE : OK); xlist = 0; xpause = 0; xstdin = 0; xtty = 0; if (cracked) { strncpy (buffer, cp, sizeof(buffer)); goto got_command; } /* get buffer ready to go */ bp = buffer; buflen = sizeof(buffer) - 1; bp[0] = bp[buflen] = '\0'; quoted = 0; /* Now parse display string */ for ( ; *cp && buflen > 0; cp++) { if (*cp == '%') { pp = bp; switch (*++cp) { case 'a': /* insert parameters from Content-Type field */ { char **ap, **ep; char *s = ""; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { snprintf (bp, buflen, "%s%s=\"%s\"", s, *ap, *ep); len = strlen (bp); bp += len; buflen -= len; s = " "; } } break; case 'd': /* insert content description */ if (ct->c_descr) { char *s; s = trimcpy (ct->c_descr); strncpy (bp, s, buflen); free (s); } break; case 'e': /* exclusive execution */ xtty = 1; break; case 'F': /* %e, %f, and stdin is terminal not content */ xstdin = 1; xtty = 1; /* and fall... */ case 'f': /* insert filename containing content */ snprintf (bp, buflen, "'%s'", file); /* since we've quoted the file argument, set things up * to look past it, to avoid problems with the quoting * logic below. (I know, I should figure out what's * broken with the quoting logic, but..) */ len = strlen(bp); buflen -= len; bp += len; pp = bp; break; case 'p': /* %l, and pause prior to displaying content */ xpause = pausesw; /* and fall... */ case 'l': /* display listing prior to displaying content */ xlist = !nolist; break; case 's': /* insert subtype of content */ strncpy (bp, ci->ci_subtype, buflen); break; case '%': /* insert character % */ goto raw; default: *bp++ = *--cp; *bp = '\0'; buflen--; continue; } len = strlen (bp); bp += len; buflen -= len; /* Did we actually insert something? */ if (bp != pp) { /* Insert single quote if not inside quotes already */ if (!quoted && buflen) { len = strlen (pp); memmove (pp + 1, pp, len); *pp++ = '\''; buflen--; bp++; } /* Escape existing quotes */ while ((pp = strchr (pp, '\'')) && buflen > 3) { len = strlen (pp++); memmove (pp + 3, pp, len); *pp++ = '\\'; *pp++ = '\''; *pp++ = '\''; buflen -= 3; bp += 3; } /* If pp is still set, that means we ran out of space. */ if (pp) buflen = 0; if (!quoted && buflen) { *bp++ = '\''; *bp = '\0'; buflen--; } } } else { raw: *bp++ = *cp; *bp = '\0'; buflen--; if (*cp == '\'') quoted = !quoted; } } if (buflen <= 0 || (ct->c_termproc && (size_t) buflen <= strlen(ct->c_termproc))) { /* content_error would provide a more useful error message * here, except that if we got overrun, it probably would * too. */ fprintf(stderr, "Buffer overflow constructing show command!\n"); return NOTOK; } /* use charset string to modify display method */ if (ct->c_termproc) { char term[BUFSIZ]; strncpy (term, buffer, sizeof(term)); snprintf (buffer, sizeof(buffer), ct->c_termproc, term); } got_command: return show_content_aux2 (ct, serial, alternate, cracked, buffer, fd, xlist, xpause, xstdin, xtty); } /* * Routine to actually display the content */ static int show_content_aux2 (CT ct, int serial, int alternate, char *cracked, char *buffer, int fd, int xlist, int xpause, int xstdin, int xtty) { pid_t child_id; int i; char *vec[4], exec[BUFSIZ + sizeof "exec "]; if (debugsw || cracked) { fflush (stdout); fprintf (stderr, "%s msg %s", cracked ? "storing" : "show", ct->c_file); if (ct->c_partno) fprintf (stderr, " part %s", ct->c_partno); if (cracked) fprintf (stderr, " using command (cd %s; %s)\n", cracked, buffer); else fprintf (stderr, " using command %s\n", buffer); } if (xpid < 0 || (xtty && xpid)) { if (xpid < 0) xpid = -xpid; pidcheck(pidwait (xpid, NOTOK)); xpid = 0; } if (xlist) { char prompt[BUFSIZ]; if (ct->c_type == CT_MULTIPART) list_content (ct, -1, 1, 0, 0); else list_switch (ct, -1, 1, 0, 0); if (xpause && isatty (fileno (stdout))) { int intr; SIGNAL_HANDLER istat; if (SOprintf ("Press to show content...")) printf ("Press to show content..."); istat = SIGNAL (SIGINT, intrser); if ((intr = sigsetjmp (intrenv, 1)) == OK) { fflush (stdout); prompt[0] = 0; read (fileno (stdout), prompt, sizeof(prompt)); } SIGNAL (SIGINT, istat); if (intr != OK || prompt[0] == 'n') { (*ct->c_ceclosefnx) (ct); return (alternate ? DONE : NOTOK); } if (prompt[0] == 'q') done(OK); } } snprintf (exec, sizeof(exec), "exec %s", buffer); vec[0] = "/bin/sh"; vec[1] = "-c"; vec[2] = exec; vec[3] = NULL; fflush (stdout); for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: advise ("fork", "unable to"); (*ct->c_ceclosefnx) (ct); return NOTOK; case OK: if (cracked) chdir (cracked); if (!xstdin) dup2 (fd, 0); close (fd); execvp ("/bin/sh", vec); fprintf (stderr, "unable to exec "); perror ("/bin/sh"); _exit (-1); /* NOTREACHED */ default: if (!serial) { ct->c_pid = child_id; if (xtty) xpid = child_id; } else { pidcheck (pidXwait (child_id, NULL)); } if (fd != NOTOK) (*ct->c_ceclosefnx) (ct); return (alternate ? DONE : OK); } } /* * show content of type "text" */ static int show_text (CT ct, int serial, int alternate) { char *cp, buffer[BUFSIZ]; CI ci = &ct->c_ctinfo; /* Check for mhn-show-type/subtype */ snprintf (buffer, sizeof(buffer), "%s-show-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); if ((cp = context_find (buffer)) && *cp != '\0') return show_content_aux (ct, serial, alternate, cp, NULL); /* Check for mhn-show-type */ snprintf (buffer, sizeof(buffer), "%s-show-%s", invo_name, ci->ci_type); if ((cp = context_find (buffer)) && *cp != '\0') return show_content_aux (ct, serial, alternate, cp, NULL); /* * Use default method if content is text/plain, or if * if it is not a text part of a multipart/alternative */ if (!alternate || ct->c_subtype == TEXT_PLAIN) { snprintf (buffer, sizeof(buffer), "%%p%s '%%F'", progsw ? progsw : moreproc && *moreproc ? moreproc : "more"); cp = (ct->c_showproc = add (buffer, NULL)); return show_content_aux (ct, serial, alternate, cp, NULL); } return NOTOK; } /* * show message body of type "multipart" */ static int show_multi (CT ct, int serial, int alternate) { char *cp, buffer[BUFSIZ]; CI ci = &ct->c_ctinfo; /* Check for mhn-show-type/subtype */ snprintf (buffer, sizeof(buffer), "%s-show-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); if ((cp = context_find (buffer)) && *cp != '\0') return show_multi_aux (ct, serial, alternate, cp); /* Check for mhn-show-type */ snprintf (buffer, sizeof(buffer), "%s-show-%s", invo_name, ci->ci_type); if ((cp = context_find (buffer)) && *cp != '\0') return show_multi_aux (ct, serial, alternate, cp); if ((cp = ct->c_showproc)) return show_multi_aux (ct, serial, alternate, cp); /* * Use default method to display this multipart content * if it is not a (nested) part of a multipart/alternative, * or if it is one of the known subtypes of multipart. */ if (!alternate || ct->c_subtype != MULTI_UNKNOWN) return show_multi_internal (ct, serial, alternate); return NOTOK; } /* * show message body of subtypes of multipart that * we understand directly (mixed, alternate, etc...) */ static int show_multi_internal (CT ct, int serial, int alternate) { int alternating, nowalternate, nowserial, result; struct multipart *m = (struct multipart *) ct->c_ctparams; struct part *part; CT p; sigset_t set, oset; alternating = 0; nowalternate = alternate; if (ct->c_subtype == MULTI_PARALLEL) { nowserial = serialsw; } else if (ct->c_subtype == MULTI_ALTERNATE) { nowalternate = 1; alternating = 1; nowserial = serial; } else { /* * multipart/mixed * mutlipart/digest * unknown subtypes of multipart (treat as mixed per rfc2046) */ nowserial = serial; } /* block a few signals */ if (!nowserial) { sigemptyset (&set); sigaddset (&set, SIGHUP); sigaddset (&set, SIGINT); sigaddset (&set, SIGQUIT); sigaddset (&set, SIGTERM); sigprocmask (SIG_BLOCK, &set, &oset); } /* * alternate -> we are a part inside an multipart/alternative * alternating -> we are a multipart/alternative */ result = alternate ? NOTOK : OK; for (part = m->mp_parts; part; part = part->mp_next) { p = part->mp_part; if (part_ok (p, 1) && type_ok (p, 1)) { int inneresult; inneresult = show_switch (p, nowserial, nowalternate); switch (inneresult) { case NOTOK: if (alternate && !alternating) { result = NOTOK; goto out; } continue; case OK: case DONE: if (alternating) { result = DONE; break; } if (alternate) { alternate = nowalternate = 0; if (result == NOTOK) result = inneresult; } continue; } break; } } if (alternating && !part) { if (!alternate) content_error (NULL, ct, "don't know how to display any of the contents"); result = NOTOK; goto out; } if (serial && !nowserial) { pid_t pid; int kids; int status; kids = 0; for (part = m->mp_parts; part; part = part->mp_next) { p = part->mp_part; if (p->c_pid > OK) { if (kill (p->c_pid, 0) == NOTOK) p->c_pid = 0; else kids++; } } while (kids > 0 && (pid = wait (&status)) != NOTOK) { pidcheck (status); for (part = m->mp_parts; part; part = part->mp_next) { p = part->mp_part; if (xpid == pid) xpid = 0; if (p->c_pid == pid) { p->c_pid = 0; kids--; break; } } } } out: if (!nowserial) { /* reset the signal mask */ sigprocmask (SIG_SETMASK, &oset, &set); } return result; } /* * Parse display string for multipart content * and use external program to display it. */ static int show_multi_aux (CT ct, int serial, int alternate, char *cp) { int len, buflen, quoted; int xlist, xpause, xtty; char *bp, *pp, *file, buffer[BUFSIZ]; struct multipart *m = (struct multipart *) ct->c_ctparams; struct part *part; CI ci = &ct->c_ctinfo; CT p; for (part = m->mp_parts; part; part = part->mp_next) { p = part->mp_part; if (!p->c_ceopenfnx) { if (!alternate) content_error (NULL, p, "don't know how to decode content"); return NOTOK; } if (p->c_storage == NULL) { file = NULL; if ((*p->c_ceopenfnx) (p, &file) == NOTOK) return NOTOK; /* I'm not sure if this is necessary? */ p->c_storage = add (file, NULL); if (p->c_showproc && !strcmp (p->c_showproc, "true")) return (alternate ? DONE : OK); (*p->c_ceclosefnx) (p); } } xlist = 0; xpause = 0; xtty = 0; /* get buffer ready to go */ bp = buffer; buflen = sizeof(buffer) - 1; bp[0] = bp[buflen] = '\0'; quoted = 0; /* Now parse display string */ for ( ; *cp && buflen > 0; cp++) { if (*cp == '%') { pp = bp; switch (*++cp) { case 'a': /* insert parameters from Content-Type field */ { char **ap, **ep; char *s = ""; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { snprintf (bp, buflen, "%s%s=\"%s\"", s, *ap, *ep); len = strlen (bp); bp += len; buflen -= len; s = " "; } } break; case 'd': /* insert content description */ if (ct->c_descr) { char *s; s = trimcpy (ct->c_descr); strncpy (bp, s, buflen); free (s); } break; case 'e': /* exclusive execution */ xtty = 1; break; case 'F': /* %e and %f */ xtty = 1; /* and fall... */ case 'f': /* insert filename(s) containing content */ { char *s = ""; for (part = m->mp_parts; part; part = part->mp_next) { p = part->mp_part; snprintf (bp, buflen, "%s'%s'", s, p->c_storage); len = strlen (bp); bp += len; buflen -= len; s = " "; } /* set our starting pointer back to bp, to avoid * requoting the filenames we just added */ pp = bp; } break; case 'p': /* %l, and pause prior to displaying content */ xpause = pausesw; /* and fall... */ case 'l': /* display listing prior to displaying content */ xlist = !nolist; break; case 's': /* insert subtype of content */ strncpy (bp, ci->ci_subtype, buflen); break; case '%': /* insert character % */ goto raw; default: *bp++ = *--cp; *bp = '\0'; buflen--; continue; } len = strlen (bp); bp += len; buflen -= len; /* Did we actually insert something? */ if (bp != pp) { /* Insert single quote if not inside quotes already */ if (!quoted && buflen) { len = strlen (pp); memmove (pp + 1, pp, len); *pp++ = '\''; buflen--; bp++; } /* Escape existing quotes */ while ((pp = strchr (pp, '\'')) && buflen > 3) { len = strlen (pp++); memmove (pp + 3, pp, len); *pp++ = '\\'; *pp++ = '\''; *pp++ = '\''; buflen -= 3; bp += 3; } /* If pp is still set, that means we ran out of space. */ if (pp) buflen = 0; if (!quoted && buflen) { *bp++ = '\''; *bp = '\0'; buflen--; } } } else { raw: *bp++ = *cp; *bp = '\0'; buflen--; if (*cp == '\'') quoted = !quoted; } } if (buflen <= 0 || (ct->c_termproc && (size_t) buflen <= strlen(ct->c_termproc))) { /* content_error would provide a more useful error message * here, except that if we got overrun, it probably would * too. */ fprintf(stderr, "Buffer overflow constructing show command!\n"); return NOTOK; } /* use charset string to modify display method */ if (ct->c_termproc) { char term[BUFSIZ]; strncpy (term, buffer, sizeof(term)); snprintf (buffer, sizeof(buffer), ct->c_termproc, term); } return show_content_aux2 (ct, serial, alternate, NULL, buffer, NOTOK, xlist, xpause, 0, xtty); } /* * show content of type "message/rfc822" */ static int show_message_rfc822 (CT ct, int serial, int alternate) { char *cp, buffer[BUFSIZ]; CI ci = &ct->c_ctinfo; /* Check for mhn-show-type/subtype */ snprintf (buffer, sizeof(buffer), "%s-show-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); if ((cp = context_find (buffer)) && *cp != '\0') return show_content_aux (ct, serial, alternate, cp, NULL); /* Check for mhn-show-type */ snprintf (buffer, sizeof(buffer), "%s-show-%s", invo_name, ci->ci_type); if ((cp = context_find (buffer)) && *cp != '\0') return show_content_aux (ct, serial, alternate, cp, NULL); if ((cp = ct->c_showproc)) return show_content_aux (ct, serial, alternate, cp, NULL); /* default method for message/rfc822 */ if (ct->c_subtype == MESSAGE_RFC822) { cp = (ct->c_showproc = add ("%pshow -file '%F'", NULL)); return show_content_aux (ct, serial, alternate, cp, NULL); } /* complain if we are not a part of a multipart/alternative */ if (!alternate) content_error (NULL, ct, "don't know how to display content"); return NOTOK; } /* * Show content of type "message/partial". */ static int show_partial (CT ct, int serial, int alternate) { NMH_UNUSED (serial); NMH_UNUSED (alternate); content_error (NULL, ct, "in order to display this message, you must reassemble it"); return NOTOK; } /* * Show content of type "message/external". * * THE ERROR CHECKING IN THIS ONE IS NOT DONE YET. */ static int show_external (CT ct, int serial, int alternate) { struct exbody *e = (struct exbody *) ct->c_ctparams; CT p = e->eb_content; if (!type_ok (p, 0)) return OK; return show_switch (p, serial, alternate); #if 0 content_error (NULL, p, "don't know how to display content"); return NOTOK; #endif } static void intrser (int i) { NMH_UNUSED (i); putchar ('\n'); siglongjmp (intrenv, DONE); } nmh-1.5/uip/mhstore.c000644 007761 000765 00000020763 11765267273 014544 0ustar00kenhkenh000000 000000 /* * mhstore.c -- store the contents of MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include static struct swit switches[] = { #define AUTOSW 0 { "auto", 0 }, #define NAUTOSW 1 { "noauto", 0 }, #define CHECKSW 2 { "check", 0 }, #define NCHECKSW 3 { "nocheck", 0 }, #define VERBSW 4 { "verbose", 0 }, #define NVERBSW 5 { "noverbose", 0 }, #define FILESW 6 /* interface from show */ { "file file", 0 }, #define PARTSW 7 { "part number", 0 }, #define TYPESW 8 { "type content", 0 }, #define RCACHESW 9 { "rcache policy", 0 }, #define WCACHESW 10 { "wcache policy", 0 }, #define VERSIONSW 11 { "version", 0 }, #define HELPSW 12 { "help", 0 }, /* * switches for debugging */ #define DEBUGSW 13 { "debug", -5 }, { NULL, 0 } }; /* mhparse.c */ extern char *tmp; /* directory to place temp files */ /* mhcachesbr.c */ extern int rcachesw; extern int wcachesw; extern char *cache_public; extern char *cache_private; /* mhstoresbr.c */ extern int autosw; extern char *cwd; /* cache current working directory */ /* mhmisc.c */ extern int npart; extern int ntype; extern char *parts[NPARTS + 1]; extern char *types[NTYPES + 1]; extern int userrs; int debugsw = 0; int verbosw = 0; #define quitser pipeser /* mhparse.c */ CT parse_mime (char *); /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void flush_errors (void); /* mhstoresbr.c */ void store_all_messages (CT *); /* mhfree.c */ void free_content (CT); extern CT *cts; void freects_done (int) NORETURN; /* * static prototypes */ static void pipeser (int); int main (int argc, char **argv) { int msgnum, *icachesw; char *cp, *file = NULL, *folder = NULL; char *maildir, buf[100], **argp; char **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp = NULL; CT ct, *ctp; FILE *fp; done=freects_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case AUTOSW: autosw++; continue; case NAUTOSW: autosw = 0; continue; case RCACHESW: icachesw = &rcachesw; goto do_cache; case WCACHESW: icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, caches)) { case AMBIGSW: ambigsw (cp, caches); done (1); case UNKWNSW: adios (NULL, "%s unknown", cp); default: break; } continue; case CHECKSW: checksw++; continue; case NCHECKSW: checksw = 0; continue; case PARTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (npart >= NPARTS) adios (NULL, "too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (ntype >= NTYPES) adios (NULL, "too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios (NULL, "missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; case VERBSW: verbosw = 1; continue; case NVERBSW: verbosw = 0; continue; case DEBUGSW: debugsw = 1; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } /* null terminate the list of acceptable parts/types */ parts[npart] = NULL; types[ntype] = NULL; set_endian (); /* * Check if we've specified an additional profile */ if ((cp = getenv ("MHSTORE"))) { if ((fp = fopen (cp, "r"))) { readconfig ((struct node **) 0, fp, cp, 0); fclose (fp); } else { admonish ("", "unable to read $MHSTORE profile (%s)", cp); } } /* * Read the standard profile setup */ if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) { readconfig ((struct node **) 0, fp, cp, 0); fclose (fp); } /* Check for public cache location */ if ((cache_public = context_find (nmhcache)) && *cache_public != '/') cache_public = NULL; /* Check for private cache location */ if (!(cache_private = context_find (nmhprivcache))) cache_private = ".cache"; cache_private = getcpy (m_maildir (cache_private)); /* * Cache the current directory before we do any chdirs()'s. */ cwd = getcpy (pwd()); /* * Check for storage directory. If specified, * then store temporary files there. Else we * store them in standard nmh directory. */ if ((cp = context_find (nmhstorage)) && *cp) tmp = concat (cp, "/", invo_name, NULL); else tmp = add (m_maildir (invo_name), NULL); if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && msgs.size) adios (NULL, "cannot specify msg and file at same time!"); /* * check if message is coming from file */ if (file) { if (!(cts = (CT *) calloc ((size_t) 2, sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; if ((ct = parse_mime (file))) *ctp++ = ct; } else { /* * message(s) are coming from a folder */ if (!msgs.size) app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ if (!(cts = (CT *) calloc ((size_t) (mp->numsel + 1), sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { char *msgnam; msgnam = m_name (msgnum); if ((ct = parse_mime (msgnam))) *ctp++ = ct; } } } if (!*cts) done (1); userrs = 1; SIGNAL (SIGQUIT, quitser); SIGNAL (SIGPIPE, pipeser); /* * Get the associated umask for the relevant contents. */ for (ctp = cts; *ctp; ctp++) { struct stat st; ct = *ctp; if (type_ok (ct, 1) && !ct->c_umask) { if (stat (ct->c_file, &st) != NOTOK) ct->c_umask = ~(st.st_mode & 0777); else ct->c_umask = ~m_gmprot(); } } /* * Store the message content */ store_all_messages (cts); /* Now free all the structures for the content */ for (ctp = cts; *ctp; ctp++) free_content (*ctp); free ((char *) cts); cts = NULL; /* If reading from a folder, do some updating */ if (mp) { context_replace (pfolder, folder);/* update current folder */ seq_setcur (mp, mp->hghsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } done (0); return 1; } static void pipeser (int i) { if (i == SIGQUIT) { unlink ("core"); fflush (stdout); fprintf (stderr, "\n"); fflush (stderr); } done (1); /* NOTREACHED */ } nmh-1.5/uip/mhstoresbr.c000644 007761 000765 00000056403 11762736347 015253 0ustar00kenhkenh000000 000000 /* * mhstoresbr.c -- routines to save/store the contents of MIME messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include /* * The list of top-level contents to display */ extern CT *cts; int autosw = 0; /* * Cache of current directory. This must be * set before these routines are called. */ char *cwd; /* * The directory in which to store the contents. */ static char *dir; /* * Type for a compare function for qsort. This keeps * the compiler happy. */ typedef int (*qsort_comp) (const void *, const void *); /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void flush_errors (void); /* mhshowsbr.c */ int show_content_aux (CT, int, int, char *, char *); /* * prototypes */ void store_all_messages (CT *); /* * static prototypes */ static void store_single_message (CT); static int store_switch (CT); static int store_generic (CT); static int store_application (CT); static int store_multi (CT); static int store_partial (CT); static int store_external (CT); static int ct_compar (CT *, CT *); static int store_content (CT, CT); static int output_content_file (CT, int); static int output_content_folder (char *, char *); static int parse_format_string (CT, char *, char *, int, char *); static void get_storeproc (CT); static int copy_some_headers (FILE *, CT); /* * Main entry point to store content * from a collection of messages. */ void store_all_messages (CT *cts) { CT ct, *ctp; char *cp; /* * Check for the directory in which to * store any contents. */ if ((cp = context_find (nmhstorage)) && *cp) dir = getcpy (cp); else dir = getcpy (cwd); for (ctp = cts; *ctp; ctp++) { ct = *ctp; store_single_message (ct); } flush_errors (); } /* * Entry point to store the content * in a (single) message */ static void store_single_message (CT ct) { if (type_ok (ct, 1)) { umask (ct->c_umask); store_switch (ct); if (ct->c_fp) { fclose (ct->c_fp); ct->c_fp = NULL; } if (ct->c_ceclosefnx) (*ct->c_ceclosefnx) (ct); } } /* * Switching routine to store different content types */ static int store_switch (CT ct) { switch (ct->c_type) { case CT_MULTIPART: return store_multi (ct); break; case CT_MESSAGE: switch (ct->c_subtype) { case MESSAGE_PARTIAL: return store_partial (ct); break; case MESSAGE_EXTERNAL: return store_external (ct); case MESSAGE_RFC822: default: return store_generic (ct); break; } break; case CT_APPLICATION: return store_application (ct); break; case CT_TEXT: case CT_AUDIO: case CT_IMAGE: case CT_VIDEO: return store_generic (ct); break; default: adios (NULL, "unknown content type %d", ct->c_type); break; } return OK; /* NOT REACHED */ } /* * Generic routine to store a MIME content. * (audio, video, image, text, message/rfc922) */ static int store_generic (CT ct) { /* * Check if the content specifies a filename. * Don't bother with this for type "message" * (only "message/rfc822" will use store_generic). */ if (autosw && ct->c_type != CT_MESSAGE) get_storeproc (ct); return store_content (ct, NULL); } /* * Store content of type "application" */ static int store_application (CT ct) { char **ap, **ep; CI ci = &ct->c_ctinfo; /* Check if the content specifies a filename */ if (autosw) get_storeproc (ct); /* * If storeproc is not defined, and the content is type * "application/octet-stream", we also check for various * attribute/value pairs which specify if this a tar file. */ if (!ct->c_storeproc && ct->c_subtype == APPLICATION_OCTETS) { int tarP = 0, zP = 0, gzP = 0; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { /* check for "type=tar" attribute */ if (!mh_strcasecmp (*ap, "type")) { if (mh_strcasecmp (*ep, "tar")) break; tarP = 1; continue; } /* check for "conversions=compress" attribute */ if ((!mh_strcasecmp (*ap, "conversions") || !mh_strcasecmp (*ap, "x-conversions")) && (!mh_strcasecmp (*ep, "compress") || !mh_strcasecmp (*ep, "x-compress"))) { zP = 1; continue; } /* check for "conversions=gzip" attribute */ if ((!mh_strcasecmp (*ap, "conversions") || !mh_strcasecmp (*ap, "x-conversions")) && (!mh_strcasecmp (*ep, "gzip") || !mh_strcasecmp (*ep, "x-gzip"))) { gzP = 1; continue; } } if (tarP) { ct->c_showproc = add (zP ? "%euncompress | tar tvf -" : (gzP ? "%egzip -dc | tar tvf -" : "%etar tvf -"), NULL); if (!ct->c_storeproc) { if (autosw) { ct->c_storeproc = add (zP ? "| uncompress | tar xvpf -" : (gzP ? "| gzip -dc | tar xvpf -" : "| tar xvpf -"), NULL); ct->c_umask = 0022; } else { ct->c_storeproc= add (zP ? "%m%P.tar.Z" : (gzP ? "%m%P.tar.gz" : "%m%P.tar"), NULL); } } } } return store_content (ct, NULL); } /* * Store the content of a multipart message */ static int store_multi (CT ct) { int result; struct multipart *m = (struct multipart *) ct->c_ctparams; struct part *part; result = NOTOK; for (part = m->mp_parts; part; part = part->mp_next) { CT p = part->mp_part; if (part_ok (p, 1) && type_ok (p, 1)) { result = store_switch (p); if (result == OK && ct->c_subtype == MULTI_ALTERNATE) break; } } return result; } /* * Reassemble and store the contents of a collection * of messages of type "message/partial". */ static int store_partial (CT ct) { int cur, hi, i; CT p, *ctp, *ctq; CT *base; struct partial *pm, *qm; qm = (struct partial *) ct->c_ctparams; if (qm->pm_stored) return OK; hi = i = 0; for (ctp = cts; *ctp; ctp++) { p = *ctp; if (p->c_type == CT_MESSAGE && p->c_subtype == ct->c_subtype) { pm = (struct partial *) p->c_ctparams; if (!pm->pm_stored && strcmp (qm->pm_partid, pm->pm_partid) == 0) { pm->pm_marked = pm->pm_partno; if (pm->pm_maxno) hi = pm->pm_maxno; pm->pm_stored = 1; i++; } else pm->pm_marked = 0; } } if (hi == 0) { advise (NULL, "missing (at least) last part of multipart message"); return NOTOK; } if ((base = (CT *) calloc ((size_t) (i + 1), sizeof(*base))) == NULL) adios (NULL, "out of memory"); ctq = base; for (ctp = cts; *ctp; ctp++) { p = *ctp; if (p->c_type == CT_MESSAGE && p->c_subtype == ct->c_subtype) { pm = (struct partial *) p->c_ctparams; if (pm->pm_marked) *ctq++ = p; } } *ctq = NULL; if (i > 1) qsort ((char *) base, i, sizeof(*base), (qsort_comp) ct_compar); cur = 1; for (ctq = base; *ctq; ctq++) { p = *ctq; pm = (struct partial *) p->c_ctparams; if (pm->pm_marked != cur) { if (pm->pm_marked == cur - 1) { admonish (NULL, "duplicate part %d of %d part multipart message", pm->pm_marked, hi); continue; } missing_part: advise (NULL, "missing %spart %d of %d part multipart message", cur != hi ? "(at least) " : "", cur, hi); goto losing; } else cur++; } if (hi != --cur) { cur = hi; goto missing_part; } /* * Now cycle through the sorted list of messages of type * "message/partial" and save/append them to a file. */ ctq = base; ct = *ctq++; if (store_content (ct, NULL) == NOTOK) { losing: free ((char *) base); return NOTOK; } for (; *ctq; ctq++) { p = *ctq; if (store_content (p, ct) == NOTOK) goto losing; } free ((char *) base); return OK; } /* * Store content from a message of type "message/external". */ static int store_external (CT ct) { int result = NOTOK; struct exbody *e = (struct exbody *) ct->c_ctparams; CT p = e->eb_content; if (!type_ok (p, 1)) return OK; /* * Check if the parameters for the external body * specified a filename. */ if (autosw) { char *cp; if ((cp = e->eb_name) && *cp != '/' && *cp != '.' && *cp != '|' && *cp != '!' && !strchr (cp, '%')) { if (!ct->c_storeproc) ct->c_storeproc = add (cp, NULL); if (!p->c_storeproc) p->c_storeproc = add (cp, NULL); } } /* * Since we will let the Content structure for the * external body substitute for the current content, * we temporarily change its partno (number inside * multipart), so everything looks right. */ p->c_partno = ct->c_partno; /* we probably need to check if content is really there */ result = store_switch (p); p->c_partno = NULL; return result; } /* * Compare the numbering from two different * message/partials (needed for sorting). */ static int ct_compar (CT *a, CT *b) { struct partial *am = (struct partial *) ((*a)->c_ctparams); struct partial *bm = (struct partial *) ((*b)->c_ctparams); return (am->pm_marked - bm->pm_marked); } /* * Store contents of a message or message part to * a folder, a file, the standard output, or pass * the contents to a command. * * If the current content to be saved is a followup part * to a collection of messages of type "message/partial", * then field "p" is a pointer to the Content structure * to the first message/partial in the group. */ static int store_content (CT ct, CT p) { int appending = 0, msgnum = 0; int is_partial = 0, first_partial = 0; int last_partial = 0; char *cp, buffer[BUFSIZ]; /* * Do special processing for messages of * type "message/partial". * * We first check if this content is of type * "message/partial". If it is, then we need to check * whether it is the first and/or last in the group. * * Then if "p" is a valid pointer, it points to the Content * structure of the first partial in the group. So we copy * the file name and/or folder name from that message. In * this case, we also note that we will be appending. */ if (ct->c_type == CT_MESSAGE && ct->c_subtype == MESSAGE_PARTIAL) { struct partial *pm = (struct partial *) ct->c_ctparams; /* Yep, it's a message/partial */ is_partial = 1; /* But is it the first and/or last in the collection? */ if (pm->pm_partno == 1) first_partial = 1; if (pm->pm_maxno && pm->pm_partno == pm->pm_maxno) last_partial = 1; /* * If "p" is a valid pointer, then it points to the * Content structure for the first message in the group. * So we just copy the filename or foldername information * from the previous iteration of this function. */ if (p) { appending = 1; ct->c_storage = add (p->c_storage, NULL); /* record the folder name */ if (p->c_folder) { ct->c_folder = add (p->c_folder, NULL); } goto got_filename; } } /* * Get storage formatting string. * * 1) If we have storeproc defined, then use that * 2) Else check for a mhn-store-/ entry * 3) Else check for a mhn-store- entry * 4) Else if content is "message", use "+" (current folder) * 5) Else use string "%m%P.%s". */ if ((cp = ct->c_storeproc) == NULL || *cp == '\0') { CI ci = &ct->c_ctinfo; snprintf (buffer, sizeof(buffer), "%s-store-%s/%s", invo_name, ci->ci_type, ci->ci_subtype); if ((cp = context_find (buffer)) == NULL || *cp == '\0') { snprintf (buffer, sizeof(buffer), "%s-store-%s", invo_name, ci->ci_type); if ((cp = context_find (buffer)) == NULL || *cp == '\0') { cp = ct->c_type == CT_MESSAGE ? "+" : "%m%P.%s"; } } } /* * Check the beginning of storage formatting string * to see if we are saving content to a folder. */ if (*cp == '+' || *cp == '@') { char *tmpfilenam, *folder; /* Store content in temporary file for now */ tmpfilenam = m_mktemp(invo_name, NULL, NULL); ct->c_storage = add (tmpfilenam, NULL); /* Get the folder name */ if (cp[1]) folder = pluspath (cp); else folder = getfolder (1); /* Check if folder exists */ create_folder(m_mailpath(folder), 0, exit); /* Record the folder name */ ct->c_folder = add (folder, NULL); if (cp[1]) free (folder); goto got_filename; } /* * Parse and expand the storage formatting string * in `cp' into `buffer'. */ parse_format_string (ct, cp, buffer, sizeof(buffer), dir); /* * If formatting begins with '|' or '!', then pass * content to standard input of a command and return. */ if (buffer[0] == '|' || buffer[0] == '!') return show_content_aux (ct, 1, 0, buffer + 1, dir); /* record the filename */ ct->c_storage = add (buffer, NULL); got_filename: /* flush the output stream */ fflush (stdout); /* Now save or append the content to a file */ if (output_content_file (ct, appending) == NOTOK) return NOTOK; /* * If necessary, link the file into a folder and remove * the temporary file. If this message is a partial, * then only do this if it is the last one in the group. */ if (ct->c_folder && (!is_partial || last_partial)) { msgnum = output_content_folder (ct->c_folder, ct->c_storage); unlink (ct->c_storage); if (msgnum == NOTOK) return NOTOK; } /* * Now print out the name/number of the message * that we are storing. */ if (is_partial) { if (first_partial) fprintf (stderr, "reassembling partials "); if (last_partial) fprintf (stderr, "%s", ct->c_file); else fprintf (stderr, "%s,", ct->c_file); } else { fprintf (stderr, "storing message %s", ct->c_file); if (ct->c_partno) fprintf (stderr, " part %s", ct->c_partno); } /* * Unless we are in the "middle" of group of message/partials, * we now print the name of the file, folder, and/or message * to which we are storing the content. */ if (!is_partial || last_partial) { if (ct->c_folder) { fprintf (stderr, " to folder %s as message %d\n", ct->c_folder, msgnum); } else if (!strcmp(ct->c_storage, "-")) { fprintf (stderr, " to stdout\n"); } else { int cwdlen; cwdlen = strlen (cwd); fprintf (stderr, " as file %s\n", strncmp (ct->c_storage, cwd, cwdlen) || ct->c_storage[cwdlen] != '/' ? ct->c_storage : ct->c_storage + cwdlen + 1); } } return OK; } /* * Output content to a file */ static int output_content_file (CT ct, int appending) { int filterstate; char *file, buffer[BUFSIZ]; long pos, last; FILE *fp; /* * If the pathname is absolute, make sure * all the relevant directories exist. */ if (strchr(ct->c_storage, '/') && make_intermediates (ct->c_storage) == NOTOK) return NOTOK; if (ct->c_encoding != CE_7BIT) { int cc, fd; if (!ct->c_ceopenfnx) { advise (NULL, "don't know how to decode part %s of message %s", ct->c_partno, ct->c_file); return NOTOK; } file = appending || !strcmp (ct->c_storage, "-") ? NULL : ct->c_storage; if ((fd = (*ct->c_ceopenfnx) (ct, &file)) == NOTOK) return NOTOK; if (!strcmp (file, ct->c_storage)) { (*ct->c_ceclosefnx) (ct); return OK; } /* * Send to standard output */ if (!strcmp (ct->c_storage, "-")) { int gd; if ((gd = dup (fileno (stdout))) == NOTOK) { advise ("stdout", "unable to dup"); losing: (*ct->c_ceclosefnx) (ct); return NOTOK; } if ((fp = fdopen (gd, appending ? "a" : "w")) == NULL) { advise ("stdout", "unable to fdopen (%d, \"%s\") from", gd, appending ? "a" : "w"); close (gd); goto losing; } } else { /* * Open output file */ if ((fp = fopen (ct->c_storage, appending ? "a" : "w")) == NULL) { advise (ct->c_storage, "unable to fopen for %s", appending ? "appending" : "writing"); goto losing; } } /* * Filter the header fields of the initial enclosing * message/partial into the file. */ if (ct->c_type == CT_MESSAGE && ct->c_subtype == MESSAGE_PARTIAL) { struct partial *pm = (struct partial *) ct->c_ctparams; if (pm->pm_partno == 1) copy_some_headers (fp, ct); } for (;;) { switch (cc = read (fd, buffer, sizeof(buffer))) { case NOTOK: advise (file, "error reading content from"); break; case OK: break; default: fwrite (buffer, sizeof(*buffer), cc, fp); continue; } break; } (*ct->c_ceclosefnx) (ct); if (cc != NOTOK && fflush (fp)) advise (ct->c_storage, "error writing to"); fclose (fp); return (cc != NOTOK ? OK : NOTOK); } if (!ct->c_fp && (ct->c_fp = fopen (ct->c_file, "r")) == NULL) { advise (ct->c_file, "unable to open for reading"); return NOTOK; } pos = ct->c_begin; last = ct->c_end; fseek (ct->c_fp, pos, SEEK_SET); if (!strcmp (ct->c_storage, "-")) { int gd; if ((gd = dup (fileno (stdout))) == NOTOK) { advise ("stdout", "unable to dup"); return NOTOK; } if ((fp = fdopen (gd, appending ? "a" : "w")) == NULL) { advise ("stdout", "unable to fdopen (%d, \"%s\") from", gd, appending ? "a" : "w"); close (gd); return NOTOK; } } else { if ((fp = fopen (ct->c_storage, appending ? "a" : "w")) == NULL) { advise (ct->c_storage, "unable to fopen for %s", appending ? "appending" : "writing"); return NOTOK; } } /* * Copy a few of the header fields of the initial * enclosing message/partial into the file. */ filterstate = 0; if (ct->c_type == CT_MESSAGE && ct->c_subtype == MESSAGE_PARTIAL) { struct partial *pm = (struct partial *) ct->c_ctparams; if (pm->pm_partno == 1) { copy_some_headers (fp, ct); filterstate = 1; } } while (fgets (buffer, sizeof(buffer) - 1, ct->c_fp)) { if ((pos += strlen (buffer)) > last) { int diff; diff = strlen (buffer) - (pos - last); if (diff >= 0) buffer[diff] = '\0'; } /* * If this is the first content of a group of * message/partial contents, then we only copy a few * of the header fields of the enclosed message. */ if (filterstate) { switch (buffer[0]) { case ' ': case '\t': if (filterstate < 0) buffer[0] = 0; break; case '\n': filterstate = 0; break; default: if (!uprf (buffer, XXX_FIELD_PRF) && !uprf (buffer, VRSN_FIELD) && !uprf (buffer, "Subject:") && !uprf (buffer, "Encrypted:") && !uprf (buffer, "Message-ID:")) { filterstate = -1; buffer[0] = 0; break; } filterstate = 1; break; } } fputs (buffer, fp); if (pos >= last) break; } if (fflush (fp)) advise (ct->c_storage, "error writing to"); fclose (fp); fclose (ct->c_fp); ct->c_fp = NULL; return OK; } /* * Add a file to a folder. * * Return the new message number of the file * when added to the folder. Return -1, if * there is an error. */ static int output_content_folder (char *folder, char *filename) { int msgnum; struct msgs *mp; /* Read the folder. */ if ((mp = folder_read (folder))) { /* Link file into folder */ msgnum = folder_addmsg (&mp, filename, 0, 0, 0, 0, (char *)0); } else { advise (NULL, "unable to read folder %s", folder); return NOTOK; } /* free folder structure */ folder_free (mp); /* * Return msgnum. We are relying on the fact that * msgnum will be -1, if folder_addmsg() had an error. */ return msgnum; } /* * Parse and expand the storage formatting string * pointed to by "cp" into "buffer". */ static int parse_format_string (CT ct, char *cp, char *buffer, int buflen, char *dir) { int len; char *bp; CI ci = &ct->c_ctinfo; /* * If storage string is "-", just copy it, and * return (send content to standard output). */ if (cp[0] == '-' && cp[1] == '\0') { strncpy (buffer, cp, buflen); return 0; } bp = buffer; bp[0] = '\0'; /* * If formatting string is a pathname that doesn't * begin with '/', then preface the path with the * appropriate directory. */ if (*cp != '/' && *cp != '|' && *cp != '!') { snprintf (bp, buflen, "%s/", dir[1] ? dir : ""); len = strlen (bp); bp += len; buflen -= len; } for (; *cp; cp++) { /* We are processing a storage escape */ if (*cp == '%') { switch (*++cp) { case 'a': /* * Insert parameters from Content-Type. * This is only valid for '|' commands. */ if (buffer[0] != '|' && buffer[0] != '!') { *bp++ = *--cp; *bp = '\0'; buflen--; continue; } else { char **ap, **ep; char *s = ""; for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { snprintf (bp, buflen, "%s%s=\"%s\"", s, *ap, *ep); len = strlen (bp); bp += len; buflen -= len; s = " "; } } break; case 'm': /* insert message number */ snprintf (bp, buflen, "%s", r1bindex (ct->c_file, '/')); break; case 'P': /* insert part number with leading dot */ if (ct->c_partno) snprintf (bp, buflen, ".%s", ct->c_partno); break; case 'p': /* insert part number withouth leading dot */ if (ct->c_partno) strncpy (bp, ct->c_partno, buflen); break; case 't': /* insert content type */ strncpy (bp, ci->ci_type, buflen); break; case 's': /* insert content subtype */ strncpy (bp, ci->ci_subtype, buflen); break; case '%': /* insert the character % */ goto raw; default: *bp++ = *--cp; *bp = '\0'; buflen--; continue; } /* Advance bp and decrement buflen */ len = strlen (bp); bp += len; buflen -= len; } else { raw: *bp++ = *cp; *bp = '\0'; buflen--; } } return 0; } /* * Check if the content specifies a filename * in its MIME parameters. */ static void get_storeproc (CT ct) { char **ap, **ep, *cp; CI ci = &ct->c_ctinfo; /* * If the storeproc has already been defined, * we just return (for instance, if this content * is part of a "message/external". */ if (ct->c_storeproc) return; /* * Check the attribute/value pairs, for the attribute "name". * If found, do a few sanity checks and copy the value into * the storeproc. */ for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { if (!mh_strcasecmp (*ap, "name") && *(cp = *ep) != '/' && *cp != '.' && *cp != '|' && *cp != '!' && !strchr (cp, '%')) { ct->c_storeproc = add (cp, NULL); return; } } } /* * Copy some of the header fields of the initial message/partial * message into the header of the reassembled message. */ static int copy_some_headers (FILE *out, CT ct) { HF hp; hp = ct->c_first_hf; /* start at first header field */ while (hp) { /* * A few of the header fields of the enclosing * messages are not copied. */ if (!uprf (hp->name, XXX_FIELD_PRF) && mh_strcasecmp (hp->name, VRSN_FIELD) && mh_strcasecmp (hp->name, "Subject") && mh_strcasecmp (hp->name, "Encrypted") && mh_strcasecmp (hp->name, "Message-ID")) fprintf (out, "%s:%s", hp->name, hp->value); hp = hp->next; /* next header field */ } return OK; } nmh-1.5/uip/mhtest.c000644 007761 000765 00000020475 11765267273 014367 0ustar00kenhkenh000000 000000 /* * mhtest.c -- test harness for MIME routines * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include static struct swit switches[] = { #define CHECKSW 0 { "check", 0 }, #define NCHECKSW 1 { "nocheck", 0 }, #define VERBSW 2 { "verbose", 0 }, #define NVERBSW 3 { "noverbose", 0 }, #define FILESW 4 { "file file", 0 }, #define OUTFILESW 5 { "outfile file", 0 }, #define PARTSW 6 { "part number", 0 }, #define TYPESW 7 { "type content", 0 }, #define RCACHESW 8 { "rcache policy", 0 }, #define WCACHESW 9 { "wcache policy", 0 }, #define VERSIONSW 10 { "version", 0 }, #define HELPSW 11 { "help", 0 }, /* * switches for debugging */ #define DEBUGSW 12 { "debug", -5 }, { NULL, 0 } }; int ebcdicsw = 0; /* hack for linking purposes */ /* mhparse.c */ extern char *tmp; /* directory to place temp files */ /* mhcachesbr.c */ extern int rcachesw; extern int wcachesw; extern char *cache_public; extern char *cache_private; /* mhmisc.c */ extern int npart; extern int ntype; extern char *parts[NPARTS + 1]; extern char *types[NTYPES + 1]; extern int userrs; /* * This is currently needed to keep mhparse happy. * This needs to be changed. */ pid_t xpid = 0; int debugsw = 0; int verbosw = 0; #define quitser pipeser /* mhparse.c */ CT parse_mime (char *); /* mhoutsbr.c */ int output_message (CT, char *); /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); void flush_errors (void); /* mhfree.c */ void free_content (CT); extern CT *cts; void freects_done (int) NORETURN; /* * static prototypes */ static int write_content (CT *, char *); static void pipeser (int); int main (int argc, char **argv) { int msgnum, *icachesw; char *cp, *file = NULL, *folder = NULL; char *maildir, buf[100], *outfile = NULL; char **argp, **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp = NULL; CT ct, *ctp; done=freects_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case RCACHESW: icachesw = &rcachesw; goto do_cache; case WCACHESW: icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, caches)) { case AMBIGSW: ambigsw (cp, caches); done (1); case UNKWNSW: adios (NULL, "%s unknown", cp); default: break; } continue; case CHECKSW: checksw++; continue; case NCHECKSW: checksw = 0; continue; case PARTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (npart >= NPARTS) adios (NULL, "too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (ntype >= NTYPES) adios (NULL, "too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios (NULL, "missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; case OUTFILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) adios (NULL, "missing argument to %s", argp[-2]); outfile = *cp == '-' ? cp : path (cp, TFILE); continue; case VERBSW: verbosw = 1; continue; case NVERBSW: verbosw = 0; continue; case DEBUGSW: debugsw = 1; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } /* null terminate the list of acceptable parts/types */ parts[npart] = NULL; types[ntype] = NULL; set_endian (); if (outfile == NULL) adios (NULL, "must specify output file"); /* Check for public cache location */ if ((cache_public = context_find (nmhcache)) && *cache_public != '/') cache_public = NULL; /* Check for private cache location */ if (!(cache_private = context_find (nmhprivcache))) cache_private = ".cache"; cache_private = getcpy (m_maildir (cache_private)); /* * Check for storage directory. If specified, * then store temporary files there. Else we * store them in standard nmh directory. */ if ((cp = context_find (nmhstorage)) && *cp) tmp = concat (cp, "/", invo_name, NULL); else tmp = add (m_maildir (invo_name), NULL); if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && msgs.size) adios (NULL, "cannot specify msg and file at same time!"); /* * check if message is coming from file */ if (file) { if (!(cts = (CT *) calloc ((size_t) 2, sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; if ((ct = parse_mime (file))) *ctp++ = ct; } else { /* * message(s) are coming from a folder */ if (!msgs.size) app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ if (!(cts = (CT *) calloc ((size_t) (mp->numsel + 1), sizeof(*cts)))) adios (NULL, "out of memory"); ctp = cts; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { char *msgnam; msgnam = m_name (msgnum); if ((ct = parse_mime (msgnam))) *ctp++ = ct; } } } if (!*cts) done (1); userrs = 1; SIGNAL (SIGQUIT, quitser); SIGNAL (SIGPIPE, pipeser); /* * Get the associated umask for the relevant contents. */ for (ctp = cts; *ctp; ctp++) { struct stat st; ct = *ctp; if (type_ok (ct, 1) && !ct->c_umask) { if (stat (ct->c_file, &st) != NOTOK) ct->c_umask = ~(st.st_mode & 0777); else ct->c_umask = ~m_gmprot(); } } /* * Write the content to a file */ write_content (cts, outfile); /* Now free all the structures for the content */ for (ctp = cts; *ctp; ctp++) free_content (*ctp); free ((char *) cts); cts = NULL; /* If reading from a folder, do some updating */ if (mp) { context_replace (pfolder, folder);/* update current folder */ seq_setcur (mp, mp->hghsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } done (0); return 1; } static int write_content (CT *cts, char *outfile) { CT ct, *ctp; for (ctp = cts; *ctp; ctp++) { ct = *ctp; output_message (ct, outfile); } flush_errors (); return OK; } static void pipeser (int i) { if (i == SIGQUIT) { unlink ("core"); fflush (stdout); fprintf (stderr, "\n"); fflush (stderr); } done (1); /* NOTREACHED */ } nmh-1.5/uip/msgchk.c000644 007761 000765 00000020626 11765267273 014335 0ustar00kenhkenh000000 000000 /* * msgchk.c -- check for mail * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #ifndef CYRUS_SASL # define SASLminc(a) (a) #else # define SASLminc(a) 0 #endif static struct swit switches[] = { #define DATESW 0 { "date", 0 }, #define NDATESW 1 { "nodate", 0 }, #define NOTESW 2 { "notify type", 0 }, #define NNOTESW 3 { "nonotify type", 0 }, #define HOSTSW 4 { "host hostname", 0 }, #define USERSW 5 { "user username", 0 }, #define PORTSW 6 { "port name/number", 0 }, #define VERSIONSW 7 { "version", 0 }, #define HELPSW 8 { "help", 0 }, #define SNOOPSW 9 { "snoop", -5 }, #define SASLSW 10 { "sasl", SASLminc(-4) }, #define SASLMECHSW 11 { "saslmech", SASLminc(-5) }, #define PROXYSW 12 { "proxy command", 0 }, { NULL, 0 } }; /* * Maximum numbers of users we can check (plus * one for the NULL vector at the end). */ #define MAXVEC 51 #define NT_NONE 0x0 #ifdef NT_NONE #endif /* Use NT_NONE to prevent warning from gcc -Wunused-macros. */ #define NT_MAIL 0x1 #define NT_NMAI 0x2 #define NT_ALL (NT_MAIL | NT_NMAI) #define NONEOK 0x0 #define UUCPOLD 0x1 #define UUCPNEW 0x2 #define UUCPOK (UUCPOLD | UUCPNEW) #define MMDFOLD 0x4 #define MMDFNEW 0x8 #define MMDFOK (MMDFOLD | MMDFNEW) /* * static prototypes */ static int donote (char *, int); static int checkmail (char *, char *, int, int, int); static int remotemail (char *, char *, char *, char *, int, int, int, int, char *); int main (int argc, char **argv) { int datesw = 1, notifysw = NT_ALL; int status = 0, sasl = 0; int snoop = 0, vecp = 0; char *cp, *host = NULL, *port = NULL, *user, *proxy = NULL; char buf[BUFSIZ], *saslmech = NULL; char **argp, **arguments, *vec[MAXVEC]; struct passwd *pw; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); user = getusername(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; if ((cp = getenv ("MHPOPDEBUG")) && *cp) snoop++; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [users ...]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case DATESW: datesw++; continue; case NDATESW: datesw = 0; continue; case NOTESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); notifysw |= donote (cp, 1); continue; case NNOTESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); notifysw &= ~donote (cp, 0); continue; case HOSTSW: if (!(host = *argp++) || *host == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case PORTSW: if (!(port = *argp++) || *port == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case USERSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (vecp >= MAXVEC-1) adios (NULL, "you can only check %d users at a time", MAXVEC-1); else vec[vecp++] = cp; continue; case SNOOPSW: snoop++; continue; case SASLSW: sasl++; continue; case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case PROXYSW: if (!(proxy = *argp++) || *proxy == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; } } if (vecp >= MAXVEC-1) adios (NULL, "you can only check %d users at a time", MAXVEC-1); else vec[vecp++] = cp; } /* * If -host is not specified by user */ if (!host || !*host) { /* * If "pophost" is specified in mts.conf, * use it as default value. */ if (pophost && *pophost) host = pophost; } if (!host || !*host) host = NULL; if (vecp != 0) vec[vecp] = NULL; if (host) { if (vecp == 0) { status = remotemail (host, port, user, proxy, notifysw, 1, snoop, sasl, saslmech); } else { for (vecp = 0; vec[vecp]; vecp++) status += remotemail (host, port, vec[vecp], proxy, notifysw, 0, snoop, sasl, saslmech); } } else { if (vecp == 0) { char *home; /* Not sure this check makes sense... */ if (!geteuid() || NULL == (home = getenv("HOME"))) { pw = getpwnam (user); if (pw == NULL) adios (NULL, "unable to get information about user"); home = pw->pw_dir; } status = checkmail (user, home, datesw, notifysw, 1); } else { for (vecp = 0; vec[vecp]; vecp++) { if ((pw = getpwnam (vec[vecp]))) status += checkmail (pw->pw_name, pw->pw_dir, datesw, notifysw, 0); else advise (NULL, "no such user as %s", vec[vecp]); } } } /* host == NULL */ done (status); return 1; } static struct swit ntswitches[] = { #define NALLSW 0 { "all", 0 }, #define NMAISW 1 { "mail", 0 }, #define NNMAISW 2 { "nomail", 0 }, { NULL, 0 } }; static int donote (char *cp, int ntflag) { switch (smatch (cp, ntswitches)) { case AMBIGSW: ambigsw (cp, ntswitches); done (1); case UNKWNSW: adios (NULL, "-%snotify %s unknown", ntflag ? "" : "no", cp); case NALLSW: return NT_ALL; case NMAISW: return NT_MAIL; case NNMAISW: return NT_NMAI; } return 0; /* Before 1999-07-15, garbage was returned if control got here. */ } static int checkmail (char *user, char *home, int datesw, int notifysw, int personal) { int mf, status; char buffer[BUFSIZ]; struct stat st; snprintf (buffer, sizeof(buffer), "%s/%s", mmdfldir[0] ? mmdfldir : home, mmdflfil[0] ? mmdflfil : user); if (datesw) { st.st_size = 0; st.st_atime = st.st_mtime = 0; } mf = (stat (buffer, &st) == NOTOK || st.st_size == 0) ? NONEOK : st.st_atime <= st.st_mtime ? MMDFNEW : MMDFOLD; if ((mf & UUCPOK) || (mf & MMDFOK)) { if (notifysw & NT_MAIL) { printf (personal ? "You have " : "%s has ", user); if (mf & UUCPOK) printf ("%s old-style bell", mf & UUCPOLD ? "old" : "new"); if ((mf & UUCPOK) && (mf & MMDFOK)) printf (" and "); if (mf & MMDFOK) printf ("%s%s", mf & MMDFOLD ? "old" : "new", mf & UUCPOK ? " Internet" : ""); printf (" mail waiting"); } else { notifysw = 0; } status = 0; } else { if (notifysw & NT_NMAI) printf (personal ? "You don't %s%s" : "%s doesn't %s", personal ? "" : user, "have any mail waiting"); else notifysw = 0; status = 1; } if (notifysw) if (datesw && st.st_atime) printf ("; last read on %s", dtime (&st.st_atime, 1)); if (notifysw) printf ("\n"); return status; } extern char response[]; static int remotemail (char *host, char *port, char *user, char *proxy, int notifysw, int personal, int snoop, int sasl, char *saslmech) { int nmsgs, nbytes, status; char *pass = NULL; if (user == NULL) user = getusername (); if (sasl) pass = getusername (); else ruserpass (host, &user, &pass); /* open the POP connection */ if (pop_init (host, port, user, pass, proxy, snoop, sasl, saslmech) == NOTOK || pop_stat (&nmsgs, &nbytes) == NOTOK /* check for messages */ || pop_quit () == NOTOK) { /* quit POP connection */ advise (NULL, "%s", response); return 1; } if (nmsgs) { if (notifysw & NT_MAIL) { printf (personal ? "You have " : "%s has ", user); printf ("%d message%s (%d bytes)", nmsgs, nmsgs != 1 ? "s" : "", nbytes); } else notifysw = 0; status = 0; } else { if (notifysw & NT_NMAI) printf (personal ? "You don't %s%s" : "%s doesn't %s", personal ? "" : user, "have any mail waiting"); else notifysw = 0; status = 1; } if (notifysw) printf (" on %s\n", host); return status; } nmh-1.5/uip/msh.c000644 007761 000765 00000131767 11765267273 013661 0ustar00kenhkenh000000 000000 /* * msh.c -- The nmh shell * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ /* * TODO: * Keep more status information in maildrop map */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define QUOTE '\\' /* sigh */ static struct swit switches[] = { #define IDSW 0 { "idstart number", -7 }, /* interface from bbc */ #define FDSW 1 { "idstop number", -6 }, /* .. */ #define QDSW 2 { "idquit number", -6 }, /* .. */ #define NMSW 3 { "idname BBoard", -6 }, /* .. */ #define PRMPTSW 4 { "prompt string", 0 }, #define SCANSW 5 { "scan", 0 }, #define NSCANSW 6 { "noscan", 0 }, #define READSW 7 { "vmhread fd", -7 }, #define WRITESW 8 { "vmhwrite fd", -8 }, #define PREADSW 9 { "popread fd", -7 }, #define PWRITSW 10 { "popwrite fd", -8 }, #define TCURSW 11 { "topcur", 0 }, #define NTCURSW 12 { "notopcur", 0 }, #define VERSIONSW 13 { "version", 0 }, #define HELPSW 14 { "help", 0 }, { NULL, 0 } }; static int mbx_style = MMDF_FORMAT; /* * FOLDER */ char*fmsh = NULL; /* folder instead of file */ int modified; /* command modified folder */ struct msgs *mp; /* used a lot */ static int nMsgs = 0; struct Msg *Msgs = NULL; /* Msgs[0] not used */ static FILE *fp; /* input file */ static FILE *yp = NULL; /* temporary file */ static int mode; /* mode of file */ static int numfds = 0; /* number of files cached */ static int maxfds = 0; /* number of files cached to be cached */ static time_t mtime = (time_t) 0; /* mtime of file */ /* * VMH */ #define ALARM ((unsigned int) 10) #define ttyN(c) ttyNaux ((c), NULL) static int vmh = 0; static int vmhpid = OK; static int vmhfd0; static int vmhfd1; static int vmhfd2; static int vmhtty = NOTOK; #define SCAN 1 #define STATUS 2 #define DISPLAY 3 #define NWIN DISPLAY static int topcur = 0; static int numwins = 0; static int windows[NWIN + 1]; static jmp_buf peerenv; /* * PARENT */ static int pfd = NOTOK; /* fd parent is reading from */ static int ppid = 0; /* pid of parent */ /* * COMMAND */ int interactive; /* running from a /dev/tty */ int redirected; /* re-directing output */ FILE *sp = NULL; /* original stdout */ char *cmd_name; /* command being run */ char myfilter[BUFSIZ]; /* path to mhl.forward */ static char *myprompt = "(%s) ";/* prompting string */ /* * BBOARDS */ static int gap; /* gap in BBoard-ID:s */ static char *myname = NULL; /* BBoard name */ char *BBoard_ID = "BBoard-ID"; /* BBoard-ID constant */ /* * SIGNALS */ SIGNAL_HANDLER istat; /* original SIGINT */ static SIGNAL_HANDLER pstat; /* current SIGPIPE */ SIGNAL_HANDLER qstat; /* original SIGQUIT */ #ifdef SIGTSTP SIGNAL_HANDLER tstat; /* original SIGTSTP */ #endif int interrupted; /* SIGINT detected */ int broken_pipe; /* SIGPIPE detected */ int told_to_quit; /* SIGQUIT detected */ /* * prototypes */ void fsetup (char *); void setup (char *); void readids (int); int readid (int); void display_info (int); int expand (char *); void m_reset (void); void seq_setcur (struct msgs *, int); void padios (char *, char *, ...); void padvise (char *, char *, ...); /* * static prototypes */ static void msh (int); static int read_map (char *, long); static int read_file (long, int); static void m_gMsgs (int); static int check_folder (int); static void scanrange (int, int); static void scanstring (char *); static void write_ids (void); static void quit (void); static int getargs (char *, struct swit *, struct Cmd *); static int getcmds (struct swit *, struct Cmd *, int); static int parse (char *, struct Cmd *); static int init_io (struct Cmd *, int); static int initaux_io (struct Cmd *); static void fin_io (struct Cmd *, int); static void finaux_io (struct Cmd *); static void m_init (void); static void intrser (int); static void pipeser (int); static void quitser (int); static void alrmser (int); static int pINI (void); static int pQRY (char *, int); static int pQRY1 (int); static int pQRY2 (void); static int pCMD (char *, struct swit *, struct Cmd *); static int pFIN (void); static int peerwait (void); static int ttyNaux (struct Cmd *, char *); static int ttyR (struct Cmd *); static int winN (struct Cmd *, int, int); static int winR (struct Cmd *); static int winX (int); int main (int argc, char **argv) { int id = 0, scansw = 0, vmh1 = 0, vmh2 = 0; char *cp, *file = NULL, *folder = NULL; char **argp, **arguments, buf[BUFSIZ]; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc,argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case IDSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((id = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case FDSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((pfd = atoi (cp)) <= 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case QDSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((ppid = atoi (cp)) <= 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case NMSW: if (!(myname = *argp++) || *myname == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case SCANSW: scansw++; continue; case NSCANSW: scansw = 0; continue; case PRMPTSW: if (!(myprompt = *argp++) || *myprompt == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case READSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((vmh1 = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case WRITESW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((vmh2 = atoi (cp)) < 1) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case PREADSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case PWRITSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case TCURSW: topcur++; continue; case NTCURSW: topcur = 0; continue; } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else if (file) adios (NULL, "only one file at a time!"); else file = cp; } if (!file && !folder) file = "./msgbox"; if (file && folder) adios (NULL, "use a file or a folder, not both"); strncpy (myfilter, etcpath (mhlforward), sizeof(myfilter)); #ifdef FIOCLEX if (pfd > 1) ioctl (pfd, FIOCLEX, NULL); #endif /* FIOCLEX */ istat = SIGNAL2 (SIGINT, intrser); qstat = SIGNAL2 (SIGQUIT, quitser); sc_width (); /* MAGIC... */ if ((vmh = vmh1 && vmh2)) { rcinit (vmh1, vmh2); pINI (); SIGNAL (SIGINT, SIG_IGN); SIGNAL (SIGQUIT, SIG_IGN); #ifdef SIGTSTP tstat = SIGNAL (SIGTSTP, SIG_IGN); #endif /* SIGTSTP */ } if (folder) fsetup (folder); else setup (file); readids (id); display_info (id > 0 ? scansw : 0); msh (id > 0 ? scansw : 0); m_reset (); done (0); return 1; } static struct swit mshcmds[] = { #define ADVCMD 0 { "advance", -7 }, #define ALICMD 1 { "ali", 0 }, #define EXPLCMD 2 { "burst", 0 }, #define COMPCMD 3 { "comp", 0 }, #define DISTCMD 4 { "dist", 0 }, #define EXITCMD 5 { "exit", 0 }, #define FOLDCMD 6 { "folder", 0 }, #define FORWCMD 7 { "forw", 0 }, #define HELPCMD 8 { "help", 0 }, #define INCMD 9 { "inc", 0 }, #define MARKCMD 10 { "mark", 0 }, #define MAILCMD 11 { "mhmail", 0 }, #define MHNCMD 12 { "mhn", 0 }, #define MSGKCMD 13 { "msgchk", 0 }, #define NEXTCMD 14 { "next", 0 }, #define PACKCMD 15 { "packf", 0 }, #define PICKCMD 16 { "pick", 0 }, #define PREVCMD 17 { "prev", 0 }, #define QUITCMD 18 { "quit", 0 }, #define FILECMD 19 { "refile", 0 }, #define REPLCMD 20 { "repl", 0 }, #define RMMCMD 21 { "rmm", 0 }, #define SCANCMD 22 { "scan", 0 }, #define SENDCMD 23 { "send", 0 }, #define SHOWCMD 24 { "show", 0 }, #define SORTCMD 25 { "sortm", 0 }, #define WHATCMD 26 { "whatnow", 0 }, #define WHOMCMD 27 { "whom", 0 }, { NULL, 0 } }; static void msh (int scansw) { int i; register char *cp, **ap; char prompt[BUFSIZ], *vec[MAXARGS]; struct Cmd typein; register struct Cmd *cmdp; static int once_only = ADVCMD; snprintf (prompt, sizeof(prompt), myprompt, invo_name); cmdp = &typein; for (;;) { if (yp) { fclose (yp); yp = NULL; } if (vmh) { if ((i = getcmds (mshcmds, cmdp, scansw)) == EOF) { rcdone (); return; } } else { check_folder (scansw); if ((i = getargs (prompt, mshcmds, cmdp)) == EOF) { putchar ('\n'); return; } } cmd_name = mshcmds[i].sw; switch (i) { case QUITCMD: quit (); return; case ADVCMD: if (once_only == ADVCMD) once_only = i = SHOWCMD; else i = mp->curmsg != mp->hghmsg ? NEXTCMD : EXITCMD; cmd_name = mshcmds[i].sw; /* and fall... */ case EXITCMD: case EXPLCMD: case FOLDCMD: case FORWCMD: /* sigh */ case MARKCMD: case NEXTCMD: case PACKCMD: case PICKCMD: case PREVCMD: case RMMCMD: case SHOWCMD: case SCANCMD: case SORTCMD: if ((cp = context_find (cmd_name))) { cp = getcpy (cp); ap = brkstring (cp, " ", "\n"); ap = copyip (ap, vec, MAXARGS); } else { ap = vec; } break; default: cp = NULL; ap = vec; break; } copyip (cmdp->args + 1, ap, MAXARGS); m_init (); if (!vmh && init_io (cmdp, vmh) == NOTOK) { if (cp != NULL) free (cp); continue; } modified = 0; redirected = vmh || cmdp->direction != STDIO; switch (i) { case ALICMD: case COMPCMD: case INCMD: case MAILCMD: case MSGKCMD: case SENDCMD: case WHATCMD: case WHOMCMD: if (!vmh || ttyN (cmdp) != NOTOK) forkcmd (vec, cmd_name); break; case DISTCMD: if (!vmh || ttyN (cmdp) != NOTOK) distcmd (vec); break; case EXPLCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) explcmd (vec); break; case FILECMD: if (!vmh || (filehak (vec) == OK ? ttyN (cmdp) : winN (cmdp, DISPLAY, 1)) != NOTOK) filecmd (vec); break; case FOLDCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) foldcmd (vec); break; case FORWCMD: if (!vmh || ttyN (cmdp) != NOTOK) forwcmd (vec); break; case HELPCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) helpcmd (vec); break; case EXITCMD: case MARKCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) markcmd (vec); break; case MHNCMD: if (!vmh || ttyN (cmdp) != NOTOK) mhncmd (vec); break; case NEXTCMD: case PREVCMD: case SHOWCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) showcmd (vec); break; case PACKCMD: if (!vmh || (packhak (vec) == OK ? ttyN (cmdp) : winN (cmdp, DISPLAY, 1)) != NOTOK) packcmd (vec); break; case PICKCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) pickcmd (vec); break; case REPLCMD: if (!vmh || ttyN (cmdp) != NOTOK) replcmd (vec); break; case RMMCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) rmmcmd (vec); break; case SCANCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) scancmd (vec); break; case SORTCMD: if (!vmh || winN (cmdp, DISPLAY, 1) != NOTOK) sortcmd (vec); break; default: padios (NULL, "no dispatch for %s", cmd_name); } if (vmh) { if (vmhtty != NOTOK) ttyR (cmdp); if (vmhpid > OK) winR (cmdp); } else fin_io (cmdp, vmh); if (cp != NULL) free (cp); if (i == EXITCMD) { quit (); return; } } } void fsetup (char *folder) { register int msgnum; char *maildir; struct stat st; maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) padios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) padios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) padios (NULL, "no messages in %s", folder); mode = m_gmprot (); mtime = stat (mp->foldpath, &st) != NOTOK ? st.st_mtime : 0; m_gMsgs (mp->hghmsg); for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) { Msgs[msgnum].m_bboard_id = 0; Msgs[msgnum].m_top = NOTOK; Msgs[msgnum].m_start = Msgs[msgnum].m_stop = 0L; Msgs[msgnum].m_scanl = NULL; } m_init (); fmsh = getcpy (folder); maxfds = OPEN_MAX / 2; if ((maxfds -= 2) < 1) maxfds = 1; } void setup (char *file) { int i, msgp; struct stat st; if ((fp = fopen (file, "r")) == NULL) padios (file, "unable to read"); #ifdef FIOCLEX ioctl (fileno (fp), FIOCLEX, NULL); #endif /* FIOCLEX */ if (fstat (fileno (fp), &st) != NOTOK) { mode = (int) (st.st_mode & 0777), mtime = st.st_mtime; msgp = read_map (file, (long) st.st_size); } else { mode = m_gmprot (), mtime = 0; msgp = 0; } if ((msgp = read_file (msgp ? Msgs[msgp].m_stop : 0L, msgp + 1)) < 1) padios (NULL, "no messages in %s", myname ? myname : file); if (!(mp = (struct msgs *) calloc ((size_t) 1, sizeof(*mp)))) padios (NULL, "unable to allocate folder storage"); if (!(mp->msgstats = calloc ((size_t) msgp + 3, sizeof(*(mp->msgstats))))) padios (NULL, "unable to allocate message status storage"); mp->hghmsg = msgp; mp->nummsg = msgp; mp->lowmsg = 1; mp->curmsg = 0; mp->foldpath = getcpy (myname ? myname : file); clear_folder_flags (mp); stat (file, &st); if (st.st_uid != getuid () || access (file, W_OK) == NOTOK) set_readonly (mp); mp->lowoff = 1; mp->hghoff = mp->hghmsg + 1; for (i = mp->lowmsg; i <= mp->hghmsg; i++) { clear_msg_flags (mp, i); set_exists (mp, i); } m_init (); mp->msgattrs[0] = getcpy ("unseen"); mp->msgattrs[1] = NULL; m_unknown (fp); /* the MAGIC invocation */ if (fmsh) { free (fmsh); fmsh = NULL; } } static int read_map (char *file, long size) { register int i, msgp; register struct drop *dp, *mp; struct drop *rp; if ((i = map_read (file, size, &rp, 1)) == 0) return 0; m_gMsgs (i); msgp = 1; for (dp = rp + 1; i-- > 0; msgp++, dp++) { mp = &Msgs[msgp].m_drop; mp->d_id = dp->d_id; mp->d_size = dp->d_size; mp->d_start = dp->d_start; mp->d_stop = dp->d_stop; Msgs[msgp].m_scanl = NULL; } free ((char *) rp); return (msgp - 1); } static int read_file (long pos, int msgp) { register int i; register struct drop *dp, *mp; struct drop *rp; if ((i = mbx_read (fp, pos, &rp, 1)) <= 0) return (msgp - 1); m_gMsgs ((msgp - 1) + i); for (dp = rp; i-- > 0; msgp++, dp++) { mp = &Msgs[msgp].m_drop; mp->d_id = 0; mp->d_size = dp->d_size; mp->d_start = dp->d_start; mp->d_stop = dp->d_stop; Msgs[msgp].m_scanl = NULL; } free ((char *) rp); return (msgp - 1); } static void m_gMsgs (int n) { int nmsgs; if (Msgs == NULL) { nMsgs = n + MAXFOLDER / 2; Msgs = (struct Msg *) calloc ((size_t) (nMsgs + 2), sizeof *Msgs); if (Msgs == NULL) padios (NULL, "unable to allocate Msgs structure"); return; } if (nMsgs >= n) return; nmsgs = nMsgs + n + MAXFOLDER / 2; Msgs = (struct Msg *) mh_xrealloc ((char *) Msgs, (size_t) (nmsgs + 2) * sizeof *Msgs); memset((char *) (Msgs + nMsgs + 2), 0, (size_t) ((nmsgs - nMsgs) * sizeof *Msgs)); nMsgs = nmsgs; } FILE * msh_ready (int msgnum, int full) { register int msgp; int fd; char *cp; NMH_UNUSED (full); if (yp) { fclose (yp); yp = NULL; } if (fmsh) { if ((fd = Msgs[msgnum].m_top) == NOTOK) { if (numfds >= maxfds) for (msgp = mp->lowmsg; msgp <= mp->hghmsg; msgp++) if (Msgs[msgp].m_top != NOTOK) { close (Msgs[msgp].m_top); Msgs[msgp].m_top = NOTOK; numfds--; break; } if ((fd = open (cp = m_name (msgnum), O_RDONLY)) == NOTOK) padios (cp, "unable to open message"); Msgs[msgnum].m_top = fd; numfds++; } if ((fd = dup (fd)) == NOTOK) padios ("cached message", "unable to dup"); if ((yp = fdopen (fd, "r")) == NULL) padios (NULL, "unable to fdopen cached message"); fseek (yp, 0L, SEEK_SET); return yp; } m_eomsbr ((int (*)()) 0); /* XXX */ fseek (fp, Msgs[msgnum].m_start, SEEK_SET); return fp; } static int check_folder (int scansw) { int seqnum, i, low, hgh, msgp; struct stat st; if (fmsh) { if (stat (mp->foldpath, &st) == NOTOK) padios (mp->foldpath, "unable to stat"); if (mtime == st.st_mtime) return 0; mtime = st.st_mtime; low = mp->hghmsg + 1; folder_free (mp); /* free folder/message structure */ if (!(mp = folder_read (fmsh))) padios (NULL, "unable to re-read folder %s", fmsh); hgh = mp->hghmsg; for (msgp = mp->lowmsg; msgp <= mp->hghmsg; msgp++) { if (Msgs[msgp].m_top != NOTOK) { close (Msgs[msgp].m_top); Msgs[msgp].m_top = NOTOK; numfds--; } if (Msgs[msgp].m_scanl) { free (Msgs[msgp].m_scanl); Msgs[msgp].m_scanl = NULL; } } m_init (); if (modified || low > hgh) return 1; goto check_vmh; } if (fstat (fileno (fp), &st) == NOTOK) padios (mp->foldpath, "unable to fstat"); if (mtime == st.st_mtime) return 0; mode = (int) (st.st_mode & 0777); mtime = st.st_mtime; if ((msgp = read_file (Msgs[mp->hghmsg].m_stop, mp->hghmsg + 1)) < 1) padios (NULL, "no messages in %s", mp->foldpath); /* XXX */ if (msgp >= MAXFOLDER) padios (NULL, "more than %d messages in %s", MAXFOLDER, mp->foldpath); if (msgp <= mp->hghmsg) return 0; /* XXX */ if (!(mp = folder_realloc (mp, mp->lowoff, msgp))) padios (NULL, "unable to allocate folder storage"); low = mp->hghmsg + 1, hgh = msgp; seqnum = scansw ? seq_getnum (mp, "unseen") : -1; for (i = mp->hghmsg + 1; i <= msgp; i++) { set_exists(mp, i); if (seqnum != -1) add_sequence(mp, seqnum, i); mp->nummsg++; } mp->hghmsg = msgp; m_init (); check_vmh: ; if (vmh) return 1; advise (NULL, "new messages have arrived!\007"); if (scansw) scanrange (low, hgh); return 1; } static void scanrange (int low, int hgh) { char buffer[BUFSIZ]; snprintf (buffer, sizeof(buffer), "%d-%d", low, hgh); scanstring (buffer); } static void scanstring (char *arg) { char *cp, **ap, *vec[MAXARGS]; /* * This should be replace with a call to getarguments() */ if ((cp = context_find (cmd_name = "scan"))) { cp = getcpy (cp); ap = brkstring (cp, " ", "\n"); ap = copyip (ap, vec, MAXARGS); } else { ap = vec; } *ap++ = arg; *ap = NULL; m_init (); scancmd (vec); if (cp != NULL) free (cp); } void readids (int id) { register int cur, seqnum, i=0, msgnum; if (mp->curmsg == 0) seq_setcur (mp, mp->lowmsg); if (id <= 0 || (seqnum = seq_getnum (mp, "unseen")) == -1) return; for (msgnum = mp->hghmsg; msgnum >= mp->lowmsg; msgnum--) add_sequence(mp, seqnum, msgnum); if (id != 1) { cur = mp->curmsg; for (msgnum = mp->hghmsg; msgnum >= mp->lowmsg; msgnum--) if (does_exist(mp, msgnum)) /* FIX */ if ((i = readid (msgnum)) > 0 && i < id) { cur = msgnum + 1; clear_sequence(mp, seqnum, msgnum); break; } for (i = mp->lowmsg; i < msgnum; i++) clear_sequence(mp, seqnum, i); if (cur > mp->hghmsg) cur = mp->hghmsg; seq_setcur (mp, cur); } if ((gap = 1 < id && id < (i = readid (mp->lowmsg)) ? id : 0) && !vmh) advise (NULL, "gap in ID:s, last seen %d, lowest present %d\n", id - 1, i); } int readid (int msgnum) { int i, state; char *bp, buf[BUFSIZ], name[NAMESZ]; register FILE *zp; if (Msgs[msgnum].m_bboard_id) return Msgs[msgnum].m_bboard_id; zp = msh_ready (msgnum, 0); for (state = FLD;;) switch (state = m_getfld (state, name, buf, sizeof(buf), zp)) { case FLD: case FLDEOF: case FLDPLUS: if (!mh_strcasecmp (name, BBoard_ID)) { bp = getcpy (buf); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), zp); bp = add (buf, bp); } i = atoi (bp); free (bp); if (i > 0) return (Msgs[msgnum].m_bboard_id = i); else continue; } while (state == FLDPLUS) state = m_getfld (state, name, buf, sizeof(buf), zp); if (state != FLDEOF) continue; default: return 0; } } void display_info (int scansw) { int seqnum, sd; interactive = isatty (fileno (stdout)); if (sp == NULL) { if ((sd = dup (fileno (stdout))) == NOTOK) padios ("standard output", "unable to dup"); #ifdef FIOCLEX ioctl (sd, FIOCLEX, NULL); #endif /* FIOCLEX */ if ((sp = fdopen (sd, "w")) == NULL) padios ("standard output", "unable to fdopen"); } m_putenv ("mhfolder", mp->foldpath); if (vmh) return; if (myname) { printf ("Reading "); if (SOprintf ("%s", myname)) printf ("%s", myname); printf (", currently at message %d of %d\n", mp->curmsg, mp->hghmsg); } else { printf ("Reading "); if (fmsh) printf ("+%s", fmsh); else printf ("%s", mp->foldpath); printf (", currently at message %d of %d\n", mp->curmsg, mp->hghmsg); } if (((seqnum = seq_getnum (mp, "unseen")) != -1) && scansw && in_sequence(mp, seqnum, mp->hghmsg)) scanstring ("unseen"); } static void write_ids (void) { int i = 0, seqnum, msgnum; char buffer[80]; if (pfd <= 1) return; if ((seqnum = seq_getnum (mp, "unseen")) != -1) for (msgnum = mp->hghmsg; msgnum >= mp->lowmsg; msgnum--) if (!in_sequence(mp, seqnum, msgnum)) { if (Msgs[msgnum].m_bboard_id == 0) readid (msgnum); if ((i = Msgs[msgnum].m_bboard_id) > 0) break; } snprintf (buffer, sizeof(buffer), "%d %d\n", i, Msgs[mp->hghmsg].m_bboard_id); write (pfd, buffer, sizeof(buffer)); close (pfd); pfd = NOTOK; } static void quit (void) { int i, md, msgnum; char *cp, tmpfil[BUFSIZ]; char map1[BUFSIZ], map2[BUFSIZ]; struct stat st; FILE *dp; if (!(mp->msgflags & MODIFIED) || is_readonly(mp) || fmsh) { if (vmh) rc2peer (RC_FIN, 0, NULL); return; } if (vmh) ttyNaux (NULLCMD, "FAST"); cp = NULL; if ((dp = lkfopen (mp->foldpath, "r")) == NULL) { advise (mp->foldpath, "unable to lock"); if (vmh) { ttyR (NULLCMD); pFIN (); } return; } if (fstat (fileno (dp), &st) == NOTOK) { advise (mp->foldpath, "unable to stat"); goto release; } if (mtime != st.st_mtime) { advise (NULL, "new messages have arrived, no update"); goto release; } mode = (int) (st.st_mode & 0777); if (mp->nummsg == 0) { cp = concat ("Zero file \"", mp->foldpath, "\"? ", NULL); if (getanswer (cp)) { if ((i = creat (mp->foldpath, mode)) != NOTOK) close (i); else advise (mp->foldpath, "error zero'ing"); unlink (map_name (mp->foldpath));/* XXX */ } goto release; } cp = concat ("Update file \"", mp->foldpath, "\"? ", NULL); if (!getanswer (cp)) goto release; strncpy (tmpfil, m_backup (mp->foldpath), sizeof(tmpfil)); if ((md = mbx_open (tmpfil, mbx_style, st.st_uid, st.st_gid, mode)) == NOTOK) { advise (tmpfil, "unable to open"); goto release; } for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) if (does_exist(mp, msgnum) && pack (tmpfil, md, msgnum) == NOTOK) { mbx_close (tmpfil, md); unlink (tmpfil); unlink (map_name (tmpfil)); goto release; } mbx_close (tmpfil, md); if (rename (tmpfil, mp->foldpath) == NOTOK) admonish (mp->foldpath, "unable to rename %s to", tmpfil); else { strncpy (map1, map_name (tmpfil), sizeof(map1)); strncpy (map2, map_name (mp->foldpath), sizeof(map2)); if (rename (map1, map2) == NOTOK) { admonish (map2, "unable to rename %s to", map1); unlink (map1); unlink (map2); } } release: ; if (cp) free (cp); lkfclose (dp, mp->foldpath); if (vmh) { ttyR (NULLCMD); pFIN (); } } static int getargs (char *prompt, struct swit *sw, struct Cmd *cmdp) { int i; char *cp; static char buffer[BUFSIZ]; told_to_quit = 0; for (;;) { interrupted = 0; if (interactive) { printf ("%s", prompt); fflush (stdout); } for (cp = buffer; (i = getchar ()) != '\n';) { if (interrupted && !told_to_quit) { buffer[0] = '\0'; putchar ('\n'); break; } if (told_to_quit || i == EOF) { if (ppid > 0) #ifdef SIGEMT kill (ppid, SIGEMT); #else kill (ppid, SIGTERM); #endif return EOF; } if (cp < &buffer[sizeof buffer - 2]) *cp++ = i; } *cp = 0; if (buffer[0] == 0) continue; if (buffer[0] == '?') { printf ("commands:\n"); print_sw (ALL, sw, "", stdout); printf ("type CTRL-D or use ``quit'' to leave %s\n", invo_name); continue; } if (parse (buffer, cmdp) == NOTOK) continue; switch (i = smatch (cmdp->args[0], sw)) { case AMBIGSW: ambigsw (cmdp->args[0], sw); continue; case UNKWNSW: printf ("say what: ``%s'' -- type ? (or help) for help\n", cmdp->args[0]); continue; default: return i; } } } static int getcmds (struct swit *sw, struct Cmd *cmdp, int scansw) { int i; struct record rcs, *rc; rc = &rcs; initrc (rc); for (;;) switch (peer2rc (rc)) { case RC_QRY: pQRY (rc->rc_data, scansw); break; case RC_CMD: if ((i = pCMD (rc->rc_data, sw, cmdp)) != NOTOK) return i; break; case RC_FIN: if (ppid > 0) #ifdef SIGEMT kill (ppid, SIGEMT); #else kill (ppid, SIGTERM); #endif return EOF; case RC_XXX: padios (NULL, "%s", rc->rc_data); default: fmt2peer (RC_ERR, "pLOOP protocol screw-up"); done (1); } } static int parse (char *buffer, struct Cmd *cmdp) { int argp = 0; unsigned char c, *cp; char *pp; cmdp->line[0] = 0; pp = cmdp->args[argp++] = cmdp->line; cmdp->redirect = NULL; cmdp->direction = STDIO; cmdp->stream = NULL; for (cp = buffer; (c = *cp); cp++) { if (!isspace (c)) break; } if (c == '\0') { if (vmh) fmt2peer (RC_EOF, "null command"); return NOTOK; } while ((c = *cp++)) { if (isspace (c)) { while (isspace (c)) c = *cp++; if (c == 0) break; *pp++ = 0; cmdp->args[argp++] = pp; *pp = 0; } switch (c) { case '"': for (;;) { switch (c = *cp++) { case 0: padvise (NULL, "unmatched \""); return NOTOK; case '"': break; case QUOTE: if ((c = *cp++) == 0) goto no_quoting; default: *pp++ = c; continue; } break; } continue; case QUOTE: if ((c = *cp++) == 0) { no_quoting: ; padvise (NULL, "the newline character can not be quoted"); return NOTOK; } default: ; *pp++ = c; continue; case '>': case '|': if (pp == cmdp->line) { padvise (NULL, "invalid null command"); return NOTOK; } if (*cmdp->args[argp - 1] == 0) argp--; cmdp->direction = c == '>' ? CRTIO : PIPIO; if (cmdp->direction == CRTIO && (c = *cp) == '>') { cmdp->direction = APPIO; cp++; } cmdp->redirect = pp + 1;/* sigh */ for (; (c = *cp); cp++) if (!isspace (c)) break; if (c == 0) { padvise (NULL, cmdp->direction != PIPIO ? "missing name for redirect" : "invalid null command"); return NOTOK; } strcpy (cmdp->redirect, cp); if (cmdp->direction != PIPIO) { for (; *cp; cp++) if (isspace (*cp)) { padvise (NULL, "bad name for redirect"); return NOTOK; } if (expand (cmdp->redirect) == NOTOK) return NOTOK; } break; } break; } *pp++ = 0; cmdp->args[argp] = NULL; return OK; } int expand (char *redirect) { char *cp, *pp; char path[BUFSIZ]; struct passwd *pw; if (*redirect != '~') return OK; if ((cp = strchr(pp = redirect + 1, '/'))) *cp++ = 0; if (*pp == 0) pp = mypath; else if ((pw = getpwnam (pp))) pp = pw->pw_dir; else { padvise (NULL, "unknown user: %s", pp); return NOTOK; } snprintf (path, sizeof(path), "%s/%s", pp, cp ? cp : ""); strcpy (redirect, path); return OK; } static int init_io (struct Cmd *cmdp, int vio) { int io, result; io = vmh; vmh = vio; result = initaux_io (cmdp); vmh = io; return result; } static int initaux_io (struct Cmd *cmdp) { char *mode; switch (cmdp->direction) { case STDIO: return OK; case CRTIO: case APPIO: mode = cmdp->direction == CRTIO ? "write" : "append"; if ((cmdp->stream = fopen (cmdp->redirect, mode)) == NULL) { padvise (cmdp->redirect, "unable to %s ", mode); cmdp->direction = STDIO; return NOTOK; } break; case PIPIO: if ((cmdp->stream = popen (cmdp->redirect, "w")) == NULL) { padvise (cmdp->redirect, "unable to pipe"); cmdp->direction = STDIO; return NOTOK; } SIGNAL (SIGPIPE, pipeser); broken_pipe = 0; break; default: padios (NULL, "unknown redirection for command"); } fflush (stdout); if (dup2 (fileno (cmdp->stream), fileno (stdout)) == NOTOK) padios ("standard output", "unable to dup2"); clearerr (stdout); return OK; } static void fin_io (struct Cmd *cmdp, int vio) { int io; io = vmh; vmh = vio; finaux_io (cmdp); vmh = io; } static void finaux_io (struct Cmd *cmdp) { switch (cmdp->direction) { case STDIO: return; case CRTIO: case APPIO: fflush (stdout); close (fileno (stdout)); if (ferror (stdout)) padvise (NULL, "problems writing %s", cmdp->redirect); fclose (cmdp->stream); break; case PIPIO: fflush (stdout); close (fileno (stdout)); pclose (cmdp->stream); SIGNAL (SIGPIPE, SIG_DFL); break; default: padios (NULL, "unknown redirection for command"); } if (dup2 (fileno (sp), fileno (stdout)) == NOTOK) padios ("standard output", "unable to dup2"); clearerr (stdout); cmdp->direction = STDIO; } static void m_init (void) { int msgnum; for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) unset_selected (mp, msgnum); mp->lowsel = mp->hghsel = mp->numsel = 0; } void m_reset (void) { write_ids (); folder_free (mp); /* free folder/message structure */ myname = NULL; } void seq_setcur (struct msgs *mp, int msgnum) { if (mp->curmsg == msgnum) return; if (mp->curmsg && Msgs[mp->curmsg].m_scanl) { free (Msgs[mp->curmsg].m_scanl); Msgs[mp->curmsg].m_scanl = NULL; } if (Msgs[msgnum].m_scanl) { free (Msgs[msgnum].m_scanl); Msgs[msgnum].m_scanl = NULL; } mp->curmsg = msgnum; } static void intrser (int i) { NMH_UNUSED (i); discard (stdout); interrupted++; } static void pipeser (int i) { NMH_UNUSED (i); if (broken_pipe++ == 0) fprintf (stderr, "broken pipe\n"); told_to_quit++; interrupted++; } static void quitser (int i) { NMH_UNUSED (i); told_to_quit++; interrupted++; } static void alrmser (int i) { NMH_UNUSED (i); longjmp (peerenv, DONE); } static int pINI (void) { int i, vrsn; unsigned char *bp; struct record rcs, *rc; rc = &rcs; initrc (rc); switch (peer2rc (rc)) { case RC_INI: bp = rc->rc_data; while (isspace (*bp)) bp++; if (sscanf (bp, "%d", &vrsn) != 1) { bad_init: ; fmt2peer (RC_ERR, "bad init \"%s\"", rc->rc_data); done (1); } if (vrsn != RC_VRSN) { fmt2peer (RC_ERR, "version %d unsupported", vrsn); done (1); } while (*bp && !isspace (*bp)) bp++; while (isspace (*bp)) bp++; if (sscanf (bp, "%d", &numwins) != 1 || numwins <= 0) goto bad_init; if (numwins > NWIN) numwins = NWIN; for (i = 1; i <= numwins; i++) { while (*bp && !isspace (*bp)) bp++; while (isspace (*bp)) bp++; if (sscanf (bp, "%d", &windows[i]) != 1 || windows[i] <= 0) goto bad_init; } rc2peer (RC_ACK, 0, NULL); return OK; case RC_XXX: padios (NULL, "%s", rc->rc_data); default: fmt2peer (RC_ERR, "pINI protocol screw-up"); done (1); /* NOTREACHED */ } return 1; /* dead code to satisfy the compiler */ } static int pQRY (char *str, int scansw) { NMH_UNUSED (str); if (pQRY1 (scansw) == NOTOK || pQRY2 () == NOTOK) return NOTOK; rc2peer (RC_EOF, 0, NULL); return OK; } static int pQRY1 (int scansw) { int oldhgh; static int lastlow = 0, lastcur = 0, lasthgh = 0, lastnum = 0; oldhgh = mp->hghmsg; if (check_folder (scansw) && oldhgh < mp->hghmsg) { switch (winX (STATUS)) { case NOTOK: return NOTOK; case OK: printf ("new messages have arrived!"); fflush (stdout); fflush (stderr); _exit (0); /* NOTREACHED */ default: lastlow = lastcur = lasthgh = lastnum = 0; break; } switch (winX (DISPLAY)) { case NOTOK: return NOTOK; case OK: scanrange (oldhgh + 1, mp->hghmsg); fflush (stdout); fflush (stderr); _exit (0); /* NOTREACHED */ default: break; } return OK; } if (gap) switch (winX (STATUS)) { case NOTOK: return NOTOK; case OK: printf ("%s: gap in ID:s, last seen %d, lowest present %d\n", myname ? myname : fmsh ? fmsh : mp->foldpath, gap - 1, readid (mp->lowmsg)); fflush (stdout); fflush (stderr); _exit (0); /* NOTREACHED */ default: gap = 0; return OK; } if (mp->lowmsg != lastlow || mp->curmsg != lastcur || mp->hghmsg != lasthgh || mp->nummsg != lastnum) switch (winX (STATUS)) { case NOTOK: return NOTOK; case OK: foldcmd (NULL); fflush (stdout); fflush (stderr); _exit (0); /* NOTREACHED */ default: lastlow = mp->lowmsg; lastcur = mp->curmsg; lasthgh = mp->hghmsg; lastnum = mp->nummsg; return OK; } return OK; } static int pQRY2 (void) { int i, j, k, msgnum, n; static int cur = 0, num = 0, lo = 0, hi = 0; if (mp->nummsg == 0 && mp->nummsg != num) switch (winX (SCAN)) { case NOTOK: return NOTOK; case OK: printf ("empty!"); fflush (stdout); fflush (stderr); _exit (0); /* NOTREACHED */ default: num = mp->nummsg; return OK; } num = mp->nummsg; i = 0; j = (k = windows[SCAN]) / 2; for (msgnum = mp->curmsg; msgnum <= mp->hghmsg; msgnum++) if (does_exist (mp, msgnum)) i++; if (i-- > 0) { if (topcur) k = i >= k ? 1 : k - i; else k -= i > j ? j : i; } i = j = 0; n = 1; for (msgnum = mp->curmsg; msgnum >= mp->lowmsg; msgnum--) if (does_exist (mp, msgnum)) { i = msgnum; if (j == 0) j = msgnum; if (n++ >= k) break; } for (msgnum = mp->curmsg + 1; msgnum <= mp->hghmsg; msgnum++) if (does_exist (mp, msgnum)) { if (i == 0) i = msgnum; j = msgnum; if (n++ >= windows[SCAN]) break; } if (!topcur && lo > 0 && hi > 0 && does_exist (mp, lo) && does_exist (mp, hi) && (lo < mp->curmsg || (lo == mp->curmsg && lo == mp->lowmsg)) && (mp->curmsg < hi || (hi == mp->curmsg && hi == mp->hghmsg)) && hi - lo == j - i) i = lo, j = hi; if (mp->curmsg != cur || modified) switch (winN (NULLCMD, SCAN, 0)) { case NOTOK: return NOTOK; case OK: return OK; default: scanrange (lo = i, hi = j); cur = mp->curmsg; winR (NULLCMD); return OK; } return OK; } static int pCMD (char *str, struct swit *sw, struct Cmd *cmdp) { int i; if (*str == '?') switch (winX (DISPLAY)) { case NOTOK: return NOTOK; case OK: printf ("commands:\n"); print_sw (ALL, sw, "", stdout); printf ("type ``quit'' to leave %s\n", invo_name); fflush (stdout); fflush (stderr); _exit (0); /* NOTREACHED */ default: rc2peer (RC_EOF, 0, NULL); return NOTOK; } if (parse (str, cmdp) == NOTOK) return NOTOK; switch (i = smatch (cmdp->args[0], sw)) { case AMBIGSW: switch (winX (DISPLAY)) { case NOTOK: return NOTOK; case OK: ambigsw (cmdp->args[0], sw); fflush (stdout); fflush (stderr); _exit (0); /* NOTREACHED */ default: rc2peer (RC_EOF, 0, NULL); return NOTOK; } case UNKWNSW: fmt2peer (RC_ERR, "say what: ``%s'' -- type ? (or help) for help", cmdp->args[0]); return NOTOK; default: return i; } } static int pFIN (void) { int status; switch (setjmp (peerenv)) { case OK: SIGNAL (SIGALRM, alrmser); alarm (ALARM); status = peerwait (); alarm (0); return status; default: return NOTOK; } } static int peerwait (void) { struct record rcs, *rc; rc = &rcs; initrc (rc); switch (peer2rc (rc)) { case RC_QRY: case RC_CMD: rc2peer (RC_FIN, 0, NULL); return OK; case RC_XXX: advise (NULL, "%s", rc->rc_data); return NOTOK; default: fmt2peer (RC_FIN, "pLOOP protocol screw-up"); return NOTOK; } } static int ttyNaux (struct Cmd *cmdp, char *s) { struct record rcs, *rc; rc = &rcs; initrc (rc); if (cmdp && init_io (cmdp, vmh) == NOTOK) return NOTOK; /* XXX: fseek() too tricky for our own good */ if (!fmsh) fseek (fp, 0L, SEEK_SET); vmhtty = NOTOK; switch (rc2rc (RC_TTY, s ? strlen (s) : 0, s, rc)) { case RC_ACK: vmhtty = OK; /* fall */ case RC_ERR: break; case RC_XXX: padios (NULL, "%s", rc->rc_data);/* NOTREACHED */ default: fmt2peer (RC_ERR, "pTTY protocol screw-up"); done (1); /* NOTREACHED */ } #ifdef SIGTSTP SIGNAL (SIGTSTP, tstat); #endif return vmhtty; } static int ttyR (struct Cmd *cmdp) { struct record rcs, *rc; rc = &rcs; #ifdef SIGTSTP SIGNAL (SIGTSTP, SIG_IGN); #endif if (vmhtty != OK) return NOTOK; initrc (rc); if (cmdp) fin_io (cmdp, 0); vmhtty = NOTOK; switch (rc2rc (RC_EOF, 0, NULL, rc)) { case RC_ACK: rc2peer (RC_EOF, 0, NULL); return OK; case RC_XXX: padios (NULL, "%s", rc->rc_data);/* NOTREACHED */ default: fmt2peer (RC_ERR, "pTTY protocol screw-up"); done (1); /* NOTREACHED */ } return 1; /* dead code to satisfy compiler */ } static int winN (struct Cmd *cmdp, int n, int eof) { int i, pd[2]; char buffer[BUFSIZ]; struct record rcs, *rc; rc = &rcs; if (vmhpid == NOTOK) return OK; initrc (rc); /* XXX: fseek() too tricky for our own good */ if (!fmsh) fseek (fp, 0L, SEEK_SET); vmhpid = OK; snprintf (buffer, sizeof(buffer), "%d", n); switch (str2rc (RC_WIN, buffer, rc)) { case RC_ACK: break; case RC_ERR: return NOTOK; case RC_XXX: padios (NULL, "%s", rc->rc_data); default: fmt2peer (RC_ERR, "pWIN protocol screw-up"); done (1); } if (pipe (pd) == NOTOK) { err2peer (RC_ERR, "pipe", "unable to"); return NOTOK; } switch (vmhpid = fork()) { case NOTOK: err2peer (RC_ERR, "fork", "unable to"); close (pd[0]); close (pd[1]); return NOTOK; case OK: close (pd[1]); SIGNAL (SIGPIPE, SIG_IGN); while ((i = read (pd[0], buffer, sizeof buffer)) > 0) switch (rc2rc (RC_DATA, i, buffer, rc)) { case RC_ACK: break; case RC_ERR: _exit (1); case RC_XXX: advise (NULL, "%s", rc->rc_data); _exit (2); default: fmt2peer (RC_ERR, "pWIN protocol screw-up"); _exit (2); } if (i == OK) switch (rc2rc (RC_EOF, 0, NULL, rc)) { case RC_ACK: if (eof) rc2peer (RC_EOF, 0, NULL); i = 0; break; case RC_XXX: advise (NULL, "%s", rc->rc_data); i = 2; break; default: fmt2peer (RC_ERR, "pWIN protocol screw-up"); i = 2; break; } if (i == NOTOK) err2peer (RC_ERR, "pipe", "error reading from"); close (pd[0]); _exit (i != NOTOK ? i : 1); default: if ((vmhfd0 = dup (fileno (stdin))) == NOTOK) padios ("standard input", "unable to dup"); if ((vmhfd1 = dup (fileno (stdout))) == NOTOK) padios ("standard output", "unable to dup"); if ((vmhfd2 = dup (fileno (stderr))) == NOTOK) padios ("diagnostic output", "unable to dup"); close (0); if ((i = open ("/dev/null", O_RDONLY)) != NOTOK && i != fileno (stdin)) { dup2 (i, fileno (stdin)); close (i); } fflush (stdout); if (dup2 (pd[1], fileno (stdout)) == NOTOK) padios ("standard output", "unable to dup2"); clearerr (stdout); fflush (stderr); if (dup2 (pd[1], fileno (stderr)) == NOTOK) padios ("diagnostic output", "unable to dup2"); clearerr (stderr); if (cmdp && init_io (cmdp, 0) == NOTOK) return NOTOK; pstat = SIGNAL (SIGPIPE, pipeser); broken_pipe = 1; close (pd[0]); close (pd[1]); return vmhpid; } } static int winR (struct Cmd *cmdp) { int status; if (vmhpid <= OK) return NOTOK; if (cmdp) fin_io (cmdp, 0); if (dup2 (vmhfd0, fileno (stdin)) == NOTOK) padios ("standard input", "unable to dup2"); clearerr (stdin); close (vmhfd0); fflush (stdout); if (dup2 (vmhfd1, fileno (stdout)) == NOTOK) padios ("standard output", "unable to dup2"); clearerr (stdout); close (vmhfd1); fflush (stderr); if (dup2 (vmhfd2, fileno (stderr)) == NOTOK) padios ("diagnostic output", "unable to dup2"); clearerr (stderr); close (vmhfd2); SIGNAL (SIGPIPE, pstat); if ((status = pidwait (vmhpid, OK)) == 2) done (1); vmhpid = OK; return (status == 0 ? OK : NOTOK); } static int winX (int n) { int i, pid, pd[2]; char buffer[BUFSIZ]; struct record rcs, *rc; rc = &rcs; initrc (rc); /* XXX: fseek() too tricky for our own good */ if (!fmsh) fseek (fp, 0L, SEEK_SET); snprintf (buffer, sizeof(buffer), "%d", n); switch (str2rc (RC_WIN, buffer, rc)) { case RC_ACK: break; case RC_ERR: return NOTOK; case RC_XXX: padios (NULL, "%s", rc->rc_data); default: fmt2peer (RC_ERR, "pWIN protocol screw-up"); done (1); } if (pipe (pd) == NOTOK) { err2peer (RC_ERR, "pipe", "unable to"); return NOTOK; } switch (pid = fork ()) { case NOTOK: err2peer (RC_ERR, "fork", "unable to"); close (pd[0]); close (pd[1]); return NOTOK; case OK: close (fileno (stdin)); if ((i = open ("/dev/null", O_RDONLY)) != NOTOK && i != fileno (stdin)) { dup2 (i, fileno (stdin)); close (i); } dup2 (pd[1], fileno (stdout)); dup2 (pd[1], fileno (stderr)); close (pd[0]); close (pd[1]); vmhpid = NOTOK; return OK; default: close (pd[1]); while ((i = read (pd[0], buffer, sizeof buffer)) > 0) switch (rc2rc (RC_DATA, i, buffer, rc)) { case RC_ACK: break; case RC_ERR: close (pd[0]); pidwait (pid, OK); return NOTOK; case RC_XXX: padios (NULL, "%s", rc->rc_data); default: fmt2peer (RC_ERR, "pWIN protocol screw-up"); done (1); } if (i == OK) switch (rc2rc (RC_EOF, 0, NULL, rc)) { case RC_ACK: break; case RC_XXX: padios (NULL, "%s", rc->rc_data); default: fmt2peer (RC_ERR, "pWIN protocol screw-up"); done (1); } if (i == NOTOK) err2peer (RC_ERR, "pipe", "error reading from"); close (pd[0]); pidwait (pid, OK); return (i != NOTOK ? pid : NOTOK); } } void padios (char *what, char *fmt, ...) { va_list ap; va_start(ap, fmt); if (vmh) { verr2peer (RC_FIN, what, fmt, ap); rcdone (); } else { advertise (what, NULL, fmt, ap); } va_end(ap); done (1); } void padvise (char *what, char *fmt, ...) { va_list ap; va_start(ap, fmt); if (vmh) { verr2peer (RC_ERR, what, fmt, ap); } else { advertise (what, NULL, fmt, ap); } va_end(ap); } nmh-1.5/uip/mshcmds.c000644 007761 000765 00000177031 11765267273 014522 0ustar00kenhkenh000000 000000 /* * mshcmds.c -- command handlers in msh * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include static char delim3[] = "-------"; /* from burst.c */ static int mhlnum; static FILE *mhlfp; /* * Type for a compare function for qsort. This keeps * the compiler happy. */ typedef int (*qsort_comp) (const void *, const void *); /* * static prototypes */ static int burst (struct Msg *, int, int, int, int); static void forw (char *, char *, int, char **); static void rmm (void); static void show (int); static int eom_action (int); static FILE *mhl_action (char *); static int ask (int); static int is_nontext (int); static int get_fields (char *, char *, int, struct Msg *); static int msgsort (struct Msg *, struct Msg *); static int subsort (struct Msg *, struct Msg *); static char *sosmash (char *, char *); static int process (int, char *, int, char **); static void copy_message (int, FILE *); static void copy_digest (int, FILE *); void forkcmd (char **args, char *pgm) { int child_id; char *vec[MAXARGS]; vec[0] = r1bindex (pgm, '/'); copyip (args, vec + 1, MAXARGS - 1); if (fmsh) { context_del (pfolder); context_replace (pfolder, fmsh);/* update current folder */ seq_save (mp); context_save (); /* save the context file */ } fflush (stdout); switch (child_id = fork ()) { case NOTOK: advise ("fork", "unable to"); return; case OK: closefds (3); SIGNAL (SIGINT, istat); SIGNAL (SIGQUIT, qstat); execvp (pgm, vec); fprintf (stderr, "unable to exec "); perror (cmd_name); _exit (1); default: pidXwait (child_id, NULL); break; } if (fmsh) { /* assume the worst case */ mp->msgflags |= MODIFIED; modified++; } } static struct swit distswit[] = { #define DIANSW 0 { "annotate", 0 }, #define DINANSW 1 { "noannotate", 0 }, #define DIDFSW 2 { "draftfolder +folder", 0 }, #define DIDMSW 3 { "draftmessage msg", 0 }, #define DINDFSW 4 { "nodraftfolder", 0 }, #define DIEDTSW 5 { "editor editor", 0 }, #define DINEDSW 6 { "noedit", 0 }, #define DIFRMSW 7 { "form formfile", 0 }, #define DIINSW 8 { "inplace", 0 }, #define DININSW 9 { "noinplace", 0 }, #define DIWHTSW 10 { "whatnowproc program", 0 }, #define DINWTSW 11 { "nowhatnowproc", 0 }, #define DIHELP 12 { "help", 0 }, { NULL, 0 } }; void distcmd (char **args) { int vecp = 1; char *cp, *msg = NULL; char buf[BUFSIZ], *vec[MAXARGS]; if (fmsh) { forkcmd (args, cmd_name); return; } while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, distswit)) { case AMBIGSW: ambigsw (cp, distswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case DIHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, distswit, 1); return; case DIANSW: /* not implemented */ case DINANSW: case DIINSW: case DININSW: continue; case DINDFSW: case DINEDSW: case DINWTSW: vec[vecp++] = --cp; continue; case DIEDTSW: case DIFRMSW: case DIDFSW: case DIDMSW: case DIWHTSW: vec[vecp++] = --cp; if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } vec[vecp++] = cp; continue; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else if (msg) { advise (NULL, "only one message at a time!"); return; } else msg = cp; } vec[0] = cmd_name; vec[vecp++] = "-file"; vec[vecp] = NULL; if (!msg) msg = "cur"; if (!m_convert (mp, msg)) return; seq_setprev (mp); if (mp->numsel > 1) { advise (NULL, "only one message at a time!"); return; } process (mp->hghsel, cmd_name, vecp, vec); seq_setcur (mp, mp->hghsel); } static struct swit explswit[] = { #define EXINSW 0 { "inplace", 0 }, #define EXNINSW 1 { "noinplace", 0 }, #define EXQISW 2 { "quiet", 0 }, #define EXNQISW 3 { "noquiet", 0 }, #define EXVBSW 4 { "verbose", 0 }, #define EXNVBSW 5 { "noverbose", 0 }, #define EXHELP 6 { "help", 0 }, { NULL, 0 } }; void explcmd (char **args) { int inplace = 0, quietsw = 0, verbosw = 0; int msgp = 0, hi, msgnum; char *cp, buf[BUFSIZ], *msgs[MAXARGS]; struct Msg *smsgs; if (fmsh) { forkcmd (args, cmd_name); return; } while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, explswit)) { case AMBIGSW: ambigsw (cp, explswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case EXHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, explswit, 1); return; case EXINSW: inplace++; continue; case EXNINSW: inplace = 0; continue; case EXQISW: quietsw++; continue; case EXNQISW: quietsw = 0; continue; case EXVBSW: verbosw++; continue; case EXNVBSW: verbosw = 0; continue; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else msgs[msgp++] = cp; } if (!msgp) msgs[msgp++] = "cur"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); smsgs = (struct Msg *) calloc ((size_t) (MAXFOLDER + 2), sizeof *smsgs); if (smsgs == NULL) adios (NULL, "unable to allocate folder storage"); hi = mp->hghmsg + 1; interrupted = 0; for (msgnum = mp->lowsel; msgnum <= mp->hghsel && !interrupted; msgnum++) if (is_selected (mp, msgnum)) if (burst (smsgs, msgnum, inplace, quietsw, verbosw) != OK) break; free ((char *) smsgs); if (inplace) seq_setcur (mp, mp->lowsel); else if (hi <= mp->hghmsg) seq_setcur (mp, hi); mp->msgflags |= MODIFIED; modified++; } static int burst (struct Msg *smsgs, int msgnum, int inplace, int quietsw, int verbosw) { int i, j, ld3, wasdlm, msgp; long pos; char c, buffer[BUFSIZ]; register FILE *zp; ld3 = strlen (delim3); if (Msgs[msgnum].m_scanl) { free (Msgs[msgnum].m_scanl); Msgs[msgnum].m_scanl = NULL; } pos = ftell (zp = msh_ready (msgnum, 1)); for (msgp = 0; msgp <= MAXFOLDER;) { while (fgets (buffer, sizeof buffer, zp) != NULL && buffer[0] == '\n' && pos < Msgs[msgnum].m_stop) pos += (long) strlen (buffer); if (feof (zp) || pos >= Msgs[msgnum].m_stop) break; fseek (zp, pos, SEEK_SET); smsgs[msgp].m_start = pos; for (c = 0; pos < Msgs[msgnum].m_stop && fgets (buffer, sizeof buffer, zp) != NULL; c = buffer[0]) if (strncmp (buffer, delim3, ld3) == 0 && (msgp == 1 || c == '\n') && peekc (zp) == '\n') break; else pos += (long) strlen (buffer); wasdlm = strncmp (buffer, delim3, ld3) == 0; if (smsgs[msgp].m_start != pos) smsgs[msgp++].m_stop = (c == '\n' && wasdlm) ? pos - 1 : pos; if (feof (zp) || pos >= Msgs[msgnum].m_stop) { if (wasdlm) smsgs[msgp - 1].m_stop -= ((long) strlen (buffer) + 1); break; } pos += (long) strlen (buffer); } switch (msgp--) { /* toss "End of XXX Digest" */ case 0: adios (NULL, "burst() botch -- you lose big"); case 1: if (!quietsw) printf ("message %d not in digest format\n", msgnum); return OK; default: if (verbosw) printf ("%d message%s exploded from digest %d\n", msgp, msgp != 1 ? "s" : "", msgnum); break; } if ((i = msgp + mp->hghmsg) > MAXFOLDER) { advise (NULL, "more than %d messages", MAXFOLDER); return NOTOK; } if (!(mp = folder_realloc (mp, mp->lowoff, i))) adios (NULL, "unable to allocate folder storage"); j = mp->hghmsg; mp->hghmsg += msgp; mp->nummsg += msgp; if (mp->hghsel > msgnum) mp->hghsel += msgp; if (inplace) for (i = mp->hghmsg; j > msgnum; i--, j--) { if (verbosw) printf ("message %d becomes message %d\n", j, i); Msgs[i].m_bboard_id = Msgs[j].m_bboard_id; Msgs[i].m_top = Msgs[j].m_top; Msgs[i].m_start = Msgs[j].m_start; Msgs[i].m_stop = Msgs[j].m_stop; Msgs[i].m_scanl = NULL; if (Msgs[j].m_scanl) { free (Msgs[j].m_scanl); Msgs[j].m_scanl = NULL; } copy_msg_flags (mp, i, j); } if (Msgs[msgnum].m_bboard_id == 0) readid (msgnum); unset_selected (mp, msgnum); i = inplace ? msgnum + msgp : mp->hghmsg; for (j = msgp; j >= (inplace ? 0 : 1); i--, j--) { if (verbosw && i != msgnum) printf ("message %d of digest %d becomes message %d\n", j, msgnum, i); Msgs[i].m_bboard_id = Msgs[msgnum].m_bboard_id; Msgs[i].m_top = Msgs[j].m_top; Msgs[i].m_start = smsgs[j].m_start; Msgs[i].m_stop = smsgs[j].m_stop; Msgs[i].m_scanl = NULL; copy_msg_flags (mp, i, msgnum); } return OK; } static struct swit fileswit[] = { #define FIDRFT 0 { "draft", 0 }, #define FILINK 1 { "link", 0 }, #define FINLINK 2 { "nolink", 0 }, #define FIPRES 3 { "preserve", 0 }, #define FINPRES 4 { "nopreserve", 0 }, #define FISRC 5 { "src +folder", 0 }, #define FIFILE 6 { "file file", 0 }, #define FIPROC 7 { "rmmproc program", 0 }, #define FINPRC 8 { "normmproc", 0 }, #define FIHELP 9 { "help", 0 }, { NULL, 0 } }; void filecmd (char **args) { int linksw = 0, msgp = 0; int vecp = 1, i, msgnum; char *cp, buf[BUFSIZ]; char *msgs[MAXARGS], *vec[MAXARGS]; if (fmsh) { forkcmd (args, cmd_name); return; } while ((cp = *args++)) { if (*cp == '-') switch (i = smatch (++cp, fileswit)) { case AMBIGSW: ambigsw (cp, fileswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case FIHELP: snprintf (buf, sizeof(buf), "%s +folder... [msgs] [switches]", cmd_name); print_help (buf, fileswit, 1); return; case FILINK: linksw++; continue; case FINLINK: linksw = 0; continue; case FIPRES: case FINPRES: continue; case FISRC: case FIDRFT: case FIFILE: case FIPROC: case FINPRC: advise (NULL, "sorry, -%s not allowed!", fileswit[i].sw); return; } if (*cp == '+' || *cp == '@') vec[vecp++] = cp; else msgs[msgp++] = cp; } vec[0] = cmd_name; vec[vecp++] = "-file"; vec[vecp] = NULL; if (!msgp) msgs[msgp++] = "cur"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); interrupted = 0; for (msgnum = mp->lowsel; msgnum <= mp->hghsel && !interrupted; msgnum++) if (is_selected (mp, msgnum)) if (process (msgnum, fileproc, vecp, vec)) { unset_selected (mp, msgnum); mp->numsel--; } if (mp->numsel != mp->nummsg || linksw) seq_setcur (mp, mp->hghsel); if (!linksw) rmm (); } int filehak (char **args) { int result, vecp = 0; char *cp, *cwd, *vec[MAXARGS]; while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, fileswit)) { case AMBIGSW: case UNKWNSW: case FIHELP: return NOTOK; case FILINK: case FINLINK: case FIPRES: case FINPRES: continue; case FISRC: case FIDRFT: case FIFILE: return NOTOK; } if (*cp == '+' || *cp == '@') vec[vecp++] = cp; } vec[vecp] = NULL; result = NOTOK; cwd = NULL; for (vecp = 0; (cp = vec[vecp]) && result == NOTOK; vecp++) { if (cwd == NULL) cwd = getcpy (pwd ()); chdir (m_maildir ("")); cp = pluspath (cp); if (access (m_maildir (cp), F_OK) == NOTOK) result = OK; free (cp); } if (cwd) chdir (cwd); return result; } static struct swit foldswit[] = { #define FLALSW 0 { "all", 0 }, #define FLFASW 1 { "fast", 0 }, #define FLNFASW 2 { "nofast", 0 }, #define FLHDSW 3 { "header", 0 }, #define FLNHDSW 4 { "noheader", 0 }, #define FLPKSW 5 { "pack", 0 }, #define FLNPKSW 6 { "nopack", 0 }, #define FLRCSW 7 { "recurse", 0 }, #define FLNRCSW 8 { "norecurse", 0 }, #define FLTLSW 9 { "total", 0 }, #define FLNTLSW 10 { "nototal", 0 }, #define FLPRSW 11 { "print", 0 }, #define FLPUSW 12 { "push", 0 }, #define FLPOSW 13 { "pop", 0 }, #define FLLISW 14 { "list", 0 }, #define FLHELP 15 { "help", 0 }, { NULL, 0 } }; void foldcmd (char **args) { int fastsw = 0, headersw = 0, packsw = 0; int hole, msgnum; char *cp, *folder = NULL, *msg = NULL; char buf[BUFSIZ], **vec = args; if (args == NULL) goto fast; while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, foldswit)) { case AMBIGSW: ambigsw (cp, foldswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case FLHELP: snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]", cmd_name); print_help (buf, foldswit, 1); return; case FLALSW: /* not implemented */ case FLRCSW: case FLNRCSW: case FLTLSW: case FLNTLSW: case FLPRSW: case FLPUSW: case FLPOSW: case FLLISW: continue; case FLFASW: fastsw++; continue; case FLNFASW: fastsw = 0; continue; case FLHDSW: headersw++; continue; case FLNHDSW: headersw = 0; continue; case FLPKSW: packsw++; continue; case FLNPKSW: packsw = 0; continue; } if (*cp == '+' || *cp == '@') { if (folder) { advise (NULL, "only one folder at a time!\n"); return; } else folder = fmsh ? pluspath (cp) : cp + 1; } else if (msg) { advise (NULL, "only one message at a time!\n"); return; } else msg = cp; } if (folder) { if (*folder == 0) { advise (NULL, "null folder names are not permitted"); return; } if (fmsh) { if (access (m_maildir (folder), R_OK) == NOTOK) { advise (folder, "unable to read"); return; } } else { strncpy (buf, folder, sizeof(buf)); if (expand (buf) == NOTOK) return; folder = buf; if (access (folder, R_OK) == NOTOK) { advise (folder, "unable to read"); return; } } m_reset (); if (fmsh) fsetup (folder); else setup (folder); readids (0); display_info (0); } if (msg) { if (!m_convert (mp, msg)) return; seq_setprev (mp); if (mp->numsel > 1) { advise (NULL, "only one message at a time!"); return; } seq_setcur (mp, mp->hghsel); } if (packsw) { if (fmsh) { forkcmd (vec, cmd_name); return; } if (mp->lowoff > 1 && !(mp = folder_realloc (mp, 1, mp->hghmsg))) adios (NULL, "unable to allocate folder storage"); for (msgnum = mp->lowmsg, hole = 1; msgnum <= mp->hghmsg; msgnum++) if (does_exist (mp, msgnum)) { if (msgnum != hole) { Msgs[hole].m_bboard_id = Msgs[msgnum].m_bboard_id; Msgs[hole].m_top = Msgs[msgnum].m_top; Msgs[hole].m_start = Msgs[msgnum].m_start; Msgs[hole].m_stop = Msgs[msgnum].m_stop; Msgs[hole].m_scanl = NULL; if (Msgs[msgnum].m_scanl) { free (Msgs[msgnum].m_scanl); Msgs[msgnum].m_scanl = NULL; } copy_msg_flags (mp, hole, msgnum); if (mp->curmsg == msgnum) seq_setcur (mp, hole); } hole++; } if (mp->nummsg > 0) { mp->lowmsg = 1; mp->hghmsg = hole - 1; } mp->msgflags |= MODIFIED; modified++; } fast: ; if (fastsw) printf ("%s\n", fmsh ? fmsh : mp->foldpath); else { if (headersw) printf ("\t\tFolder %*s# of messages (%*srange%*s); cur%*smsg\n", DMAXFOLDER, "", DMAXFOLDER - 2, "", DMAXFOLDER - 2, "", DMAXFOLDER - 2, ""); printf (args ? "%22s " : "%s ", fmsh ? fmsh : mp->foldpath); /* check for empty folder */ if (mp->nummsg == 0) { printf ("has no messages%*s", mp->msgflags & OTHERS ? DMAXFOLDER * 2 + 4 : 0, ""); } else { printf ("has %*d message%s (%*d-%*d)", DMAXFOLDER, mp->nummsg, mp->nummsg != 1 ? "s" : "", DMAXFOLDER, mp->lowmsg, DMAXFOLDER, mp->hghmsg); if (mp->curmsg >= mp->lowmsg && mp->curmsg <= mp->hghmsg) printf ("; cur=%*d", DMAXFOLDER, mp->curmsg); } printf (".\n"); } } static struct swit forwswit[] = { #define FOANSW 0 { "annotate", 0 }, #define FONANSW 1 { "noannotate", 0 }, #define FODFSW 2 { "draftfolder +folder", 0 }, #define FODMSW 3 { "draftmessage msg", 0 }, #define FONDFSW 4 { "nodraftfolder", 0 }, #define FOEDTSW 5 { "editor editor", 0 }, #define FONEDSW 6 { "noedit", 0 }, #define FOFTRSW 7 { "filter filterfile", 0 }, #define FOFRMSW 8 { "form formfile", 0 }, #define FOFTSW 9 { "format", 5 }, #define FONFTSW 10 { "noformat", 7 }, #define FOINSW 11 { "inplace", 0 }, #define FONINSW 12 { "noinplace", 0 }, #define FOMISW 13 { "mime", 0 }, #define FONMISW 14 { "nomime", 0 }, #define FOWHTSW 15 { "whatnowproc program", 0 }, #define FONWTSW 16 { "nowhatnow", 0 }, #define FOHELP 17 { "help", 0 }, { NULL, 0 } }; void forwcmd (char **args) { int msgp = 0, vecp = 1, msgnum; char *cp, *filter = NULL, buf[BUFSIZ]; char *msgs[MAXARGS], *vec[MAXARGS]; char *tfile = NULL; char tmpfil[BUFSIZ]; if (fmsh) { forkcmd (args, cmd_name); return; } while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, forwswit)) { case AMBIGSW: ambigsw (cp, forwswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case FOHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, forwswit, 1); return; case FOANSW: /* not implemented */ case FONANSW: case FOINSW: case FONINSW: case FOMISW: case FONMISW: continue; case FONDFSW: case FONEDSW: case FONWTSW: vec[vecp++] = --cp; continue; case FOEDTSW: case FOFRMSW: case FODFSW: case FODMSW: case FOWHTSW: vec[vecp++] = --cp; if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } vec[vecp++] = cp; continue; case FOFTRSW: if (!(filter = *args++) || *filter == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } continue; case FOFTSW: if (access (filter = myfilter, R_OK) == NOTOK) { advise (filter, "unable to read default filter file"); return; } continue; case FONFTSW: filter = NULL; continue; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else msgs[msgp++] = cp; } /* foil search of .mh_profile */ snprintf (buf, sizeof(buf), "%sXXXXXX", invo_name); tfile = m_mktemp(buf, NULL, NULL); if (tfile == NULL) adios("forwcmd", "unable to create temporary file"); strncpy (tmpfil, tfile, sizeof(tmpfil)); vec[0] = tmpfil; vec[vecp++] = "-file"; vec[vecp] = NULL; if (!msgp) msgs[msgp++] = "cur"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); if (filter) { strncpy (buf, filter, sizeof(buf)); if (expand (buf) == NOTOK) return; if (access (filter = getcpy (etcpath (buf)), R_OK) == NOTOK) { advise (filter, "unable to read"); free (filter); return; } } forw (cmd_name, filter, vecp, vec); seq_setcur (mp, mp->hghsel); if (filter) free (filter); } static void forw (char *proc, char *filter, int vecp, char **vec) { int i, child_id, msgnum, msgcnt; char tmpfil[BUFSIZ], *args[MAXARGS]; FILE *out; char *tfile = NULL; tfile = m_mktemp2(NULL, invo_name, NULL, NULL); if (tfile == NULL) adios("forw", "unable to create temporary file"); strncpy (tmpfil, tfile, sizeof(tmpfil)); interrupted = 0; if (filter) switch (child_id = fork ()) { case NOTOK: advise ("fork", "unable to"); return; case OK: /* "trust me" */ if (freopen (tmpfil, "w", stdout) == NULL) { fprintf (stderr, "unable to create "); perror (tmpfil); _exit (1); } args[0] = r1bindex (mhlproc, '/'); i = 1; args[i++] = "-forwall"; args[i++] = "-form"; args[i++] = filter; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) args[i++] = getcpy (m_name (msgnum)); args[i] = NULL; mhlsbr (i, args, mhl_action); m_eomsbr ((int (*) ()) 0); fclose (stdout); _exit (0); default: if (pidXwait (child_id, NULL)) interrupted++; break; } else { if ((out = fopen (tmpfil, "w")) == NULL) { advise (tmpfil, "unable to create temporary file"); return; } msgcnt = 1; for (msgnum = mp->lowsel; msgnum <= mp->hghsel && !interrupted; msgnum++) if (is_selected (mp, msgnum)) { fprintf (out, "\n\n-------"); if (msgnum == mp->lowsel) fprintf (out, " Forwarded Message%s", mp->numsel > 1 ? "s" : ""); else fprintf (out, " Message %d", msgcnt); fprintf (out, "\n\n"); copy_digest (msgnum, out); msgcnt++; } fprintf (out, "\n\n------- End of Forwarded Message%s\n", mp->numsel > 1 ? "s" : ""); fclose (out); } fflush (stdout); if (!interrupted) switch (child_id = fork ()) { case NOTOK: advise ("fork", "unable to"); break; case OK: closefds (3); SIGNAL (SIGINT, istat); SIGNAL (SIGQUIT, qstat); vec[vecp++] = tmpfil; vec[vecp] = NULL; execvp (proc, vec); fprintf (stderr, "unable to exec "); perror (proc); _exit (1); default: pidXwait (child_id, NULL); break; } unlink (tmpfil); } static char *hlpmsg[] = { "The %s program emulates many of the commands found in the nmh", "system. Instead of operating on nmh folders, commands to %s concern", "a single file.", "", "To see the list of commands available, just type a ``?'' followed by", "the RETURN key. To find out what switches each command takes, type", "the name of the command followed by ``-help''. To leave %s, use the", "``quit'' command.", "", "Although a lot of nmh commands are found in %s, not all are fully", "implemented. %s will always recognize all legal switches for a", "given command though, and will let you know when you ask for an", "option that it is unable to perform.", "", "Running %s is fun, but using nmh from your shell is far superior.", "After you have familiarized yourself with the nmh style by using %s,", "you should try using nmh from the shell. You can still use %s for", "message files that aren't in nmh format, such as BBoard files.", NULL }; void helpcmd (char **args) { int i; NMH_UNUSED (args); for (i = 0; hlpmsg[i]; i++) { printf (hlpmsg[i], invo_name); putchar ('\n'); } } static struct swit markswit[] = { #define MADDSW 0 { "add", 0 }, #define MDELSW 1 { "delete", 0 }, #define MLSTSW 2 { "list", 0 }, #define MSEQSW 3 { "sequence name", 0 }, #define MPUBSW 4 { "public", 0 }, #define MNPUBSW 5 { "nopublic", 0 }, #define MZERSW 6 { "zero", 0 }, #define MNZERSW 7 { "nozero", 0 }, #define MHELP 8 { "help", 0 }, #define MDBUGSW 9 { "debug", -5 }, { NULL, 0 } }; void markcmd (char **args) { int addsw = 0, deletesw = 0, debugsw = 0; int listsw = 0, zerosw = 0; size_t seqp = 0; int msgp = 0, msgnum; char *cp, buf[BUFSIZ]; char *seqs[NUMATTRS + 1], *msgs[MAXARGS]; while ((cp = *args++)) { if (*cp == '-') { switch (smatch (++cp, markswit)) { case AMBIGSW: ambigsw (cp, markswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case MHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, markswit, 1); return; case MADDSW: addsw++; deletesw = listsw = 0; continue; case MDELSW: deletesw++; addsw = listsw = 0; continue; case MLSTSW: listsw++; addsw = deletesw = 0; continue; case MSEQSW: if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } if (seqp < NUMATTRS) seqs[seqp++] = cp; else { advise (NULL, "only %d sequences allowed!", NUMATTRS); return; } continue; case MPUBSW: /* not implemented */ case MNPUBSW: continue; case MDBUGSW: debugsw++; continue; case MZERSW: zerosw++; continue; case MNZERSW: zerosw = 0; continue; } } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else { msgs[msgp++] = cp; } } if (!addsw && !deletesw && !listsw) { if (seqp) addsw++; else if (debugsw) listsw++; else { seqs[seqp++] = "unseen"; deletesw++; zerosw = 0; if (!msgp) msgs[msgp++] = "all"; } } if (!msgp) msgs[msgp++] = listsw ? "all" :"cur"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; if (debugsw) { printf ("invo_name=%s mypath=%s defpath=%s\n", invo_name, mypath, defpath); printf ("ctxpath=%s context flags=%s\n", ctxpath, snprintb (buf, sizeof(buf), (unsigned) ctxflags, DBITS)); printf ("foldpath=%s flags=%s\n", mp->foldpath, snprintb (buf, sizeof(buf), (unsigned) mp->msgflags, FBITS)); printf ("hghmsg=%d lowmsg=%d nummsg=%d curmsg=%d\n", mp->hghmsg, mp->lowmsg, mp->nummsg, mp->curmsg); printf ("lowsel=%d hghsel=%d numsel=%d\n", mp->lowsel, mp->hghsel, mp->numsel); printf ("lowoff=%d hghoff=%d\n", mp->lowoff, mp->hghoff); } if (seqp == 0 && (addsw || deletesw)) { advise (NULL, "-%s requires at least one -sequence argument", addsw ? "add" : "delete"); return; } seqs[seqp] = NULL; if (addsw) { for (seqp = 0; seqs[seqp]; seqp++) if (!seq_addsel (mp, seqs[seqp], 0, zerosw)) return; } if (deletesw) { for (seqp = 0; seqs[seqp]; seqp++) if (!seq_delsel (mp, seqs[seqp], 0, zerosw)) return; } /* Listing messages in sequences */ if (listsw) { if (seqp) { /* list the given sequences */ for (seqp = 0; seqs[seqp]; seqp++) seq_print (mp, seqs[seqp]); } else { /* else list them all */ seq_printall (mp); } interrupted = 0; if (debugsw) for (msgnum = mp->lowsel; msgnum <= mp->hghsel && !interrupted; msgnum++) if (is_selected (mp, msgnum)) { printf ("%*d: id=%d top=%d start=%ld stop=%ld %s\n", DMAXFOLDER, msgnum, Msgs[msgnum].m_bboard_id, Msgs[msgnum].m_top, (long) Msgs[msgnum].m_start, (long) Msgs[msgnum].m_stop, snprintb (buf, sizeof(buf), (unsigned) mp->msgstats[msgnum - mp->lowoff], seq_bits (mp))); if (Msgs[msgnum].m_scanl) printf ("%s", Msgs[msgnum].m_scanl); } } } static struct swit mhnswit[] = { #define MHNAUTOSW 0 { "auto", 0 }, #define MHNNAUTOSW 1 { "noauto", 0 }, #define MHNDEBUGSW 2 { "debug", -5 }, #define MHNEBCDICSW 3 { "ebcdicsafe", 0 }, #define MHNNEBCDICSW 4 { "noebcdicsafe", 0 }, #define MHNFORMSW 5 { "form formfile", 4 }, #define MHNHEADSW 6 { "headers", 0 }, #define MHNNHEADSW 7 { "noheaders", 0 }, #define MHNLISTSW 8 { "list", 0 }, #define MHNNLISTSW 9 { "nolist", 0 }, #define MHNPARTSW 10 { "part number", 0 }, #define MHNSIZESW 11 { "realsize", 0 }, #define MHNNSIZESW 12 { "norealsize", 0 }, #define MHNRFC934SW 13 { "rfc934mode", 0 }, #define MHNNRFC934SW 14 { "norfc934mode", 0 }, #define MHNSERIALSW 15 { "serialonly", 0 }, #define MHNNSERIALSW 16 { "noserialonly", 0 }, #define MHNSHOWSW 17 { "show", 0 }, #define MHNNSHOWSW 18 { "noshow", 0 }, #define MHNSTORESW 19 { "store", 0 }, #define MHNNSTORESW 20 { "nostore", 0 }, #define MHNTYPESW 21 { "type content", 0 }, #define MHNVERBSW 22 { "verbose", 0 }, #define MHNNVERBSW 23 { "noverbose", 0 }, #define MHNHELPSW 24 { "help", 0 }, #define MHNPROGSW 25 { "moreproc program", -4 }, #define MHNNPROGSW 26 { "nomoreproc", -3 }, #define MHNLENSW 27 { "length lines", -4 }, #define MHNWIDSW 28 { "width columns", -4 }, { NULL, 0 } }; void mhncmd (char **args) { int msgp = 0, vecp = 1; int msgnum; char *cp, buf[BUFSIZ]; char *msgs[MAXARGS], *vec[MAXARGS]; if (fmsh) { forkcmd (args, cmd_name); return; } while ((cp = *args++)) { if (*cp == '-') { switch (smatch (++cp, mhnswit)) { case AMBIGSW: ambigsw (cp, mhnswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case MHNHELPSW: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, mhnswit, 1); return; case MHNAUTOSW: case MHNNAUTOSW: case MHNDEBUGSW: case MHNEBCDICSW: case MHNNEBCDICSW: case MHNHEADSW: case MHNNHEADSW: case MHNLISTSW: case MHNNLISTSW: case MHNSIZESW: case MHNNSIZESW: case MHNRFC934SW: case MHNNRFC934SW: case MHNSERIALSW: case MHNNSERIALSW: case MHNSHOWSW: case MHNNSHOWSW: case MHNSTORESW: case MHNNSTORESW: case MHNVERBSW: case MHNNVERBSW: case MHNNPROGSW: vec[vecp++] = --cp; continue; case MHNFORMSW: case MHNPARTSW: case MHNTYPESW: case MHNPROGSW: case MHNLENSW: case MHNWIDSW: vec[vecp++] = --cp; if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } vec[vecp++] = cp; continue; } } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else { msgs[msgp++] = cp; } } vec[0] = cmd_name; vec[vecp++] = "-file"; vec[vecp] = NULL; if (!msgp) msgs[msgp++] = "cur"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); interrupted = 0; for (msgnum = mp->lowsel; msgnum <= mp->hghsel && !interrupted; msgnum++) if (is_selected (mp, msgnum)) if (process (msgnum, cmd_name, vecp, vec)) { unset_selected (mp, msgnum); mp->numsel--; } seq_setcur (mp, mp->hghsel); } static struct swit packswit[] = { #define PAFISW 0 { "file name", 0 }, #define PAHELP 1 { "help", 0 }, { NULL, 0 } }; static int mbx_style = MMDF_FORMAT; void packcmd (char **args) { int msgp = 0, md, msgnum; char *cp, *file = NULL; char buf[BUFSIZ], *msgs[MAXARGS]; struct stat st; if (fmsh) { forkcmd (args, cmd_name); return; } while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, packswit)) { case AMBIGSW: ambigsw (cp, packswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case PAHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, packswit, 1); return; case PAFISW: if (!(file = *args++) || *file == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } continue; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else msgs[msgp++] = cp; } if (!file) file = "./msgbox"; file = path (file, TFILE); if (stat (file, &st) == NOTOK) { if (errno != ENOENT) { advise (file, "error on file"); goto done_pack; } md = getanswer (cp = concat ("Create file \"", file, "\"? ", NULL)); free (cp); if (!md) goto done_pack; } if (!msgp) msgs[msgp++] = "all"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) goto done_pack; seq_setprev (mp); if ((md = mbx_open (file, mbx_style, getuid (), getgid (), m_gmprot ())) == NOTOK) { advise (file, "unable to open"); goto done_pack; } for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) if (pack (file, md, msgnum) == NOTOK) break; mbx_close (file, md); if (mp->hghsel != mp->curmsg) seq_setcur (mp, mp->lowsel); done_pack: ; free (file); } int pack (char *mailbox, int md, int msgnum) { register FILE *zp; if (Msgs[msgnum].m_bboard_id == 0) readid (msgnum); zp = msh_ready (msgnum, 1); return mbx_write (mailbox, md, zp, Msgs[msgnum].m_bboard_id, 0L, ftell (zp), Msgs[msgnum].m_stop, 1, 1); } int packhak (char **args) { int result; char *cp, *file = NULL; while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, packswit)) { case AMBIGSW: case UNKWNSW: case PAHELP: return NOTOK; case PAFISW: if (!(file = *args++) || *file == '-') return NOTOK; continue; } if (*cp == '+' || *cp == '@') return NOTOK; } file = path (file ? file : "./msgbox", TFILE); result = access (file, F_OK) == NOTOK ? OK : NOTOK; free (file); return result; } static struct swit pickswit[] = { #define PIANSW 0 { "and", 0 }, #define PIORSW 1 { "or", 0 }, #define PINTSW 2 { "not", 0 }, #define PILBSW 3 { "lbrace", 0 }, #define PIRBSW 4 { "rbrace", 0 }, #define PICCSW 5 { "cc pattern", 0 }, #define PIDASW 6 { "date pattern", 0 }, #define PIFRSW 7 { "from pattern", 0 }, #define PISESW 8 { "search pattern", 0 }, #define PISUSW 9 { "subject pattern", 0 }, #define PITOSW 10 { "to pattern", 0 }, #define PIOTSW 11 { "-othercomponent pattern", 15 }, #define PIAFSW 12 { "after date", 0 }, #define PIBFSW 13 { "before date", 0 }, #define PIDFSW 14 { "datefield field", 5 }, #define PISQSW 15 { "sequence name", 0 }, #define PIPUSW 16 { "public", 0 }, #define PINPUSW 17 { "nopublic", 0 }, #define PIZRSW 18 { "zero", 0 }, #define PINZRSW 19 { "nozero", 0 }, #define PILISW 20 { "list", 0 }, #define PINLISW 21 { "nolist", 0 }, #define PIHELP 22 { "help", 0 }, { NULL, 0 } }; void pickcmd (char **args) { int zerosw = 1, msgp = 0; size_t seqp = 0; int vecp = 0, hi, lo, msgnum; char *cp, buf[BUFSIZ], *msgs[MAXARGS]; char *seqs[NUMATTRS], *vec[MAXARGS]; register FILE *zp; while ((cp = *args++)) { if (*cp == '-') { if (*++cp == '-') { vec[vecp++] = --cp; goto pattern; } switch (smatch (cp, pickswit)) { case AMBIGSW: ambigsw (cp, pickswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case PIHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, pickswit, 1); return; case PICCSW: case PIDASW: case PIFRSW: case PISUSW: case PITOSW: case PIDFSW: case PIAFSW: case PIBFSW: case PISESW: vec[vecp++] = --cp; pattern: ; if (!(cp = *args++)) {/* allow -xyz arguments */ advise (NULL, "missing argument to %s", args[-2]); return; } vec[vecp++] = cp; continue; case PIOTSW: advise (NULL, "internal error!"); return; case PIANSW: case PIORSW: case PINTSW: case PILBSW: case PIRBSW: vec[vecp++] = --cp; continue; case PISQSW: if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } if (seqp < NUMATTRS) seqs[seqp++] = cp; else { advise (NULL, "only %d sequences allowed!", NUMATTRS); return; } continue; case PIZRSW: zerosw++; continue; case PINZRSW: zerosw = 0; continue; case PIPUSW: /* not implemented */ case PINPUSW: case PILISW: case PINLISW: continue; } } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else msgs[msgp++] = cp; } vec[vecp] = NULL; if (!msgp) msgs[msgp++] = "all"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); interrupted = 0; if (!pcompile (vec, NULL)) return; lo = mp->lowsel; hi = mp->hghsel; for (msgnum = mp->lowsel; msgnum <= mp->hghsel && !interrupted; msgnum++) if (is_selected (mp, msgnum)) { zp = msh_ready (msgnum, 1); if (pmatches (zp, msgnum, fmsh ? 0L : Msgs[msgnum].m_start, fmsh ? 0L : Msgs[msgnum].m_stop)) { if (msgnum < lo) lo = msgnum; if (msgnum > hi) hi = msgnum; } else { unset_selected (mp, msgnum); mp->numsel--; } } if (interrupted) return; mp->lowsel = lo; mp->hghsel = hi; if (mp->numsel <= 0) { advise (NULL, "no messages match specification"); return; } seqs[seqp] = NULL; for (seqp = 0; seqs[seqp]; seqp++) if (!seq_addsel (mp, seqs[seqp], 0, zerosw)) return; printf ("%d hit%s\n", mp->numsel, mp->numsel == 1 ? "" : "s"); } static struct swit replswit[] = { #define REANSW 0 { "annotate", 0 }, #define RENANSW 1 { "noannotate", 0 }, #define RECCSW 2 { "cc type", 0 }, #define RENCCSW 3 { "nocc type", 0 }, #define REDFSW 4 { "draftfolder +folder", 0 }, #define REDMSW 5 { "draftmessage msg", 0 }, #define RENDFSW 6 { "nodraftfolder", 0 }, #define REEDTSW 7 { "editor editor", 0 }, #define RENEDSW 8 { "noedit", 0 }, #define REFCCSW 9 { "fcc +folder", 0 }, #define REFLTSW 10 { "filter filterfile", 0 }, #define REFRMSW 11 { "form formfile", 0 }, #define REINSW 12 { "inplace", 0 }, #define RENINSW 13 { "noinplace", 0 }, #define REQUSW 14 { "query", 0 }, #define RENQUSW 15 { "noquery", 0 }, #define REWHTSW 16 { "whatnowproc program", 0 }, #define RENWTSW 17 { "nowhatnow", 0 }, #define REWIDSW 19 { "width columns", 0 }, #define REHELP 20 { "help", 0 }, { NULL, 0 } }; void replcmd (char **args) { int vecp = 1; char *cp, *msg = NULL; char buf[BUFSIZ], *vec[MAXARGS]; if (fmsh) { forkcmd (args, cmd_name); return; } while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, replswit)) { case AMBIGSW: ambigsw (cp, replswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case REHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, replswit, 1); return; case REANSW: /* not implemented */ case RENANSW: case REINSW: case RENINSW: continue; case REQUSW: case RENQUSW: case RENDFSW: case RENEDSW: case RENWTSW: vec[vecp++] = --cp; continue; case RECCSW: case RENCCSW: case REEDTSW: case REFCCSW: case REFLTSW: case REFRMSW: case REWIDSW: case REDFSW: case REDMSW: case REWHTSW: vec[vecp++] = --cp; if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } vec[vecp++] = cp; continue; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else if (msg) { advise (NULL, "only one message at a time!"); return; } else msg = cp; } vec[0] = cmd_name; vec[vecp++] = "-file"; vec[vecp] = NULL; if (!msg) msg = "cur"; if (!m_convert (mp, msg)) return; seq_setprev (mp); if (mp->numsel > 1) { advise (NULL, "only one message at a time!"); return; } process (mp->hghsel, cmd_name, vecp, vec); seq_setcur (mp, mp->hghsel); } static struct swit rmmswit[] = { #define RMHELP 0 { "help", 0 }, { NULL, 0 } }; void rmmcmd (char **args) { int msgp = 0, msgnum; char *cp, buf[BUFSIZ], *msgs[MAXARGS]; while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, rmmswit)) { case AMBIGSW: ambigsw (cp, rmmswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case RMHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, rmmswit, 1); return; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else msgs[msgp++] = cp; } if (!msgp) msgs[msgp++] = "cur"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); rmm (); } static void rmm (void) { register int msgnum, vecp; register char *cp; char buffer[BUFSIZ], *vec[MAXARGS]; if (fmsh) { if (rmmproc) { if (mp->numsel > MAXARGS - 1) { advise (NULL, "more than %d messages for %s exec", MAXARGS - 1, rmmproc); return; } vecp = 0; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) vec[vecp++] = getcpy (m_name (msgnum)); vec[vecp] = NULL; forkcmd (vec, rmmproc); for (vecp = 0; vec[vecp]; vecp++) free (vec[vecp]); } else for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) { strncpy (buffer, m_backup (cp = m_name (msgnum)), sizeof(buffer)); if (rename (cp, buffer) == NOTOK) admonish (buffer, "unable to rename %s to", cp); } } for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) { set_deleted (mp, msgnum); unset_exists (mp, msgnum); } if ((mp->nummsg -= mp->numsel) <= 0) { if (fmsh) admonish (NULL, "no messages remaining in +%s", fmsh); else admonish (NULL, "no messages remaining in %s", mp->foldpath); mp->lowmsg = mp->hghmsg = mp->nummsg = 0; } if (mp->lowsel == mp->lowmsg) { for (msgnum = mp->lowmsg + 1; msgnum <= mp->hghmsg; msgnum++) if (does_exist (mp, msgnum)) break; mp->lowmsg = msgnum; } if (mp->hghsel == mp->hghmsg) { for (msgnum = mp->hghmsg - 1; msgnum >= mp->lowmsg; msgnum--) if (does_exist (mp, msgnum)) break; mp->hghmsg = msgnum; } mp->msgflags |= MODIFIED; modified++; } static struct swit scanswit[] = { #define SCCLR 0 { "clear", 0 }, #define SCNCLR 1 { "noclear", 0 }, #define SCFORM 2 { "form formatfile", 0 }, #define SCFMT 3 { "format string", 5 }, #define SCHEAD 4 { "header", 0 }, #define SCNHEAD 5 { "noheader", 0 }, #define SCWID 6 { "width columns", 0 }, #define SCHELP 7 { "help", 0 }, { NULL, 0 } }; void scancmd (char **args) { #define equiv(a,b) (a ? b && !strcmp (a, b) : !b) int clearsw = 0, headersw = 0, width = 0, msgp = 0; int msgnum, optim, state; char *cp, *form = NULL, *format = NULL; char buf[BUFSIZ], *nfs, *msgs[MAXARGS]; register FILE *zp; static int s_optim = 0; static char *s_form = NULL, *s_format = NULL; while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, scanswit)) { case AMBIGSW: ambigsw (cp, scanswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case SCHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, scanswit, 1); return; case SCCLR: clearsw++; continue; case SCNCLR: clearsw = 0; continue; case SCHEAD: headersw++; continue; case SCNHEAD: headersw = 0; continue; case SCFORM: if (!(form = *args++) || *form == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } format = NULL; continue; case SCFMT: if (!(format = *args++) || *format == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } form = NULL; continue; case SCWID: if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } width = atoi (cp); continue; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else msgs[msgp++] = cp; } if (!msgp) msgs[msgp++] = "all"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); /* Get new format string */ nfs = new_fs (form, format, FORMAT); /* force scansbr to (re)compile format */ if (scanl) { free (scanl); scanl = NULL; } if (s_optim == 0) { s_optim = optim = 1; s_form = form ? getcpy (form) : NULL; s_format = format ? getcpy (format) : NULL; } else optim = equiv (s_form, form) && equiv (s_format, format); interrupted = 0; for (msgnum = mp->lowsel; msgnum <= mp->hghsel && !interrupted; msgnum++) if (is_selected (mp, msgnum)) { if (optim && Msgs[msgnum].m_scanl) printf ("%s", Msgs[msgnum].m_scanl); else { zp = msh_ready (msgnum, 0); switch (state = scan (zp, msgnum, 0, nfs, width, msgnum == mp->curmsg, is_unseen (mp, msgnum), headersw ? (fmsh ? fmsh : mp->foldpath) : NULL, fmsh ? 0L : (long) (Msgs[msgnum].m_stop - Msgs[msgnum].m_start), 1)) { case SCNMSG: case SCNENC: case SCNERR: if (optim) Msgs[msgnum].m_scanl = getcpy (scanl); break; default: advise (NULL, "scan() botch (%d)", state); return; case SCNEOF: printf ("%*d empty\n", DMAXFOLDER, msgnum); break; } } headersw = 0; } if (clearsw) clear_screen (); } static struct swit showswit[] = { #define SHDRAFT 0 { "draft", 5 }, #define SHFORM 1 { "form formfile", 4 }, #define SHPROG 2 { "moreproc program", 4 }, #define SHNPROG 3 { "nomoreproc", 3 }, #define SHLEN 4 { "length lines", 4 }, #define SHWID 5 { "width columns", 4 }, #define SHSHOW 6 { "showproc program", 4 }, #define SHNSHOW 7 { "noshowproc", 3 }, #define SHHEAD 8 { "header", 4 }, #define SHNHEAD 9 { "noheader", 3 }, #define SHHELP 10 { "help", 0 }, { NULL, 0 } }; void showcmd (char **args) { int headersw = 1, nshow = 0, msgp = 0, vecp = 1; int mhl = 0, seqnum = -1, mode = 0, i, msgnum; char *cp, *proc = showproc, buf[BUFSIZ]; char *msgs[MAXARGS], *vec[MAXARGS]; if (!mh_strcasecmp (cmd_name, "next")) mode = 1; else if (!mh_strcasecmp (cmd_name, "prev")) mode = -1; while ((cp = *args++)) { if (*cp == '-') switch (i = smatch (++cp, showswit)) { case AMBIGSW: ambigsw (cp, showswit); return; case UNKWNSW: case SHNPROG: vec[vecp++] = --cp; continue; case SHHELP: snprintf (buf, sizeof(buf), "%s %s[switches] [switches for showproc]", cmd_name, mode ? NULL : "[msgs] "); print_help (buf, showswit, 1); return; case SHFORM: case SHPROG: case SHLEN: case SHWID: vec[vecp++] = --cp; if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } vec[vecp++] = cp; continue; case SHHEAD: headersw++; continue; case SHNHEAD: headersw = 0; continue; case SHSHOW: if (!(proc = *args++) || *proc == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } nshow = 0; continue; case SHNSHOW: nshow++; continue; case SHDRAFT: advise (NULL, "sorry, -%s not allowed!", showswit[i].sw); return; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else if (mode) { fprintf (stderr, "usage: %s [switches] [switches for showproc]\n", cmd_name); return; } else msgs[msgp++] = cp; } vec[vecp] = NULL; if (!msgp) msgs[msgp++] = mode > 0 ? "next" : mode < 0 ? "prev" : "cur"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); if (!nshow && !getenv ("NOMHNPROC")) for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum) && is_nontext (msgnum)) { proc = showmimeproc; vec[vecp++] = "-file"; vec[vecp] = NULL; goto finish; } if (nshow) proc = catproc; else if (strcmp (showproc, "mhl") == 0) { proc = mhlproc; mhl++; } finish: ; seqnum = seq_getnum (mp, "unseen"); vec[0] = r1bindex (proc, '/'); if (mhl) { msgp = vecp; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) { vec[vecp++] = getcpy (m_name (msgnum)); if (seqnum != -1) seq_delmsg (mp, "unseen", msgnum); } vec[vecp] = NULL; if (mp->numsel == 1 && headersw) show (mp->lowsel); mhlsbr (vecp, vec, mhl_action); m_eomsbr ((int (*)()) 0); while (msgp < vecp) free (vec[msgp++]); } else { interrupted = 0; for (msgnum = mp->lowsel; msgnum <= mp->hghsel && !interrupted; msgnum++) if (is_selected (mp, msgnum)) { switch (ask (msgnum)) { case NOTOK: /* QUIT */ break; case OK: /* INTR */ continue; default: if (mp->numsel == 1 && headersw) show (msgnum); if (nshow) copy_message (msgnum, stdout); else process (msgnum, proc, vecp, vec); if (seqnum != -1) seq_delmsg (mp, "unseen", msgnum); continue; } break; } } seq_setcur (mp, mp->hghsel); } static void show (int msgnum) { if (Msgs[msgnum].m_bboard_id == 0) readid (msgnum); printf ("(Message %d", msgnum); if (Msgs[msgnum].m_bboard_id > 0) printf (", %s: %d", BBoard_ID, Msgs[msgnum].m_bboard_id); printf (")\n"); } static int eom_action (int c) { NMH_UNUSED (c); return (ftell (mhlfp) >= Msgs[mhlnum].m_stop); } static FILE * mhl_action (char *name) { int msgnum; if ((msgnum = m_atoi (name)) < mp->lowmsg || msgnum > mp->hghmsg || !does_exist (mp, msgnum)) return NULL; mhlnum = msgnum; mhlfp = msh_ready (msgnum, 1); if (!fmsh) m_eomsbr (eom_action); return mhlfp; } static int ask (int msgnum) { char buf[BUFSIZ]; if (mp->numsel == 1 || !interactive || redirected) return DONE; if (SOprintf ("Press to list \"%d\"...", msgnum)) { if (mp->lowsel != msgnum) printf ("\n\n\n"); printf ("Press to list \"%d\"...", msgnum); } fflush (stdout); buf[0] = 0; read (fileno (stdout), buf, sizeof buf); if (strchr(buf, '\n') == NULL) putchar ('\n'); if (told_to_quit) { told_to_quit = interrupted = 0; return NOTOK; } if (interrupted) { interrupted = 0; return OK; } return DONE; } #include static int is_nontext (int msgnum) { int result, state; unsigned char *bp, *dp; char *cp; char buf[BUFSIZ], name[NAMESZ]; FILE *fp; if (Msgs[msgnum].m_flags & MHNCHK) return (Msgs[msgnum].m_flags & MHNYES); Msgs[msgnum].m_flags |= MHNCHK; fp = msh_ready (msgnum, 1); for (state = FLD;;) switch (state = m_getfld (state, name, buf, sizeof buf, fp)) { case FLD: case FLDPLUS: case FLDEOF: /* * Check Content-Type field */ if (!mh_strcasecmp (name, TYPE_FIELD)) { int passno; char c; cp = add (buf, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof buf, fp); cp = add (buf, cp); } bp = cp; passno = 1; again: for (; isspace (*bp); bp++) continue; if (*bp == '(') { int i; for (bp++, i = 0;;) { switch (*bp++) { case '\0': invalid: result = 0; goto out; case '\\': if (*bp++ == '\0') goto invalid; continue; case '(': i++; /* and fall... */ default: continue; case ')': if (--i < 0) break; continue; } break; } } if (passno == 2) { if (*bp != '/') goto invalid; bp++; passno = 3; goto again; } for (dp = bp; istoken (*dp); dp++) continue; c = *dp; *dp = '\0'; if (!*bp) goto invalid; if (passno > 1) { if ((result = (mh_strcasecmp (bp, "plain") != 0))) goto out; *dp = c; for (dp++; isspace (*dp); dp++) continue; if (*dp) { if ((result = !uprf (dp, "charset"))) goto out; dp += sizeof "charset" - 1; while (isspace (*dp)) dp++; if (*dp++ != '=') goto invalid; while (isspace (*dp)) dp++; if (*dp == '"') { if ((bp = strchr(++dp, '"'))) *bp = '\0'; } else { for (bp = dp; *bp; bp++) if (isspace (*bp)) { *bp = '\0'; break; } } } else { /* Default character set */ dp = "US-ASCII"; } /* Check the character set */ result = !check_charset (dp, strlen (dp)); } else { if (!(result = (mh_strcasecmp (bp, "text") != 0))) { *dp = c; bp = dp; passno = 2; goto again; } } out: free (cp); if (result) { Msgs[msgnum].m_flags |= MHNYES; return result; } break; } /* * Check Content-Transfer-Encoding field */ if (!mh_strcasecmp (name, ENCODING_FIELD)) { cp = add (buf, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof buf, fp); cp = add (buf, cp); } for (bp = cp; isspace (*bp); bp++) continue; for (dp = bp; istoken (*dp); dp++) continue; *dp = '\0'; result = (mh_strcasecmp (bp, "7bit") && mh_strcasecmp (bp, "8bit") && mh_strcasecmp (bp, "binary")); free (cp); if (result) { Msgs[msgnum].m_flags |= MHNYES; return result; } break; } /* * Just skip the rest of this header * field and go to next one. */ while (state == FLDPLUS) state = m_getfld (state, name, buf, sizeof(buf), fp); break; /* * We've passed the message header, * so message is just text. */ default: return 0; } } static struct swit sortswit[] = { #define SODATE 0 { "datefield field", 0 }, #define SOSUBJ 1 { "textfield field", 0 }, #define SONSUBJ 2 { "notextfield", 0 }, #define SOLIMT 3 { "limit days", 0 }, #define SONLIMT 4 { "nolimit", 0 }, #define SOVERB 5 { "verbose", 0 }, #define SONVERB 6 { "noverbose", 0 }, #define SOHELP 7 { "help", 0 }, { NULL, 0 } }; void sortcmd (char **args) { int msgp = 0, msgnum; char *cp, *datesw = NULL, *subjsw = NULL; char buf[BUFSIZ], *msgs[MAXARGS]; struct tws tb; if (fmsh) { forkcmd (args, cmd_name); return; } while ((cp = *args++)) { if (*cp == '-') switch (smatch (++cp, sortswit)) { case AMBIGSW: ambigsw (cp, sortswit); return; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); return; case SOHELP: snprintf (buf, sizeof(buf), "%s [msgs] [switches]", cmd_name); print_help (buf, sortswit, 1); return; case SODATE: if (datesw) { advise (NULL, "only one date field at a time!"); return; } if (!(datesw = *args++) || *datesw == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } continue; case SOSUBJ: if (subjsw) { advise (NULL, "only one text field at a time!"); return; } if (!(subjsw = *args++) || *subjsw == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } continue; case SONSUBJ: subjsw = (char *)0; continue; case SOLIMT: /* too hard */ if (!(cp = *args++) || *cp == '-') { advise (NULL, "missing argument to %s", args[-2]); return; } case SONLIMT: case SOVERB: /* not implemented */ case SONVERB: continue; } if (*cp == '+' || *cp == '@') { advise (NULL, "sorry, no folders allowed!"); return; } else msgs[msgp++] = cp; } if (!msgp) msgs[msgp++] = "all"; if (!datesw) datesw = "Date"; for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) return; seq_setprev (mp); twscopy (&tb, dlocaltimenow ()); for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (Msgs[msgnum].m_scanl) { free (Msgs[msgnum].m_scanl); Msgs[msgnum].m_scanl = NULL; } if (is_selected (mp, msgnum)) { if (get_fields (datesw, subjsw, msgnum, &Msgs[msgnum])) twscopy (&Msgs[msgnum].m_tb, msgnum != mp->lowsel ? &Msgs[msgnum - 1].m_tb : &tb); } else /* m_scaln is already NULL */ twscopy (&Msgs[msgnum].m_tb, &tb); Msgs[msgnum].m_stats = mp->msgstats[msgnum - mp->lowoff]; if (mp->curmsg == msgnum) Msgs[msgnum].m_stats |= CUR; } qsort ((char *) &Msgs[mp->lowsel], mp->hghsel - mp->lowsel + 1, sizeof(struct Msg), (qsort_comp) (subjsw ? subsort : msgsort)); for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (subjsw && Msgs[msgnum].m_scanl) { free (Msgs[msgnum].m_scanl); /* from subjsort */ Msgs[msgnum].m_scanl = NULL; } mp->msgstats[msgnum - mp->lowoff] = Msgs[msgnum].m_stats & ~CUR; if (Msgs[msgnum].m_stats & CUR) seq_setcur (mp, msgnum); } mp->msgflags |= MODIFIED; modified++; } /* * get_fields - parse message, and get date and subject if needed. * We'll use the msgp->m_tb tws struct for the date, and overload * the msgp->m_scanl field with our subject string. */ static int get_fields (char *datesw, char *subjsw, int msgnum, struct Msg *msgp) { int state, gotdate = 0; char *bp, buf[BUFSIZ], name[NAMESZ]; struct tws *tw = (struct tws *) 0; register FILE *zp; zp = msh_ready (msgnum, 0); for (state = FLD;;) { switch (state = m_getfld (state, name, buf, sizeof buf, zp)) { case FLD: case FLDEOF: case FLDPLUS: if (!mh_strcasecmp (name, datesw)) { bp = getcpy (buf); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof buf, zp); bp = add (buf, bp); } if ((tw = dparsetime (bp)) == NULL) admonish (NULL, "unable to parse %s field in message %d", datesw, msgnum); else twscopy (&(msgp->m_tb), tw); free (bp); if (!subjsw) /* not using this, or already done */ break; /* all done! */ gotdate++; } else if (subjsw && !mh_strcasecmp(name, subjsw)) { bp = getcpy (buf); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof buf, zp); bp = add (buf, bp); } msgp->m_scanl = sosmash(subjsw, bp); if (gotdate) break; /* date done so we're done */ else subjsw = (char *)0;/* subject done, need date */ } else { while (state == FLDPLUS) /* flush this one */ state = m_getfld (state, name, buf, sizeof buf, zp); } continue; case BODY: case BODYEOF: case FILEEOF: break; case LENERR: case FMTERR: admonish (NULL, "format error in message %d", msgnum); if (msgp->m_scanl) { /* this might need free'd */ free (msgp->m_scanl); /* probably can't use subj anyway */ msgp->m_scanl = NULL; } return NOTOK; default: adios (NULL, "internal error -- you lose"); } break; } if (tw) return OK; /* not an error if subj not found */ admonish (NULL, "no %s field in message %d", datesw, msgnum); return NOTOK; /* NOTOK means use some other date */ } /* * sort routines */ static int msgsort (struct Msg *a, struct Msg *b) { return twsort (&a->m_tb, &b->m_tb); } static int subsort (struct Msg *a, struct Msg *b) { register int i; if (a->m_scanl && b->m_scanl) if ((i = strcmp (a->m_scanl, b->m_scanl))) return (i); return twsort (&a->m_tb, &b->m_tb); } /* * try to make the subject "canonical": delete leading "re:", everything * but letters & smash letters to lower case. */ static char * sosmash (char *subj, char *s) { register char *cp, *dp; register unsigned char c; if (s) { cp = s; dp = s; /* dst pointer */ if (!mh_strcasecmp (subj, "subject")) while ((c = *cp)) { if (! isspace(c)) { if(uprf(cp, "re:")) cp += 2; else { if (isalnum(c)) *dp++ = isupper(c) ? tolower(c) : c; break; } } cp++; } while ((c = *cp++)) { if (isalnum(c)) *dp++ = isupper(c) ? tolower(c) : c; } *dp = '\0'; } return s; } static int process (int msgnum, char *proc, int vecp, char **vec) { int child_id, status; char tmpfil[BUFSIZ]; FILE *out; char *cp; if (fmsh) { strncpy (tmpfil, m_name (msgnum), sizeof(tmpfil)); context_del (pfolder); context_replace (pfolder, fmsh);/* update current folder */ seq_save (mp); context_save (); /* save the context file */ goto ready; } cp = m_mktemp(invo_name, NULL, &out); if (cp == NULL) { /* Try again, but try to create under /tmp */ int olderr = errno; cp = m_mktemp2(NULL, invo_name, NULL, &out); if (cp == NULL) { errno = olderr; advise (NULL, "unable to create temporary file"); return NOTOK; } } copy_message (msgnum, out); fclose (out); strncpy(tmpfil, cp, sizeof(tmpfil)); ready: ; fflush (stdout); switch (child_id = fork ()) { case NOTOK: advise ("fork", "unable to"); status = NOTOK; break; case OK: closefds (3); SIGNAL (SIGINT, istat); SIGNAL (SIGQUIT, qstat); vec[vecp++] = tmpfil; vec[vecp] = NULL; execvp (proc, vec); fprintf (stderr, "unable to exec "); perror (proc); _exit (1); default: status = pidXwait (child_id, NULL); break; } if (!fmsh) unlink (tmpfil); return status; } static void copy_message (int msgnum, FILE *out) { long pos; static char buffer[BUFSIZ]; register FILE *zp; zp = msh_ready (msgnum, 1); if (fmsh) { while (fgets (buffer, sizeof buffer, zp) != NULL) { fputs (buffer, out); if (interrupted && out == stdout) break; } } else { pos = ftell (zp); while (fgets (buffer, sizeof buffer, zp) != NULL && pos < Msgs[msgnum].m_stop) { fputs (buffer, out); pos += (long) strlen (buffer); if (interrupted && out == stdout) break; } } } static void copy_digest (int msgnum, FILE *out) { char c; long pos = 0L; static char buffer[BUFSIZ]; register FILE *zp; c = '\n'; zp = msh_ready (msgnum, 1); if (!fmsh) pos = ftell (zp); while (fgets (buffer, sizeof buffer, zp) != NULL && !fmsh && pos < Msgs[msgnum].m_stop) { if (c == '\n' && *buffer == '-') fputc (' ', out); fputs (buffer, out); c = buffer[strlen (buffer) - 1]; if (!fmsh) pos += (long) strlen (buffer); if (interrupted && out == stdout) break; } } nmh-1.5/uip/new.c000644 007761 000765 00000032427 11765267273 013654 0ustar00kenhkenh000000 000000 /* * new.c -- as new, list all folders with unseen messages * -- as fnext, move to next folder with unseen messages * -- as fprev, move to previous folder with unseen messages * -- as unseen, scan all unseen messages * This code is Copyright (c) 2008, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. * * Inspired by Luke Mewburn's new: http://www.mewburn.net/luke/src/new */ #include #include #include #include #include #include #include static struct swit switches[] = { #define MODESW 0 { "mode", 1 }, #define FOLDERSSW 1 { "folders", 1 }, #define VERSIONSW 2 { "version", 1 }, #define HELPSW 3 { "help", 1 }, { NULL, 0 } }; static enum { NEW, FNEXT, FPREV, UNSEEN } run_mode = NEW; /* check_folders uses this to maintain state with both .folders list of * folders and with crawl_folders. */ struct list_state { struct node **first, **cur_node; size_t *maxlen; char *cur; char **sequences; struct node *node; }; /* Return the number of messages in a string list of message numbers. */ static int count_messages(char *field) { int total = 0; int j, k; char *cp, **ap; field = getcpy(field); /* copied from seq_read.c:seq_init */ for (ap = brkstring (field, " ", "\n"); *ap; ap++) { if ((cp = strchr(*ap, '-'))) *cp++ = '\0'; if ((j = m_atoi (*ap)) > 0) { k = cp ? m_atoi (cp) : j; total += k - j + 1; } } free(field); return total; } /* Return TRUE if the sequence 'name' is in 'sequences'. */ static boolean seq_in_list(char *name, char *sequences[]) { int i; for (i = 0; sequences[i] != NULL; i++) { if (strcmp(name, sequences[i]) == 0) { return TRUE; } } return FALSE; } /* Return the string list of message numbers from the sequences file, or NULL * if none. */ static char * get_msgnums(char *folder, char *sequences[]) { char *seqfile = concat(m_maildir(folder), "/", mh_seq, (void *)NULL); FILE *fp = fopen(seqfile, "r"); int state; char name[NAMESZ], field[BUFSIZ]; char *cp; char *msgnums = NULL, *this_msgnums, *old_msgnums; /* no sequences file -> no messages */ if (fp == NULL) { return NULL; } /* copied from seq_read.c:seq_public */ for (state = FLD;;) { switch (state = m_getfld (state, name, field, sizeof(field), fp)) { case FLD: case FLDPLUS: case FLDEOF: if (state == FLDPLUS) { cp = getcpy (field); while (state == FLDPLUS) { state = m_getfld (state, name, field, sizeof(field), fp); cp = add (field, cp); } /* Here's where we differ from seq_public: if it's in a * sequence we want, save the list of messages. */ if (seq_in_list(name, sequences)) { this_msgnums = trimcpy(cp); if (msgnums == NULL) { msgnums = this_msgnums; } else { old_msgnums = msgnums; msgnums = concat(old_msgnums, " ", this_msgnums, (void *)NULL); free(old_msgnums); free(this_msgnums); } } free (cp); } else { /* and here */ if (seq_in_list(name, sequences)) { this_msgnums = trimcpy(field); if (msgnums == NULL) { msgnums = this_msgnums; } else { old_msgnums = msgnums; msgnums = concat(old_msgnums, " ", this_msgnums, (void *)NULL); free(old_msgnums); free(this_msgnums); } } } if (state == FLDEOF) break; continue; case BODY: case BODYEOF: adios (NULL, "no blank lines are permitted in %s", seqfile); /* fall */ case FILEEOF: break; default: adios (NULL, "%s is poorly formatted", seqfile); } break; /* break from for loop */ } fclose(fp); return msgnums; } /* Check `folder' (of length `len') for interesting messages, filling in the * list in `b'. */ static void check_folder(char *folder, size_t len, struct list_state *b) { char *msgnums = get_msgnums(folder, b->sequences); int is_cur = strcmp(folder, b->cur) == 0; if (is_cur || msgnums != NULL) { if (*b->first == NULL) { *b->first = b->node = mh_xmalloc(sizeof(*b->node)); } else { b->node->n_next = mh_xmalloc(sizeof(*b->node)); b->node = b->node->n_next; } b->node->n_name = folder; b->node->n_field = msgnums; if (*b->maxlen < len) { *b->maxlen = len; } } /* Save the node for the current folder, so we can fall back to it. */ if (is_cur) { *b->cur_node = b->node; } } static boolean crawl_callback(char *folder, void *baton) { check_folder(folder, strlen(folder), baton); return TRUE; } /* Scan folders, returning: * first -- list of nodes for all folders which have desired messages; * if the current folder is listed in .folders, it is also in * the list regardless of whether it has any desired messages * last -- last node in list * cur_node -- node of current folder, if listed in .folders * maxlen -- length of longest folder name * * `cur' points to the name of the current folder, `folders' points to the * name of a .folder (if NULL, crawl all folders), and `sequences' points to * the array of sequences for which to look. * * An empty list is returned as first=last=NULL. */ static void check_folders(struct node **first, struct node **last, struct node **cur_node, size_t *maxlen, char *cur, char *folders, char *sequences[]) { struct list_state b; FILE *fp; char *line; size_t len; *first = *last = *cur_node = NULL; *maxlen = 0; b.first = first; b.cur_node = cur_node; b.maxlen = maxlen; b.cur = cur; b.sequences = sequences; if (folders == NULL) { chdir(m_maildir("")); crawl_folders(".", crawl_callback, &b); } else { fp = fopen(folders, "r"); if (fp == NULL) { adios(NULL, "failed to read %s", folders); } while (vfgets(fp, &line) == OK) { len = strlen(line) - 1; line[len] = '\0'; check_folder(getcpy(line), len, &b); } fclose(fp); } if (*first != NULL) { b.node->n_next = NULL; *last = b.node; } } /* Return a single string of the `sequences' joined by a space (' '). */ static char * join_sequences(char *sequences[]) { int i; size_t len = 0; char *result, *cp; for (i = 0; sequences[i] != NULL; i++) { len += strlen(sequences[i]) + 1; } result = mh_xmalloc(len + 1); for (i = 0, cp = result; sequences[i] != NULL; i++, cp += len + 1) { len = strlen(sequences[i]); memcpy(cp, sequences[i], len); cp[len] = ' '; } /* -1 to overwrite the last delimiter */ *--cp = '\0'; return result; } /* Return a struct node for the folder to change to. This is the next * (previous, if FPREV mode) folder with desired messages, or the current * folder if no folders have desired. If NEW or UNSEEN mode, print the * output but don't change folders. * * n_name is the folder to change to, and n_field is the string list of * desired message numbers. */ static struct node * doit(char *cur, char *folders, char *sequences[]) { struct node *first, *cur_node, *node, *last, *prev; size_t folder_len; int count, total = 0; char *command = NULL, *sequences_s = NULL; if (cur == NULL || cur[0] == '\0') { cur = "inbox"; } check_folders(&first, &last, &cur_node, &folder_len, cur, folders, sequences); if (run_mode == FNEXT || run_mode == FPREV) { if (first == NULL) { /* No folders at all... */ return NULL; } else if (first->n_next == NULL) { /* We have only one node; any desired messages in it? */ if (first->n_field == NULL) { return NULL; } else { return first; } } else if (cur_node == NULL) { /* Current folder is not listed in .folders, return first. */ return first; } } else if (run_mode == UNSEEN) { sequences_s = join_sequences(sequences); } for (node = first, prev = NULL; node != NULL; prev = node, node = node->n_next) { if (run_mode == FNEXT) { /* If we have a previous node and it is the current * folder, return this node. */ if (prev != NULL && strcmp(prev->n_name, cur) == 0) { return node; } } else if (run_mode == FPREV) { if (strcmp(node->n_name, cur) == 0) { /* Found current folder in fprev mode; if we have a * previous node in the list, return it; else return * the last node. */ if (prev == NULL) { return last; } return prev; } } else if (run_mode == UNSEEN) { if (node->n_field == NULL) { continue; } printf("\n%d %s messages in %s", count_messages(node->n_field), sequences_s, node->n_name); if (strcmp(node->n_name, cur) == 0) { puts(" (*: current folder)"); } else { puts(""); } fflush(stdout); /* TODO: Split enough of scan.c out so that we can call it here. */ command = concat("scan +", node->n_name, " ", sequences_s, (void *)NULL); system(command); free(command); } else { if (node->n_field == NULL) { continue; } count = count_messages(node->n_field); total += count; printf("%-*s %6d.%c %s\n", (int) folder_len, node->n_name, count, (strcmp(node->n_name, cur) == 0 ? '*' : ' '), node->n_field); } } /* If we're fnext, we haven't checked the last node yet. If it's the * current folder, return the first node. */ if (run_mode == FNEXT && strcmp(last->n_name, cur) == 0) { return first; } if (run_mode == NEW) { printf("%-*s %6d.\n", (int) folder_len, " total", total); } return cur_node; } int main(int argc, char **argv) { char **ap, *cp, **argp, **arguments; char help[BUFSIZ]; char *folders = NULL; char *sequences[NUMATTRS + 1]; int i = 0; char *unseen; struct node *folder; sequences[0] = NULL; sequences[1] = NULL; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex(argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (help, sizeof(help), "%s [switches] [sequences]", invo_name); print_help (help, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case FOLDERSSW: if (!(folders = *argp++) || *folders == '-') adios(NULL, "missing argument to %s", argp[-2]); continue; case MODESW: if (!(invo_name = *argp++) || *invo_name == '-') adios(NULL, "missing argument to %s", argp[-2]); invo_name = r1bindex(invo_name, '/'); continue; } } /* have a sequence argument */ if (!seq_in_list(cp, sequences)) { sequences[i++] = cp; sequences[i] = NULL; } } if (strcmp(invo_name, "fnext") == 0) { run_mode = FNEXT; } else if (strcmp(invo_name, "fprev") == 0) { run_mode = FPREV; } else if (strcmp(invo_name, "unseen") == 0) { run_mode = UNSEEN; } if (folders == NULL) { /* will flists */ } else { if (folders[0] != '/') { folders = m_maildir(folders); } } if (i == 0) { /* no sequence arguments; use unseen */ unseen = context_find(usequence); if (unseen == NULL || unseen[0] == '\0') { adios(NULL, "must specify sequences or set %s", usequence); } for (ap = brkstring(unseen, " ", "\n"); *ap; ap++) { sequences[i++] = *ap; } } sequences[i] = NULL; folder = doit(context_find(pfolder), folders, sequences); if (folder == NULL) { done(0); return 1; } if (run_mode == UNSEEN) { /* All the scan(1)s it runs change the current folder, so we * need to put it back. Unfortunately, context_replace lamely * ignores the new value you give it if it is the same one it * has in memory. So, we'll be lame, too. I'm not sure if i * should just change context_replace... */ context_replace(pfolder, "defeat_context_replace_optimization"); } /* update current folder */ context_replace(pfolder, folder->n_name); if (run_mode == FNEXT || run_mode == FPREV) { printf("%s %s\n", folder->n_name, folder->n_field); } context_save(); done (0); return 1; } nmh-1.5/uip/packf.c000644 007761 000765 00000010541 11765267273 014140 0ustar00kenhkenh000000 000000 /* * packf.c -- pack a nmh folder into a file * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include static struct swit switches[] = { #define FILESW 0 { "file name", 0 }, #define MBOXSW 1 { "mbox", 0 }, #define MMDFSW 2 { "mmdf", 0 }, #define VERSIONSW 3 { "version", 0 }, #define HELPSW 4 { "help", 0 }, { NULL, 0 } }; static int md = NOTOK; static int mbx_style = MBOX_FORMAT; static int mapping = 0; static void mbxclose_done(int) NORETURN; char *file = NULL; int main (int argc, char **argv) { int fd, msgnum; char *cp, *maildir, *msgnam, *folder = NULL, buf[BUFSIZ]; char **argp, **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; struct stat st; done=mbxclose_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case FILESW: if (file) adios (NULL, "only one file at a time!"); if (!(file = *argp++) || *file == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case MBOXSW: mbx_style = MBOX_FORMAT; mapping = 0; continue; case MMDFSW: mbx_style = MMDF_FORMAT; mapping = 1; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); } if (!file) file = "./msgbox"; file = path (file, TFILE); /* * Check if file to be created (or appended to) * exists. If not, ask for confirmation. */ if (stat (file, &st) == NOTOK) { if (errno != ENOENT) adios (file, "error on file"); cp = concat ("Create file \"", file, "\"? ", NULL); if (!getanswer (cp)) done (1); free (cp); } if (!context_find ("path")) free (path ("./", TFOLDER)); /* default is to pack whole folder */ if (!msgs.size) app_msgarg(&msgs, "all"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to "); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ /* open and lock new maildrop file */ if ((md = mbx_open(file, mbx_style, getuid(), getgid(), m_gmprot())) == NOTOK) adios (file, "unable to open"); /* copy all the SELECTED messages to the file */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected(mp, msgnum)) { if ((fd = open (msgnam = m_name (msgnum), O_RDONLY)) == NOTOK) { admonish (msgnam, "unable to read message"); break; } if (mbx_copy (file, mbx_style, md, fd, mapping, NULL, 1) == NOTOK) adios (file, "error writing to file"); close (fd); } /* close and unlock maildrop file */ mbx_close (file, md); context_replace (pfolder, folder); /* update current folder */ if (mp->hghsel != mp->curmsg) seq_setcur (mp, mp->lowsel); seq_save (mp); context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ done (0); return 1; } static void mbxclose_done (int status) { mbx_close (file, md); exit (status); } nmh-1.5/uip/pick.c000644 007761 000765 00000016113 11765267273 014003 0ustar00kenhkenh000000 000000 /* * pick.c -- search for messages by content * * This code is Copyright (c) 2002, 2008, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include static struct swit switches[] = { #define ANDSW 0 { "and", 0 }, #define ORSW 1 { "or", 0 }, #define NOTSW 2 { "not", 0 }, #define LBRSW 3 { "lbrace", 0 }, #define RBRSW 4 { "rbrace", 0 }, #define CCSW 5 { "cc pattern", 0 }, #define DATESW 6 { "date pattern", 0 }, #define FROMSW 7 { "from pattern", 0 }, #define SRCHSW 8 { "search pattern", 0 }, #define SUBJSW 9 { "subject pattern", 0 }, #define TOSW 10 { "to pattern", 0 }, #define OTHRSW 11 { "-othercomponent pattern", 0 }, #define AFTRSW 12 { "after date", 0 }, #define BEFRSW 13 { "before date", 0 }, #define DATFDSW 14 { "datefield field", 5 }, #define SEQSW 15 { "sequence name", 0 }, #define PUBLSW 16 { "public", 0 }, #define NPUBLSW 17 { "nopublic", 0 }, #define ZEROSW 18 { "zero", 0 }, #define NZEROSW 19 { "nozero", 0 }, #define LISTSW 20 { "list", 0 }, #define NLISTSW 21 { "nolist", 0 }, #define VERSIONSW 22 { "version", 0 }, #define HELPSW 23 { "help", 0 }, { NULL, 0 } }; static int listsw = -1; static void putzero_done (int) NORETURN; int main (int argc, char **argv) { int publicsw = -1, zerosw = 1, vecp = 0; size_t seqp = 0; int lo, hi, msgnum; char *maildir, *folder = NULL, buf[100]; char *cp, **argp, **arguments; char *seqs[NUMATTRS + 1], *vec[MAXARGS]; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; register FILE *fp; done=putzero_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { if (*++cp == '-') { vec[vecp++] = --cp; goto pattern; } switch (smatch (cp, switches)) { case AMBIGSW: ambigsw (cp, switches); listsw = 0; /* HACK */ done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); listsw = 0; /* HACK */ done (1); case VERSIONSW: print_version(invo_name); listsw = 0; /* HACK */ done (1); case CCSW: case DATESW: case FROMSW: case SUBJSW: case TOSW: case DATFDSW: case AFTRSW: case BEFRSW: case SRCHSW: vec[vecp++] = --cp; pattern: if (!(cp = *argp++))/* allow -xyz arguments */ adios (NULL, "missing argument to %s", argp[-2]); vec[vecp++] = cp; continue; case OTHRSW: adios (NULL, "internal error!"); case ANDSW: case ORSW: case NOTSW: case LBRSW: case RBRSW: vec[vecp++] = --cp; continue; case SEQSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); /* check if too many sequences specified */ if (seqp >= NUMATTRS) adios (NULL, "too many sequences (more than %d) specified", NUMATTRS); if (!seq_nameok (cp)) done (1); seqs[seqp++] = cp; continue; case PUBLSW: publicsw = 1; continue; case NPUBLSW: publicsw = 0; continue; case ZEROSW: zerosw++; continue; case NZEROSW: zerosw = 0; continue; case LISTSW: listsw = 1; continue; case NLISTSW: listsw = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } vec[vecp] = NULL; if (!context_find ("path")) free (path ("./", TFOLDER)); /* * If we didn't specify which messages to search, * then search the whole folder. */ if (!msgs.size) app_msgarg(&msgs, "all"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ /* * If we aren't saving the results to a sequence, * we default to list the results. */ if (listsw == -1) listsw = !seqp; if (publicsw == 1 && is_readonly(mp)) adios (NULL, "folder %s is read-only, so -public not allowed", folder); if (!pcompile (vec, NULL)) done (1); lo = mp->lowsel; hi = mp->hghsel; /* If printing message numbers to standard out, force line buffering on. */ if (listsw) setvbuf (stdout, NULL, _IOLBF, 0); /* * Scan through all the SELECTED messages and check for a * match. If the message does not match, then unselect it. */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) { if ((fp = fopen (cp = m_name (msgnum), "r")) == NULL) admonish (cp, "unable to read message"); if (fp && pmatches (fp, msgnum, 0L, 0L)) { if (msgnum < lo) lo = msgnum; if (msgnum > hi) hi = msgnum; if (listsw) printf ("%s\n", m_name (msgnum)); } else { /* if it doesn't match, then unselect it */ unset_selected (mp, msgnum); mp->numsel--; } if (fp) fclose (fp); } } mp->lowsel = lo; mp->hghsel = hi; if (mp->numsel <= 0) adios (NULL, "no messages match specification"); seqs[seqp] = NULL; /* * Add the matching messages to sequences */ for (seqp = 0; seqs[seqp]; seqp++) if (!seq_addsel (mp, seqs[seqp], publicsw, zerosw)) done (1); /* * Print total matched if not printing each matched message number. */ if (!listsw) { printf ("%d hit%s\n", mp->numsel, mp->numsel == 1 ? "" : "s"); } context_replace (pfolder, folder); /* update current folder */ seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ done (0); return 1; } static void putzero_done (int status) { if (listsw && status && !isatty (fileno (stdout))) printf ("0\n"); exit (status); } nmh-1.5/uip/picksbr.c000644 007761 000765 00000046217 11762736347 014522 0ustar00kenhkenh000000 000000 /* * picksbr.c -- routines to help pick along... * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #ifdef HAVE_SYS_TIME_H # include #endif #include static struct swit parswit[] = { #define PRAND 0 { "and", 0 }, #define PROR 1 { "or", 0 }, #define PRNOT 2 { "not", 0 }, #define PRLBR 3 { "lbrace", 0 }, #define PRRBR 4 { "rbrace", 0 }, #define PRCC 5 { "cc pattern", 0 }, #define PRDATE 6 { "date pattern", 0 }, #define PRFROM 7 { "from pattern", 0 }, #define PRSRCH 8 { "search pattern", 0 }, #define PRSUBJ 9 { "subject pattern", 0 }, #define PRTO 10 { "to pattern", 0 }, #define PROTHR 11 { "-othercomponent pattern", 15 }, #define PRAFTR 12 { "after date", 0 }, #define PRBEFR 13 { "before date", 0 }, #define PRDATF 14 { "datefield field", 5 }, { NULL, 0 } }; /* DEFINITIONS FOR PATTERN MATCHING */ /* * We really should be using re_comp() and re_exec() here. Unfortunately, * pick advertises that lowercase characters matches characters of both * cases. Since re_exec() doesn't exhibit this behavior, we are stuck * with this version. Furthermore, we need to be able to save and restore * the state of the pattern matcher in order to do things "efficiently". * * The matching power of this algorithm isn't as powerful as the re_xxx() * routines (no \(xxx\) and \n constructs). Such is life. */ #define CCHR 2 #define CDOT 4 #define CCL 6 #define NCCL 8 #define CDOL 10 #define CEOF 11 #define STAR 01 #define LBSIZE 1024 #define ESIZE 1024 static char linebuf[LBSIZE + 1]; /* the magic array for case-independence */ static unsigned char cc[] = { 0000,0001,0002,0003,0004,0005,0006,0007, 0010,0011,0012,0013,0014,0015,0016,0017, 0020,0021,0022,0023,0024,0025,0026,0027, 0030,0031,0032,0033,0034,0035,0036,0037, 0040,0041,0042,0043,0044,0045,0046,0047, 0050,0051,0052,0053,0054,0055,0056,0057, 0060,0061,0062,0063,0064,0065,0066,0067, 0070,0071,0072,0073,0074,0075,0076,0077, 0100,0141,0142,0143,0144,0145,0146,0147, 0150,0151,0152,0153,0154,0155,0156,0157, 0160,0161,0162,0163,0164,0165,0166,0167, 0170,0171,0172,0133,0134,0135,0136,0137, 0140,0141,0142,0143,0144,0145,0146,0147, 0150,0151,0152,0153,0154,0155,0156,0157, 0160,0161,0162,0163,0164,0165,0166,0167, 0170,0171,0172,0173,0174,0175,0176,0177, 0200,0201,0202,0203,0204,0205,0206,0207, 0210,0211,0212,0213,0214,0215,0216,0217, 0220,0221,0222,0223,0224,0225,0226,0227, 0230,0231,0232,0233,0234,0235,0236,0237, 0240,0241,0242,0243,0244,0245,0246,0247, 0250,0251,0252,0253,0254,0255,0256,0257, 0260,0261,0262,0263,0264,0265,0266,0267, 0270,0271,0272,0273,0274,0275,0276,0277, 0300,0301,0302,0303,0304,0305,0306,0307, 0310,0311,0312,0313,0314,0315,0316,0317, 0320,0321,0322,0323,0324,0325,0326,0327, 0330,0331,0332,0333,0334,0335,0336,0337, 0340,0341,0342,0343,0344,0345,0346,0347, 0350,0351,0352,0353,0354,0355,0356,0357, 0360,0361,0362,0363,0364,0365,0366,0367, 0370,0371,0372,0373,0374,0375,0376,0377, }; /* * DEFINITIONS FOR NEXUS */ #define nxtarg() (*argp ? *argp++ : NULL) #define prvarg() argp-- #define padvise if (!talked++) advise struct nexus { int (*n_action)(); union { /* for {OR,AND,NOT}action */ struct { struct nexus *un_L_child; struct nexus *un_R_child; } st1; /* for GREPaction */ struct { int un_header; int un_circf; char un_expbuf[ESIZE]; char *un_patbuf; } st2; /* for TWSaction */ struct { char *un_datef; int un_after; struct tws un_tws; } st3; } un; }; #define n_L_child un.st1.un_L_child #define n_R_child un.st1.un_R_child #define n_header un.st2.un_header #define n_circf un.st2.un_circf #define n_expbuf un.st2.un_expbuf #define n_patbuf un.st2.un_patbuf #define n_datef un.st3.un_datef #define n_after un.st3.un_after #define n_tws un.st3.un_tws static int talked; static int pdebug = 0; static char *datesw; static char **argp; static struct nexus *head; /* * prototypes for date routines */ static struct tws *tws_parse(char *, int); static struct tws *tws_special(char *); /* * static prototypes */ static void PRaction(struct nexus *, int); static int gcompile(struct nexus *, char *); static int advance(char *, char *); static int cclass(unsigned char *, int, int); static int tcompile(char *, struct tws *, int); static struct nexus *parse(void); static struct nexus *nexp1(void); static struct nexus *nexp2(void); static struct nexus *nexp3(void); static struct nexus *newnexus(int (*)()); static int ORaction(); static int ANDaction(); static int NOTaction(); static int GREPaction(); static int TWSaction(); int pcompile (char **vec, char *date) { register char *cp; if ((cp = getenv ("MHPDEBUG")) && *cp) pdebug++; argp = vec; if ((datesw = date) == NULL) datesw = "date"; talked = 0; if ((head = parse ()) == NULL) return (talked ? 0 : 1); if (*argp) { padvise (NULL, "%s unexpected", *argp); return 0; } return 1; } static struct nexus * parse (void) { register char *cp; register struct nexus *n, *o; if ((n = nexp1 ()) == NULL || (cp = nxtarg ()) == NULL) return n; if (*cp != '-') { padvise (NULL, "%s unexpected", cp); return NULL; } if (*++cp == '-') goto header; switch (smatch (cp, parswit)) { case AMBIGSW: ambigsw (cp, parswit); talked++; return NULL; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); talked++; return NULL; case PROR: o = newnexus (ORaction); o->n_L_child = n; if ((o->n_R_child = parse ())) return o; padvise (NULL, "missing disjunctive"); return NULL; header: ; default: prvarg (); return n; } } static struct nexus * nexp1 (void) { register char *cp; register struct nexus *n, *o; if ((n = nexp2 ()) == NULL || (cp = nxtarg ()) == NULL) return n; if (*cp != '-') { padvise (NULL, "%s unexpected", cp); return NULL; } if (*++cp == '-') goto header; switch (smatch (cp, parswit)) { case AMBIGSW: ambigsw (cp, parswit); talked++; return NULL; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); talked++; return NULL; case PRAND: o = newnexus (ANDaction); o->n_L_child = n; if ((o->n_R_child = nexp1 ())) return o; padvise (NULL, "missing conjunctive"); return NULL; header: ; default: prvarg (); return n; } } static struct nexus * nexp2 (void) { register char *cp; register struct nexus *n; if ((cp = nxtarg ()) == NULL) return NULL; if (*cp != '-') { prvarg (); return nexp3 (); } if (*++cp == '-') goto header; switch (smatch (cp, parswit)) { case AMBIGSW: ambigsw (cp, parswit); talked++; return NULL; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); talked++; return NULL; case PRNOT: n = newnexus (NOTaction); if ((n->n_L_child = nexp3 ())) return n; padvise (NULL, "missing negation"); return NULL; header: ; default: prvarg (); return nexp3 (); } } static struct nexus * nexp3 (void) { int i; register char *cp, *dp; char buffer[BUFSIZ], temp[64]; register struct nexus *n; if ((cp = nxtarg ()) == NULL) return NULL; if (*cp != '-') { padvise (NULL, "%s unexpected", cp); return NULL; } if (*++cp == '-') { dp = ++cp; goto header; } switch (i = smatch (cp, parswit)) { case AMBIGSW: ambigsw (cp, parswit); talked++; return NULL; case UNKWNSW: fprintf (stderr, "-%s unknown\n", cp); talked++; return NULL; case PRLBR: if ((n = parse ()) == NULL) { padvise (NULL, "missing group"); return NULL; } if ((cp = nxtarg ()) == NULL) { padvise (NULL, "missing -rbrace"); return NULL; } if (*cp++ == '-' && smatch (cp, parswit) == PRRBR) return n; padvise (NULL, "%s unexpected", --cp); return NULL; default: prvarg (); return NULL; case PRCC: case PRDATE: case PRFROM: case PRTO: case PRSUBJ: strncpy(temp, parswit[i].sw, sizeof(temp)); temp[sizeof(temp) - 1] = '\0'; dp = *brkstring (temp, " ", NULL); header: ; if (!(cp = nxtarg ())) {/* allow -xyz arguments */ padvise (NULL, "missing argument to %s", argp[-2]); return NULL; } n = newnexus (GREPaction); n->n_header = 1; snprintf (buffer, sizeof(buffer), "^%s[ \t]*:.*%s", dp, cp); dp = buffer; goto pattern; case PRSRCH: n = newnexus (GREPaction); n->n_header = 0; if (!(cp = nxtarg ())) {/* allow -xyz arguments */ padvise (NULL, "missing argument to %s", argp[-2]); return NULL; } dp = cp; pattern: ; if (!gcompile (n, dp)) { padvise (NULL, "pattern error in %s %s", argp[-2], cp); return NULL; } n->n_patbuf = getcpy (dp); return n; case PROTHR: padvise (NULL, "internal error!"); return NULL; case PRDATF: if (!(datesw = nxtarg ()) || *datesw == '-') { padvise (NULL, "missing argument to %s", argp[-2]); return NULL; } return nexp3 (); case PRAFTR: case PRBEFR: if (!(cp = nxtarg ())) {/* allow -xyz arguments */ padvise (NULL, "missing argument to %s", argp[-2]); return NULL; } n = newnexus (TWSaction); n->n_datef = datesw; if (!tcompile (cp, &n->n_tws, n->n_after = i == PRAFTR)) { padvise (NULL, "unable to parse %s %s", argp[-2], cp); return NULL; } return n; } } static struct nexus * newnexus (int (*action)()) { register struct nexus *p; if ((p = (struct nexus *) calloc ((size_t) 1, sizeof *p)) == NULL) adios (NULL, "unable to allocate component storage"); p->n_action = action; return p; } #define args(a) a, fp, msgnum, start, stop #define params args (n) #define plist \ register struct nexus *n; \ register FILE *fp; \ int msgnum; \ long start, \ stop; int pmatches (FILE *fp, int msgnum, long start, long stop) { if (!head) return 1; if (!talked++ && pdebug) PRaction (head, 0); return (*head->n_action) (args (head)); } static void PRaction (struct nexus *n, int level) { register int i; for (i = 0; i < level; i++) fprintf (stderr, "| "); if (n->n_action == ORaction) { fprintf (stderr, "OR\n"); PRaction (n->n_L_child, level + 1); PRaction (n->n_R_child, level + 1); return; } if (n->n_action == ANDaction) { fprintf (stderr, "AND\n"); PRaction (n->n_L_child, level + 1); PRaction (n->n_R_child, level + 1); return; } if (n->n_action == NOTaction) { fprintf (stderr, "NOT\n"); PRaction (n->n_L_child, level + 1); return; } if (n->n_action == GREPaction) { fprintf (stderr, "PATTERN(%s) %s\n", n->n_header ? "header" : "body", n->n_patbuf); return; } if (n->n_action == TWSaction) { fprintf (stderr, "TEMPORAL(%s) %s: %s\n", n->n_after ? "after" : "before", n->n_datef, dasctime (&n->n_tws, TW_NULL)); return; } fprintf (stderr, "UNKNOWN(0x%x)\n", (unsigned int)(unsigned long) (*n->n_action)); } static int ORaction (params) plist { if ((*n->n_L_child->n_action) (args (n->n_L_child))) return 1; return (*n->n_R_child->n_action) (args (n->n_R_child)); } static int ANDaction (params) plist { if (!(*n->n_L_child->n_action) (args (n->n_L_child))) return 0; return (*n->n_R_child->n_action) (args (n->n_R_child)); } static int NOTaction (params) plist { return (!(*n->n_L_child->n_action) (args (n->n_L_child))); } static int gcompile (struct nexus *n, char *astr) { register int c; int cclcnt; register unsigned char *ep, *dp, *sp, *lastep = 0; dp = (ep = n->n_expbuf) + sizeof n->n_expbuf; sp = astr; if (*sp == '^') { n->n_circf = 1; sp++; } else n->n_circf = 0; for (;;) { if (ep >= dp) goto cerror; if ((c = *sp++) != '*') lastep = ep; switch (c) { case '\0': *ep++ = CEOF; return 1; case '.': *ep++ = CDOT; continue; case '*': if (lastep == 0) goto defchar; *lastep |= STAR; continue; case '$': if (*sp != '\0') goto defchar; *ep++ = CDOL; continue; case '[': *ep++ = CCL; *ep++ = 0; cclcnt = 0; if ((c = *sp++) == '^') { c = *sp++; ep[-2] = NCCL; } if (c == '-') { *ep++ = c; cclcnt++; c = *sp++; } do { if (c == '-' && *sp != '\0' && *sp != ']') { for (c = ep[-1]+1; c < *sp; c++) { *ep++ = c; cclcnt++; if (c == '\0' || ep >= dp) goto cerror; } } else { *ep++ = c; cclcnt++; if (c == '\0' || ep >= dp) goto cerror; } } while ((c = *sp++) != ']'); if (cclcnt > 255) goto cerror; lastep[1] = cclcnt; continue; case '\\': if ((c = *sp++) == '\0') goto cerror; defchar: default: *ep++ = CCHR; *ep++ = c; } } cerror: ; return 0; } static int GREPaction (params) plist { int c, body, lf; long pos = start; register char *p1, *p2, *ebp, *cbp; char ibuf[BUFSIZ]; NMH_UNUSED (msgnum); fseek (fp, start, SEEK_SET); body = 0; ebp = cbp = ibuf; for (;;) { if (body && n->n_header) return 0; p1 = linebuf; p2 = cbp; lf = 0; for (;;) { if (p2 >= ebp) { if (fgets (ibuf, sizeof ibuf, fp) == NULL || (stop && pos >= stop)) { if (lf) break; return 0; } pos += (long) strlen (ibuf); p2 = ibuf; ebp = ibuf + strlen (ibuf); } c = *p2++; if (lf && c != '\n') { if (c != ' ' && c != '\t') { --p2; break; } else lf = 0; } if (c == '\n') { if (body) break; else { if (lf) { body++; break; } lf++; c = ' '; } } if (c && p1 < &linebuf[LBSIZE - 1]) *p1++ = c; } *p1++ = 0; cbp = p2; p1 = linebuf; p2 = n->n_expbuf; if (n->n_circf) { if (advance (p1, p2)) return 1; continue; } if (*p2 == CCHR) { c = p2[1]; do { if (*p1 == c || cc[(unsigned char)*p1] == c) if (advance (p1, p2)) return 1; } while (*p1++); continue; } do { if (advance (p1, p2)) return 1; } while (*p1++); } } static int advance (char *alp, char *aep) { register unsigned char *lp, *ep, *curlp; lp = (unsigned char *)alp; ep = (unsigned char *)aep; for (;;) switch (*ep++) { case CCHR: if (*ep++ == *lp++ || ep[-1] == cc[lp[-1]]) continue; return 0; case CDOT: if (*lp++) continue; return 0; case CDOL: if (*lp == 0) continue; return 0; case CEOF: return 1; case CCL: if (cclass (ep, *lp++, 1)) { ep += *ep + 1; continue; } return 0; case NCCL: if (cclass (ep, *lp++, 0)) { ep += *ep + 1; continue; } return 0; case CDOT | STAR: curlp = lp; while (*lp++) continue; goto star; case CCHR | STAR: curlp = lp; while (*lp++ == *ep || cc[lp[-1]] == *ep) continue; ep++; goto star; case CCL | STAR: case NCCL | STAR: curlp = lp; while (cclass (ep, *lp++, ep[-1] == (CCL | STAR))) continue; ep += *ep + 1; goto star; star: do { lp--; if (advance (lp, ep)) return (1); } while (lp > curlp); return 0; default: admonish (NULL, "advance() botch -- you lose big"); return 0; } } static int cclass (unsigned char *aset, int ac, int af) { register unsigned int n; register unsigned char c, *set; set = aset; if ((c = ac) == 0) return (0); n = *set++; while (n--) if (*set++ == c || set[-1] == cc[c]) return (af); return (!af); } static int tcompile (char *ap, struct tws *tb, int isafter) { register struct tws *tw; if ((tw = tws_parse (ap, isafter)) == NULL) return 0; twscopy (tb, tw); return 1; } static struct tws * tws_parse (char *ap, int isafter) { char buffer[BUFSIZ]; register struct tws *tw, *ts; if ((tw = tws_special (ap)) != NULL) { tw->tw_sec = tw->tw_min = isafter ? 59 : 0; tw->tw_hour = isafter ? 23 : 0; return tw; } if ((tw = dparsetime (ap)) != NULL) return tw; if ((ts = dlocaltimenow ()) == NULL) return NULL; snprintf (buffer, sizeof(buffer), "%s %s", ap, dtwszone (ts)); if ((tw = dparsetime (buffer)) != NULL) return tw; snprintf (buffer, sizeof(buffer), "%s %02d:%02d:%02d %s", ap, ts->tw_hour, ts->tw_min, ts->tw_sec, dtwszone (ts)); if ((tw = dparsetime (buffer)) != NULL) return tw; snprintf (buffer, sizeof(buffer), "%02d %s %04d %s", ts->tw_mday, tw_moty[ts->tw_mon], ts->tw_year, ap); if ((tw = dparsetime (buffer)) != NULL) return tw; snprintf (buffer, sizeof(buffer), "%02d %s %04d %s %s", ts->tw_mday, tw_moty[ts->tw_mon], ts->tw_year, ap, dtwszone (ts)); if ((tw = dparsetime (buffer)) != NULL) return tw; return NULL; } static struct tws * tws_special (char *ap) { int i; time_t clock; register struct tws *tw; time (&clock); if (!mh_strcasecmp (ap, "today")) return dlocaltime (&clock); if (!mh_strcasecmp (ap, "yesterday")) { clock -= (long) (60 * 60 * 24); return dlocaltime (&clock); } if (!mh_strcasecmp (ap, "tomorrow")) { clock += (long) (60 * 60 * 24); return dlocaltime (&clock); } for (i = 0; tw_ldotw[i]; i++) if (!mh_strcasecmp (ap, tw_ldotw[i])) break; if (tw_ldotw[i]) { if ((tw = dlocaltime (&clock)) == NULL) return NULL; if ((i -= tw->tw_wday) > 0) i -= 7; } else if (*ap != '-') return NULL; else /* -ddd days ago */ i = atoi (ap); /* we should error check this */ clock += (long) ((60 * 60 * 24) * i); return dlocaltime (&clock); } static int TWSaction (params) plist { int state; register char *bp; char buf[BUFSIZ], name[NAMESZ]; register struct tws *tw; NMH_UNUSED (stop); fseek (fp, start, SEEK_SET); for (state = FLD, bp = NULL;;) { switch (state = m_getfld (state, name, buf, sizeof buf, fp)) { case FLD: case FLDEOF: case FLDPLUS: if (bp != NULL) free (bp), bp = NULL; bp = add (buf, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof buf, fp); bp = add (buf, bp); } if (!mh_strcasecmp (name, n->n_datef)) break; if (state != FLDEOF) continue; case BODY: case BODYEOF: case FILEEOF: case LENERR: case FMTERR: if (state == LENERR || state == FMTERR) advise (NULL, "format error in message %d", msgnum); if (bp != NULL) free (bp); return 0; default: adios (NULL, "internal error -- you lose"); } break; } if ((tw = dparsetime (bp)) == NULL) advise (NULL, "unable to parse %s field in message %d, matching...", n->n_datef, msgnum), state = 1; else state = n->n_after ? (twsort (tw, &n->n_tws) > 0) : (twsort (tw, &n->n_tws) < 0); if (bp != NULL) free (bp); return state; } nmh-1.5/uip/popsbr.c000644 007761 000765 00000050574 11762736347 014373 0ustar00kenhkenh000000 000000 /* * popsbr.c -- POP client subroutines * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #ifdef CYRUS_SASL # include # include #endif /* CYRUS_SASL */ #include #include #include #include #define TRM "." #define TRMLEN (sizeof TRM - 1) static int poprint = 0; static int pophack = 0; char response[BUFSIZ]; static FILE *input; static FILE *output; #ifdef CYRUS_SASL static sasl_conn_t *conn; /* SASL connection state */ static int sasl_complete = 0; /* Has sasl authentication succeeded? */ static int maxoutbuf; /* Maximum output buffer size */ static sasl_ssf_t sasl_ssf = 0; /* Security strength factor */ static int sasl_get_user(void *, int, const char **, unsigned *); static int sasl_get_pass(sasl_conn_t *, void *, int, sasl_secret_t **); struct pass_context { char *user; char *host; }; static sasl_callback_t callbacks[] = { { SASL_CB_USER, sasl_get_user, NULL }, #define POP_SASL_CB_N_USER 0 { SASL_CB_PASS, sasl_get_pass, NULL }, #define POP_SASL_CB_N_PASS 1 { SASL_CB_LOG, NULL, NULL }, { SASL_CB_LIST_END, NULL, NULL }, #define SASL_BUFFER_SIZE 262144 }; #else /* CYRUS_SASL */ # define sasl_fgetc fgetc #endif /* CYRUS_SASL */ /* * static prototypes */ static int command(const char *, ...); static int multiline(void); #ifdef CYRUS_SASL static int pop_auth_sasl(char *, char *, char *); static int sasl_fgetc(FILE *); #endif /* CYRUS_SASL */ static int traverse (int (*)(char *), const char *, ...); static int vcommand(const char *, va_list); static int sasl_getline (char *, int, FILE *); static int putline (char *, FILE *); #ifdef CYRUS_SASL /* * This function implements the AUTH command for various SASL mechanisms * * We do the whole SASL dialog here. If this completes, then we've * authenticated successfully and have (possibly) negotiated a security * layer. */ int pop_auth_sasl(char *user, char *host, char *mech) { int result, status, sasl_capability = 0; unsigned int buflen, outlen; char server_mechs[256], *buf, outbuf[BUFSIZ]; const char *chosen_mech; sasl_security_properties_t secprops; struct pass_context p_context; sasl_ssf_t *ssf; int *moutbuf; /* * First off, we're going to send the CAPA command to see if we can * even support the AUTH command, and if we do, then we'll get a * list of mechanisms the server supports. If we don't support * the CAPA command, then it's unlikely that we will support * SASL */ if (command("CAPA") == NOTOK) { snprintf(response, sizeof(response), "The POP CAPA command failed; POP server does not " "support SASL"); return NOTOK; } while ((status = multiline()) != DONE) switch (status) { case NOTOK: return NOTOK; break; case DONE: /* Shouldn't be possible, but just in case */ break; case OK: if (strncasecmp(response, "SASL ", 5) == 0) { /* * We've seen the SASL capability. Grab the mech list */ sasl_capability++; strncpy(server_mechs, response + 5, sizeof(server_mechs)); } break; } if (!sasl_capability) { snprintf(response, sizeof(response), "POP server does not support " "SASL"); return NOTOK; } /* * If we received a preferred mechanism, see if the server supports it. */ if (mech && stringdex(mech, server_mechs) == -1) { snprintf(response, sizeof(response), "Requested SASL mech \"%s\" is " "not in list of supported mechanisms:\n%s", mech, server_mechs); return NOTOK; } /* * Start the SASL process. First off, initialize the SASL library. */ callbacks[POP_SASL_CB_N_USER].context = user; p_context.user = user; p_context.host = host; callbacks[POP_SASL_CB_N_PASS].context = &p_context; result = sasl_client_init(callbacks); if (result != SASL_OK) { snprintf(response, sizeof(response), "SASL library initialization " "failed: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } result = sasl_client_new("pop", host, NULL, NULL, NULL, 0, &conn); if (result != SASL_OK) { snprintf(response, sizeof(response), "SASL client initialization " "failed: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } /* * Initialize the security properties */ memset(&secprops, 0, sizeof(secprops)); secprops.maxbufsize = SASL_BUFFER_SIZE; secprops.max_ssf = UINT_MAX; result = sasl_setprop(conn, SASL_SEC_PROPS, &secprops); if (result != SASL_OK) { snprintf(response, sizeof(response), "SASL security property " "initialization failed: %s", sasl_errdetail(conn)); return NOTOK; } /* * Start the actual protocol. Feed the mech list into the library * and get out a possible initial challenge */ result = sasl_client_start(conn, (const char *) (mech ? mech : server_mechs), NULL, (const char **) &buf, &buflen, &chosen_mech); if (result != SASL_OK && result != SASL_CONTINUE) { snprintf(response, sizeof(response), "SASL client start failed: %s", sasl_errdetail(conn)); return NOTOK; } if (buflen) { status = sasl_encode64(buf, buflen, outbuf, sizeof(outbuf), NULL); if (status != SASL_OK) { snprintf(response, sizeof(response), "SASL base64 encode " "failed: %s", sasl_errstring(status, NULL, NULL)); return NOTOK; } status = command("AUTH %s %s", chosen_mech, outbuf); } else status = command("AUTH %s", chosen_mech); while (result == SASL_CONTINUE) { if (status == NOTOK) return NOTOK; /* * If we get a "+OK" prefix to our response, then we should * exit out of this exchange now (because authenticated should * have succeeded) */ if (strncmp(response, "+OK", 3) == 0) break; /* * Otherwise, make sure the server challenge is correctly formatted */ if (strncmp(response, "+ ", 2) != 0) { command("*"); snprintf(response, sizeof(response), "Malformed authentication message from server"); return NOTOK; } result = sasl_decode64(response + 2, strlen(response + 2), outbuf, sizeof(outbuf), &outlen); if (result != SASL_OK) { command("*"); snprintf(response, sizeof(response), "SASL base64 decode " "failed: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } result = sasl_client_step(conn, outbuf, outlen, NULL, (const char **) &buf, &buflen); if (result != SASL_OK && result != SASL_CONTINUE) { command("*"); snprintf(response, sizeof(response), "SASL client negotiaton " "failed: %s", sasl_errdetail(conn)); return NOTOK; } status = sasl_encode64(buf, buflen, outbuf, sizeof(outbuf), NULL); if (status != SASL_OK) { command("*"); snprintf(response, sizeof(response), "SASL base64 encode " "failed: %s", sasl_errstring(status, NULL, NULL)); return NOTOK; } status = command(outbuf); } /* * If we didn't get a positive final response, then error out * (that probably means we failed an authorization check). */ if (status != OK) return NOTOK; /* * We _should_ be okay now. Get a few properties now that negotiation * has completed. */ result = sasl_getprop(conn, SASL_MAXOUTBUF, (const void **) &moutbuf); if (result != SASL_OK) { snprintf(response, sizeof(response), "Cannot retrieve SASL negotiated " "output buffer size: %s", sasl_errdetail(conn)); return NOTOK; } maxoutbuf = *moutbuf; result = sasl_getprop(conn, SASL_SSF, (const void **) &ssf); sasl_ssf = *ssf; if (result != SASL_OK) { snprintf(response, sizeof(response), "Cannot retrieve SASL negotiated " "security strength factor: %s", sasl_errdetail(conn)); return NOTOK; } /* * Limit this to what we can deal with. Shouldn't matter much because * this is only outgoing data (which should be small) */ if (maxoutbuf == 0 || maxoutbuf > BUFSIZ) maxoutbuf = BUFSIZ; sasl_complete = 1; return status; } /* * Callback to return the userid sent down via the user parameter */ static int sasl_get_user(void *context, int id, const char **result, unsigned *len) { char *user = (char *) context; if (! result || id != SASL_CB_USER) return SASL_BADPARAM; *result = user; if (len) *len = strlen(user); return SASL_OK; } /* * Callback to return the password (we call ruserpass, which can get it * out of the .netrc */ static int sasl_get_pass(sasl_conn_t *conn, void *context, int id, sasl_secret_t **psecret) { struct pass_context *p_context = (struct pass_context *) context; char *pass = NULL; int len; NMH_UNUSED (conn); if (! psecret || id != SASL_CB_PASS) return SASL_BADPARAM; ruserpass(p_context->user, &(p_context->host), &pass); len = strlen(pass); *psecret = (sasl_secret_t *) mh_xmalloc(sizeof(sasl_secret_t) + len); (*psecret)->len = len; strcpy((char *) (*psecret)->data, pass); return SASL_OK; } #endif /* CYRUS_SASL */ /* * Split string containing proxy command into an array of arguments * suitable for passing to exec. Returned array must be freed. Shouldn't * be possible to call this with host set to NULL. */ char ** parse_proxy(char *proxy, char *host) { char **pargv, **p; int pargc = 2; int hlen = strlen(host); int plen = 1; unsigned char *cur, *pro; char *c; /* skip any initial space */ for (pro = (unsigned char *) proxy; isspace(*pro); pro++) continue; /* calculate required size for argument array */ for (cur = pro; *cur; cur++) { if (isspace(*cur) && cur[1] && !isspace(cur[1])) plen++, pargc++; else if (*cur == '%' && cur[1] == 'h') { plen += hlen; cur++; } else if (!isspace(*cur)) plen++; } /* put together list of arguments */ p = pargv = mh_xmalloc(pargc * sizeof(char *)); c = *pargv = mh_xmalloc(plen * sizeof(char)); for (cur = pro; *cur; cur++) { if (isspace(*cur) && cur[1] && !isspace(cur[1])) { *c++ = '\0'; *++p = c; } else if (*cur == '%' && cur[1] == 'h') { strcpy (c, host); c += hlen; cur++; } else if (!isspace(*cur)) *c++ = *cur; } *++p = NULL; return pargv; } int pop_init (char *host, char *port, char *user, char *pass, char *proxy, int snoop, int sasl, char *mech) { int fd1, fd2; char buffer[BUFSIZ]; #ifndef CYRUS_SASL NMH_UNUSED (sasl); NMH_UNUSED (mech); #endif /* ! CYRUS_SASL */ if (proxy && *proxy) { int pid; int inpipe[2]; /* for reading from the server */ int outpipe[2]; /* for sending to the server */ /* first give up any root priviledges we may have for rpop */ setuid(getuid()); pipe(inpipe); pipe(outpipe); pid=fork(); if (pid==0) { char **argv; /* in child */ close(0); close(1); dup2(outpipe[0],0); /* connect read end of connection */ dup2(inpipe[1], 1); /* connect write end of connection */ if(inpipe[0]>1) close(inpipe[0]); if(inpipe[1]>1) close(inpipe[1]); if(outpipe[0]>1) close(outpipe[0]); if(outpipe[1]>1) close(outpipe[1]); /* run the proxy command */ argv=parse_proxy(proxy, host); execvp(argv[0],argv); perror(argv[0]); close(0); close(1); free(*argv); free(argv); exit(10); } /* okay in the parent we do some stuff */ close(inpipe[1]); /* child uses this */ close(outpipe[0]); /* child uses this */ /* we read on fd1 */ fd1=inpipe[0]; /* and write on fd2 */ fd2=outpipe[1]; } else { if ((fd1 = client (host, port ? port : "pop3", response, sizeof(response), snoop)) == NOTOK) { return NOTOK; } if ((fd2 = dup (fd1)) == NOTOK) { char *s; if ((s = strerror(errno))) snprintf (response, sizeof(response), "unable to dup connection descriptor: %s", s); else snprintf (response, sizeof(response), "unable to dup connection descriptor: unknown error"); close (fd1); return NOTOK; } } if (pop_set (fd1, fd2, snoop) == NOTOK) return NOTOK; SIGNAL (SIGPIPE, SIG_IGN); switch (sasl_getline (response, sizeof response, input)) { case OK: if (poprint) fprintf (stderr, "<--- %s\n", response); if (*response == '+') { # ifdef CYRUS_SASL if (sasl) { if (pop_auth_sasl(user, host, mech) != NOTOK) return OK; } else # endif /* CYRUS_SASL */ if (command ("USER %s", user) != NOTOK && command ("%s %s", (pophack++, "PASS"), pass) != NOTOK) return OK; } strncpy (buffer, response, sizeof(buffer)); command ("QUIT"); strncpy (response, buffer, sizeof(response)); /* and fall */ case NOTOK: case DONE: if (poprint) fprintf (stderr, "%s\n", response); fclose (input); fclose (output); return NOTOK; } return NOTOK; /* NOTREACHED */ } int pop_set (int in, int out, int snoop) { if ((input = fdopen (in, "r")) == NULL || (output = fdopen (out, "w")) == NULL) { strncpy (response, "fdopen failed on connection descriptor", sizeof(response)); if (input) fclose (input); else close (in); close (out); return NOTOK; } poprint = snoop; return OK; } int pop_fd (char *in, int inlen, char *out, int outlen) { snprintf (in, inlen, "%d", fileno (input)); snprintf (out, outlen, "%d", fileno (output)); return OK; } /* * Find out number of messages available * and their total size. */ int pop_stat (int *nmsgs, int *nbytes) { if (command ("STAT") == NOTOK) return NOTOK; *nmsgs = *nbytes = 0; sscanf (response, "+OK %d %d", nmsgs, nbytes); return OK; } int pop_list (int msgno, int *nmsgs, int *msgs, int *bytes) { int i; int *ids = NULL; if (msgno) { if (command ("LIST %d", msgno) == NOTOK) return NOTOK; *msgs = *bytes = 0; if (ids) { *ids = 0; sscanf (response, "+OK %d %d %d", msgs, bytes, ids); } else sscanf (response, "+OK %d %d", msgs, bytes); return OK; } if (command ("LIST") == NOTOK) return NOTOK; for (i = 0; i < *nmsgs; i++) switch (multiline ()) { case NOTOK: return NOTOK; case DONE: *nmsgs = ++i; return OK; case OK: *msgs = *bytes = 0; if (ids) { *ids = 0; sscanf (response, "%d %d %d", msgs++, bytes++, ids++); } else sscanf (response, "%d %d", msgs++, bytes++); break; } for (;;) switch (multiline ()) { case NOTOK: return NOTOK; case DONE: return OK; case OK: break; } } int pop_retr (int msgno, int (*action)(char *)) { return traverse (action, "RETR %d", msgno); } static int traverse (int (*action)(char *), const char *fmt, ...) { int result; va_list ap; char buffer[sizeof(response)]; va_start(ap, fmt); result = vcommand (fmt, ap); va_end(ap); if (result == NOTOK) return NOTOK; strncpy (buffer, response, sizeof(buffer)); for (;;) switch (multiline ()) { case NOTOK: return NOTOK; case DONE: strncpy (response, buffer, sizeof(response)); return OK; case OK: (*action) (response); break; } } int pop_dele (int msgno) { return command ("DELE %d", msgno); } int pop_noop (void) { return command ("NOOP"); } int pop_rset (void) { return command ("RSET"); } int pop_top (int msgno, int lines, int (*action)(char *)) { return traverse (action, "TOP %d %d", msgno, lines); } int pop_quit (void) { int i; i = command ("QUIT"); pop_done (); return i; } int pop_done (void) { #ifdef CYRUS_SASL if (conn) sasl_dispose(&conn); #endif /* CYRUS_SASL */ fclose (input); fclose (output); return OK; } int command(const char *fmt, ...) { va_list ap; int result; va_start(ap, fmt); result = vcommand(fmt, ap); va_end(ap); return result; } static int vcommand (const char *fmt, va_list ap) { char *cp, buffer[BUFSIZ]; vsnprintf (buffer, sizeof(buffer), fmt, ap); if (poprint) { #ifdef CYRUS_SASL if (sasl_ssf) fprintf(stderr, "(encrypted) "); #endif /* CYRUS_SASL */ if (pophack) { if ((cp = strchr (buffer, ' '))) *cp = 0; fprintf (stderr, "---> %s ********\n", buffer); if (cp) *cp = ' '; pophack = 0; } else fprintf (stderr, "---> %s\n", buffer); } if (putline (buffer, output) == NOTOK) return NOTOK; #ifdef CYRUS_SASL if (poprint && sasl_ssf) fprintf(stderr, "(decrypted) "); #endif /* CYRUS_SASL */ switch (sasl_getline (response, sizeof response, input)) { case OK: if (poprint) fprintf (stderr, "<--- %s\n", response); return (*response == '+' ? OK : NOTOK); case NOTOK: case DONE: if (poprint) fprintf (stderr, "%s\n", response); return NOTOK; } return NOTOK; /* NOTREACHED */ } int multiline (void) { char buffer[BUFSIZ + TRMLEN]; if (sasl_getline (buffer, sizeof buffer, input) != OK) return NOTOK; #ifdef DEBUG if (poprint) { #ifdef CYRUS_SASL if (sasl_ssf) fprintf(stderr, "(decrypted) "); #endif /* CYRUS_SASL */ fprintf (stderr, "<--- %s\n", response); } #endif /* DEBUG */ if (strncmp (buffer, TRM, TRMLEN) == 0) { if (buffer[TRMLEN] == 0) return DONE; else strncpy (response, buffer + TRMLEN, sizeof(response)); } else strncpy (response, buffer, sizeof(response)); return OK; } /* * Note that these functions have been modified to deal with layer encryption * in the SASL case */ static int sasl_getline (char *s, int n, FILE *iop) { int c = -2; char *p; p = s; while (--n > 0 && (c = sasl_fgetc (iop)) != EOF && c != -2) if ((*p++ = c) == '\n') break; if (c == -2) return NOTOK; if (ferror (iop) && c != EOF) { strncpy (response, "error on connection", sizeof(response)); return NOTOK; } if (c == EOF && p == s) { strncpy (response, "connection closed by foreign host", sizeof(response)); return DONE; } *p = 0; if (*--p == '\n') *p = 0; if (*--p == '\r') *p = 0; return OK; } static int putline (char *s, FILE *iop) { #ifdef CYRUS_SASL char outbuf[BUFSIZ], *buf; int result; unsigned int buflen; if (!sasl_complete) { #endif /* CYRUS_SASL */ fprintf (iop, "%s\r\n", s); #ifdef CYRUS_SASL } else { /* * Build an output buffer, encrypt it using sasl_encode, and * squirt out the results. */ strncpy(outbuf, s, sizeof(outbuf) - 3); outbuf[sizeof(outbuf) - 3] = '\0'; /* Just in case */ strcat(outbuf, "\r\n"); result = sasl_encode(conn, outbuf, strlen(outbuf), (const char **) &buf, &buflen); if (result != SASL_OK) { snprintf(response, sizeof(response), "SASL encoding error: %s", sasl_errdetail(conn)); return NOTOK; } fwrite(buf, buflen, 1, iop); } #endif /* CYRUS_SASL */ fflush (iop); if (ferror (iop)) { strncpy (response, "lost connection", sizeof(response)); return NOTOK; } return OK; } #ifdef CYRUS_SASL /* * Okay, our little fgetc replacement. Hopefully this is a little more * efficient than the last one. */ static int sasl_fgetc(FILE *f) { static unsigned char *buffer = NULL, *ptr; static unsigned int size = 0; static int cnt = 0; unsigned int retbufsize = 0; int cc, result; char *retbuf, tmpbuf[SASL_BUFFER_SIZE]; /* * If we have some leftover data, return that */ if (cnt) { cnt--; return (int) *ptr++; } /* * Otherwise, fill our buffer until we have some data to return. */ while (retbufsize == 0) { cc = read(fileno(f), tmpbuf, sizeof(tmpbuf)); if (cc == 0) return EOF; if (cc < 0) { snprintf(response, sizeof(response), "Error during read from " "network: %s", strerror(errno)); return -2; } /* * We're not allowed to call sasl_decode until sasl_complete is * true, so we do these gyrations ... */ if (!sasl_complete) { retbuf = tmpbuf; retbufsize = cc; } else { result = sasl_decode(conn, tmpbuf, cc, (const char **) &retbuf, &retbufsize); if (result != SASL_OK) { snprintf(response, sizeof(response), "Error during SASL " "decoding: %s", sasl_errdetail(conn)); return -2; } } } if (retbufsize > size) { buffer = mh_xrealloc(buffer, retbufsize); size = retbufsize; } memcpy(buffer, retbuf, retbufsize); ptr = buffer + 1; cnt = retbufsize - 1; return (int) buffer[0]; } #endif /* CYRUS_SASL */ nmh-1.5/uip/post.c000644 007761 000765 00000124356 11765267273 014053 0ustar00kenhkenh000000 000000 /* * post.c -- enter messages into the mail transport system * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_TIME_H # include #endif #include #include #ifndef CYRUS_SASL # define SASLminc(a) (a) #else /* CYRUS_SASL */ # define SASLminc(a) 0 #endif /* CYRUS_SASL */ #ifndef TLS_SUPPORT # define TLSminc(a) (a) #else /* TLS_SUPPORT */ # define TLSminc(a) 0 #endif /* TLS_SUPPORT */ #define FCCS 10 /* max number of fccs allowed */ /* In the following array of structures, the numeric second field of the structures (minchars) is apparently used like this: -# : Switch can be abbreviated to # characters; switch hidden in -help. 0 : Switch can't be abbreviated; switch shown in -help. # : Switch can be abbreviated to # characters; switch shown in -help. */ static struct swit switches[] = { #define ALIASW 0 { "alias aliasfile", 0 }, #define CHKSW 1 { "check", -5 }, /* interface from whom */ #define NCHKSW 2 { "nocheck", -7 }, /* interface from whom */ #define DEBUGSW 3 { "debug", -5 }, #define DISTSW 4 { "dist", -4 }, /* interface from dist */ #define FILTSW 5 { "filter filterfile", 0 }, #define NFILTSW 6 { "nofilter", 0 }, #define FRMTSW 7 { "format", 0 }, #define NFRMTSW 8 { "noformat", 0 }, #define LIBSW 9 { "library directory", -7 }, /* interface from send, whom */ #define MIMESW 10 { "mime", 0 }, #define NMIMESW 11 { "nomime", 0 }, #define MSGDSW 12 { "msgid", 0 }, #define NMSGDSW 13 { "nomsgid", 0 }, #define VERBSW 14 { "verbose", 0 }, #define NVERBSW 15 { "noverbose", 0 }, #define WATCSW 16 { "watch", 0 }, #define NWATCSW 17 { "nowatch", 0 }, #define WHOMSW 18 { "whom", -4 }, /* interface from whom */ #define WIDTHSW 19 { "width columns", 0 }, #define VERSIONSW 20 { "version", 0 }, #define HELPSW 21 { "help", 0 }, #define BITSTUFFSW 22 { "dashstuffing", -12 }, /* should we dashstuff BCC messages? */ #define NBITSTUFFSW 23 { "nodashstuffing", -14 }, #define ANNOSW 24 { "idanno number", -6 }, /* interface from send */ #define CLIESW 25 { "client host", -6 }, #define SERVSW 26 { "server host", 6 }, /* specify alternate SMTP server */ #define SNOOPSW 27 { "snoop", -5 }, /* snoop the SMTP transaction */ #define PARTSW 28 { "partno", -6 }, #define QUEUESW 29 { "queued", -6 }, #define SASLSW 30 { "sasl", SASLminc(-4) }, #define NOSASLSW 31 { "nosasl", SASLminc(-6) }, #define SASLMXSSFSW 32 { "saslmaxssf", SASLminc(-10) }, #define SASLMECHSW 33 { "saslmech", SASLminc(-5) }, #define USERSW 34 { "user", SASLminc(-4) }, #define PORTSW 35 { "port server port name/number", 4 }, #define TLSSW 36 { "tls", TLSminc(-3) }, #define NTLSSW 37 { "notls", TLSminc(-5) }, #define FILEPROCSW 38 { "fileproc", -4 }, #define MHLPROCSW 39 { "mhlproc", -3 }, { NULL, 0 } }; struct headers { char *value; unsigned int flags; unsigned int set; }; /* * flags for headers->flags */ #define HNOP 0x0000 /* just used to keep .set around */ #define HBAD 0x0001 /* bad header - don't let it through */ #define HADR 0x0002 /* header has an address field */ #define HSUB 0x0004 /* Subject: header */ #define HTRY 0x0008 /* try to send to addrs on header */ #define HBCC 0x0010 /* don't output this header */ #define HMNG 0x0020 /* munge this header */ #define HNGR 0x0040 /* no groups allowed in this header */ #define HFCC 0x0080 /* FCC: type header */ #define HNIL 0x0100 /* okay for this header not to have addrs */ #define HIGN 0x0200 /* ignore this header */ #define HDCC 0x0400 /* another undocumented feature */ #define HONE 0x0800 /* Only (zero or) one address allowed */ #define HEFM 0x1000 /* Envelope-From: header */ /* * flags for headers->set */ #define MFRM 0x0001 /* we've seen a From: */ #define MDAT 0x0002 /* we've seen a Date: */ #define MRFM 0x0004 /* we've seen a Resent-From: */ #define MVIS 0x0008 /* we've seen sighted addrs */ #define MINV 0x0010 /* we've seen blind addrs */ #define MSND 0x0020 /* we've seen a Sender: */ #define MRSN 0x0040 /* We've seen a Resent-Sendr:*/ #define MEFM 0x0080 /* We've seen Envelope-From: */ static struct headers NHeaders[] = { { "Return-Path", HBAD, 0 }, { "Received", HBAD, 0 }, { "Reply-To", HADR|HNGR, 0 }, { "From", HADR|HNGR, MFRM }, { "Sender", HADR|HNGR|HONE, MSND }, { "Date", HBAD, 0 }, { "Subject", HSUB, 0 }, { "To", HADR|HTRY, MVIS }, { "cc", HADR|HTRY, MVIS }, { "Bcc", HADR|HTRY|HBCC|HNIL, MINV }, { "Dcc", HADR|HTRY|HDCC|HNIL, MVIS }, /* sorta cc & bcc combined */ { "Message-ID", HBAD, 0 }, { "Fcc", HFCC, 0 }, { "Envelope-From", HADR|HONE|HEFM, MEFM }, { NULL, 0, 0 } }; static struct headers RHeaders[] = { { "Resent-Reply-To", HADR|HNGR, 0 }, { "Resent-From", HADR|HNGR, MRFM }, { "Resent-Sender", HADR|HNGR, MRSN }, { "Resent-Date", HBAD, 0 }, { "Resent-Subject", HSUB, 0 }, { "Resent-To", HADR|HTRY, MVIS }, { "Resent-cc", HADR|HTRY, MVIS }, { "Resent-Bcc", HADR|HTRY|HBCC, MINV }, { "Resent-Message-ID", HBAD, 0 }, { "Resent-Fcc", HFCC, 0 }, { "Reply-To", HADR, 0 }, { "From", HADR|HNGR, MFRM }, { "Sender", HADR|HNGR, MSND }, { "Date", HNOP, MDAT }, { "To", HADR|HNIL, 0 }, { "cc", HADR|HNIL, 0 }, { "Bcc", HADR|HTRY|HBCC|HNIL, 0 }, { "Fcc", HIGN, 0 }, { "Envelope-From", HADR|HONE|HEFM, MEFM }, { NULL, 0, 0 } }; static short fccind = 0; /* index into fccfold[] */ static short outputlinelen = OUTPUTLINELEN; static int pfd = NOTOK; /* fd to write annotation list to */ static uid_t myuid= -1; /* my user id */ static gid_t mygid= -1; /* my group id */ static int recipients = 0; /* how many people will get a copy */ static int unkadr = 0; /* how many of those were unknown */ static int badadr = 0; /* number of bad addrs */ static int badmsg = 0; /* message has bad semantics */ static int verbose = 0; /* spell it out */ static int format = 1; /* format addresses */ static int mime = 0; /* use MIME-style encapsulations for Bcc */ static int msgid = 0; /* add msgid */ static int debug = 0; /* debugging post */ static int watch = 0; /* watch the delivery process */ static int whomsw = 0; /* we are whom not post */ static int checksw = 0; /* whom -check */ static int linepos=0; /* putadr()'s position on the line */ static int nameoutput=0; /* putadr() has output header name */ static int sasl=0; /* Use SASL auth for SMTP */ static int saslssf=-1; /* Our maximum SSF for SASL */ static char *saslmech=NULL; /* Force use of particular SASL mech */ static char *user=NULL; /* Authenticate as this user */ static char *port="smtp"; /* Name of server port for SMTP */ static int tls=0; /* Use TLS for encryption */ static int fromcount=0; /* Count of addresses on From: header */ static int seensender=0; /* Have we seen a Sender: header? */ static unsigned msgflags = 0; /* what we've seen */ #define NORMAL 0 #define RESENT 1 static int msgstate = NORMAL; static time_t tclock = 0; /* the time we started (more or less) */ static SIGNAL_HANDLER hstat, istat, qstat, tstat; static char tmpfil[BUFSIZ]; static char bccfil[BUFSIZ]; static char from[BUFSIZ]; /* my network address */ static char sender[BUFSIZ]; /* my Sender: header */ static char efrom[BUFSIZ]; /* my Envelope-From: header */ static char signature[BUFSIZ]; /* my signature */ static char *filter = NULL; /* the filter for BCC'ing */ static char *subject = NULL; /* the subject field for BCC'ing */ static char *fccfold[FCCS]; /* foldernames for FCC'ing */ static struct headers *hdrtab; /* table for the message we're doing */ static struct mailname localaddrs; /* local addrs */ static struct mailname netaddrs; /* network addrs */ static struct mailname uuaddrs; /* uucp addrs */ static struct mailname tmpaddrs; /* temporary queue */ static int snoop = 0; static char *clientsw = NULL; static char *serversw = NULL; extern struct smtp sm_reply; static char prefix[] = "----- =_aaaaaaaaaa"; static char *partno = NULL; static int queued = 0; /* * static prototypes */ static void putfmt (char *, char *, FILE *); static void start_headers (void); static void finish_headers (FILE *); static int get_header (char *, struct headers *); static int putadr (char *, char *, struct mailname *, FILE *, unsigned int); static void putgrp (char *, char *, FILE *, unsigned int); static int insert (struct mailname *); static void pl (void); static void anno (void); static int annoaux (struct mailname *); static void insert_fcc (struct headers *, unsigned char *); static void make_bcc_file (int); static void verify_all_addresses (int, char *); static void chkadr (void); static void sigon (void); static void sigoff (void); static void p_refile (char *); static void fcc (char *, char *); static void die (char *, char *, ...); static void post (char *, int, int, char *); static void do_text (char *file, int fd); static void do_an_address (struct mailname *, int); static void do_addresses (int, int); static int find_prefix (void); int main (int argc, char **argv) { int state, compnum, dashstuff = 0; char *cp, *msg = NULL, **argp, **arguments, *envelope; char buf[BUFSIZ], name[NAMESZ]; FILE *in, *out; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* foil search of user profile/context */ if (context_foil (NULL) == -1) done (1); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 0); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); print_help (buf, switches, 0); done (1); case VERSIONSW: print_version(invo_name); done (1); case LIBSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); /* create a minimal context */ if (context_foil (cp) == -1) done (1); continue; case ALIASW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((state = alias (cp)) != AK_OK) adios (NULL, "aliasing error in %s - %s", cp, akerror (state)); continue; case CHKSW: checksw++; continue; case NCHKSW: checksw = 0; continue; case DEBUGSW: debug++; continue; case DISTSW: msgstate = RESENT; continue; case FILTSW: if (!(filter = *argp++) || *filter == '-') adios (NULL, "missing argument to %s", argp[-2]); mime = 0; continue; case NFILTSW: filter = NULL; continue; case FRMTSW: format++; continue; case NFRMTSW: format = 0; continue; case BITSTUFFSW: dashstuff = 1; continue; case NBITSTUFFSW: dashstuff = -1; continue; case MIMESW: mime++; filter = NULL; continue; case NMIMESW: mime = 0; continue; case MSGDSW: msgid++; continue; case NMSGDSW: msgid = 0; continue; case VERBSW: verbose++; continue; case NVERBSW: verbose = 0; continue; case WATCSW: watch++; continue; case NWATCSW: watch = 0; continue; case WHOMSW: whomsw++; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((outputlinelen = atoi (cp)) < 10) adios (NULL, "impossible width %d", outputlinelen); continue; case ANNOSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((pfd = atoi (cp)) <= 2) adios (NULL, "bad argument %s %s", argp[-2], cp); continue; case CLIESW: if (!(clientsw = *argp++) || *clientsw == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case SERVSW: if (!(serversw = *argp++) || *serversw == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case SNOOPSW: snoop++; continue; case PARTSW: if (!(partno = *argp++) || *partno == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case QUEUESW: queued++; continue; case SASLSW: sasl++; continue; case NOSASLSW: sasl = 0; continue; case SASLMXSSFSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); saslssf = atoi(cp); continue; case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case USERSW: if (!(user = *argp++) || *user == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case PORTSW: if (!(port = *argp++) || *port == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case TLSSW: tls++; continue; case NTLSSW: tls = 0; continue; case FILEPROCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); fileproc = cp; continue; case MHLPROCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); mhlproc = cp; continue; } } if (msg) adios (NULL, "only one message at a time!"); else msg = cp; } alias (AliasFile); if (!msg) adios (NULL, "usage: %s [switches] file", invo_name); if (outputlinelen < 10) adios (NULL, "impossible width %d", outputlinelen); if ((in = fopen (msg, "r")) == NULL) adios (msg, "unable to open"); start_headers (); if (debug) { verbose++; discard (out = stdout); /* XXX: reference discard() to help loader */ } else { if (whomsw) { if ((out = fopen ("/dev/null", "w")) == NULL) adios ("/dev/null", "unable to open"); } else { char *cp = m_mktemp(m_maildir(invo_name), NULL, &out); if (cp == NULL) { cp = m_mktemp2(NULL, invo_name, NULL, &out); if (cp == NULL) { adios ("post", "unable to create temporary file"); } } strncpy(tmpfil, cp, sizeof(tmpfil)); chmod (tmpfil, 0600); } } hdrtab = msgstate == NORMAL ? NHeaders : RHeaders; for (compnum = 1, state = FLD;;) { switch (state = m_getfld (state, name, buf, sizeof(buf), in)) { case FLD: case FLDEOF: case FLDPLUS: compnum++; cp = add (buf, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), in); cp = add (buf, cp); } putfmt (name, cp, out); free (cp); if (state != FLDEOF) continue; finish_headers (out); break; case BODY: case BODYEOF: finish_headers (out); if (whomsw) break; fprintf (out, "\n%s", buf); while (state == BODY) { state = m_getfld (state, name, buf, sizeof(buf), in); fputs (buf, out); } break; case FILEEOF: finish_headers (out); break; case LENERR: case FMTERR: adios (NULL, "message format error in component #%d", compnum); default: adios (NULL, "getfld() returned %d", state); } break; } if (pfd != NOTOK) anno (); fclose (in); if (debug) { pl (); done (0); } else { fclose (out); } /* * Here's how we decide which address to use as the envelope-from * address for SMTP. * * - If we were given an Envelope-From header, use that. * - If we were given a Sender: address, use that. * - Otherwise, use the address on the From: line */ if (msgflags & MEFM) { envelope = efrom; } else if (seensender) { envelope = sender; } else { envelope = from; } /* If we are doing a "whom" check */ if (whomsw) { verify_all_addresses (1, envelope); done (0); } if (msgflags & MINV) { make_bcc_file (dashstuff); if (msgflags & MVIS) { verify_all_addresses (verbose, envelope); post (tmpfil, 0, verbose, envelope); } post (bccfil, 1, verbose, envelope); unlink (bccfil); } else { post (tmpfil, 0, isatty (1), envelope); } p_refile (tmpfil); unlink (tmpfil); if (verbose) printf (partno ? "Partial Message #%s Processed\n" : "Message Processed\n", partno); done (0); return 1; } /* * DRAFT GENERATION */ static void putfmt (char *name, char *str, FILE *out) { int count, grp, i, keep; char *cp, *pp, *qp; char namep[BUFSIZ]; struct mailname *mp = NULL, *np = NULL; struct headers *hdr; while (*str == ' ' || *str == '\t') str++; if (msgstate == NORMAL && uprf (name, "resent")) { advise (NULL, "illegal header line -- %s:", name); badmsg++; return; } if ((i = get_header (name, hdrtab)) == NOTOK) { fprintf (out, "%s: %s", name, str); return; } hdr = &hdrtab[i]; if (hdr->flags & HIGN) { return; } if (hdr->flags & HBAD) { advise (NULL, "illegal header line -- %s:", name); badmsg++; return; } msgflags |= (hdr->set & ~(MVIS | MINV)); if (hdr->flags & HSUB) subject = subject ? add (str, add ("\t", subject)) : getcpy (str); if (hdr->flags & HFCC) { if ((cp = strrchr(str, '\n'))) *cp = 0; for (cp = pp = str; (cp = strchr(pp, ',')); pp = cp) { *cp++ = 0; insert_fcc (hdr, pp); } insert_fcc (hdr, pp); return; } if (!(hdr->flags & HADR)) { fprintf (out, "%s: %s", name, str); return; } tmpaddrs.m_next = NULL; for (count = 0; (cp = getname (str)); count++) if ((mp = getm (cp, NULL, 0, AD_HOST, NULL))) { if (tmpaddrs.m_next) np->m_next = mp; else tmpaddrs.m_next = mp; np = mp; } else if (hdr->flags & HTRY) badadr++; else badmsg++; if (count < 1) { if (hdr->flags & HNIL) fprintf (out, "%s: %s", name, str); else { /* * Sender (or Resent-Sender) can have only one address */ if ((msgstate == RESENT) ? (hdr->set & MRSN) : (hdr->set & MSND)) { advise (NULL, "%s: field requires one address", name); badmsg++; } #ifdef notdef advise (NULL, "%s: field requires at least one address", name); badmsg++; #endif /* notdef */ } return; } if (count > 1 && (hdr->flags & HONE)) { advise (NULL, "%s: field only permits one address", name); badmsg++; return; } nameoutput = linepos = 0; snprintf (namep, sizeof(namep), "%s%s", (hdr->flags & HMNG) ? "Original-" : "", name); for (grp = 0, mp = tmpaddrs.m_next; mp; mp = np) if (mp->m_nohost) { /* also used to test (hdr->flags & HTRY) */ /* The address doesn't include a host, so it might be an alias. */ pp = akvalue (mp->m_mbox); /* do mh alias substitution */ qp = akvisible () ? mp->m_mbox : ""; np = mp; if (np->m_gname) putgrp (namep, np->m_gname, out, hdr->flags); while ((cp = getname (pp))) { if (!(mp = getm (cp, NULL, 0, AD_HOST, NULL))) { badadr++; continue; } /* * If it's a From: or Resent-From: header, save the address * for later possible use (as the envelope address for SMTP) */ if ((msgstate == RESENT) ? (hdr->set & MRFM) : (hdr->set & MFRM)) { strncpy(from, auxformat(mp, 0), sizeof(from) - 1); from[sizeof(from) - 1] = '\0'; fromcount = count; } /* * Also save the Sender: or Resent-Sender: header as well */ if ((msgstate == RESENT) ? (hdr->set & MRSN) : (hdr->set & MSND)) { strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1); sender[sizeof(sender) - 1] = '\0'; seensender++; } /* * ALSO ... save Envelope-From */ if (hdr->set & MEFM) { strncpy(efrom, auxformat(mp, 0), sizeof(efrom) - 1); efrom[sizeof(efrom) - 1] = '\0'; } if (hdr->flags & HBCC) mp->m_bcc++; if (np->m_ingrp) mp->m_ingrp = np->m_ingrp; else if (mp->m_gname) putgrp (namep, mp->m_gname, out, hdr->flags); if (mp->m_ingrp) grp++; if (putadr (namep, qp, mp, out, hdr->flags)) msgflags |= (hdr->set & (MVIS | MINV)); else mnfree (mp); } mp = np; np = np->m_next; mnfree (mp); } else { /* Address includes a host, so no alias substitution is needed. */ /* * If it's a From: or Resent-From header, save the address * for later possible use (as the envelope address for SMTP) */ if ((msgstate == RESENT) ? (hdr->set & MRFM) : (hdr->set & MFRM)) { strncpy(from, auxformat(mp, 0), sizeof(from) - 1); fromcount = count; } /* * Also save the Sender: header as well */ if ((msgstate == RESENT) ? (hdr->set & MRSN) : (hdr->set & MSND)) { strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1); sender[sizeof(sender) - 1] = '\0'; seensender++; } /* * ALSO ... save Envelope-From */ if (hdr->set & MEFM) { strncpy(efrom, auxformat(mp, 0), sizeof(efrom) - 1); efrom[sizeof(efrom) - 1] = '\0'; } if (hdr->flags & HBCC) mp->m_bcc++; if (mp->m_gname) putgrp (namep, mp->m_gname, out, hdr->flags); if (mp->m_ingrp) grp++; keep = putadr (namep, "", mp, out, hdr->flags); np = mp->m_next; if (keep) { mp->m_next = NULL; msgflags |= (hdr->set & (MVIS | MINV)); } else mnfree (mp); } if (grp > 0 && (hdr->flags & HNGR)) { advise (NULL, "%s: field does not allow groups", name); badmsg++; } if (linepos) { putc ('\n', out); } } static void start_headers (void) { unsigned char *cp; char sigbuf[BUFSIZ]; struct mailname *mp; myuid = getuid (); mygid = getgid (); time (&tclock); /* * Probably not necessary, but just in case ... */ from[0] = '\0'; efrom[0] = '\0'; sender[0] = '\0'; if ((cp = getfullname ()) && *cp) { strncpy (sigbuf, cp, sizeof(sigbuf)); snprintf (signature, sizeof(signature), "%s <%s>", sigbuf, getlocaladdr()); if ((cp = getname (signature)) == NULL) adios (NULL, "getname () failed -- you lose extraordinarily big"); if ((mp = getm (cp, NULL, 0, AD_HOST, NULL)) == NULL) adios (NULL, "bad signature '%s'", sigbuf); mnfree (mp); while (getname ("")) continue; } else { strncpy (signature, getlocaladdr(), sizeof(signature)); } } /* * Now that we've outputted the header fields in the draft * message, we will now output any remaining header fields * that we need to add/create. */ static void finish_headers (FILE *out) { switch (msgstate) { case NORMAL: if (!(msgflags & MFRM)) { /* * A From: header is now required in the draft. */ advise (NULL, "message has no From: header"); advise (NULL, "See default components files for examples"); badmsg++; break; } if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) { advise (NULL, "A Sender: or Envelope-From: header is required " "with multiple\nFrom: addresses"); badmsg++; break; } if (whomsw) break; fprintf (out, "Date: %s\n", dtime (&tclock, 0)); if (msgid) fprintf (out, "Message-ID: <%d.%ld@%s>\n", (int) getpid (), (long) tclock, LocalName (1)); /* * If we have multiple From: addresses, make sure we have an * Sender: header. If we don't have one, then generate one * from Envelope-From: (which in this case, cannot be blank) */ if (fromcount > 1 && seensender == 0) { if (efrom[0] == '\0') { advise (NULL, "Envelope-From cannot be blank when there " "is multiple From: addresses\nand no Sender: " "header"); badmsg++; } else { fprintf (out, "Sender: %s\n", efrom); } } if (!(msgflags & MVIS)) fprintf (out, "Bcc: Blind Distribution List: ;\n"); break; case RESENT: if (!(msgflags & MDAT)) { advise (NULL, "message has no Date: header"); badmsg++; } if (!(msgflags & MFRM)) { advise (NULL, "message has no From: header"); badmsg++; } if (!(msgflags & MRFM)) { advise (NULL, "message has no Resent-From: header"); advise (NULL, "See default components files for examples"); badmsg++; break; } if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) { advise (NULL, "A Resent-Sender: or Envelope-From: header is " "required with multiple\nResent-From: addresses"); badmsg++; break; } if (whomsw) break; fprintf (out, "Resent-Date: %s\n", dtime (&tclock, 0)); if (msgid) fprintf (out, "Resent-Message-ID: <%d.%ld@%s>\n", (int) getpid (), (long) tclock, LocalName (1)); /* * If we have multiple Resent-From: addresses, make sure we have an * Resent-Sender: header. If we don't have one, then generate one * from Envelope-From (which in this case, cannot be blank) */ if (fromcount > 1 && seensender == 0) { if (efrom[0] == '\0') { advise (NULL, "Envelope-From cannot be blank when there " "is multiple Resent-From: addresses and no " "Resent-Sender: header"); badmsg++; } else { fprintf (out, "Resent-Sender: %s\n", efrom); } } if (!(msgflags & MVIS)) fprintf (out, "Resent-Bcc: Blind Re-Distribution List: ;\n"); break; } if (badmsg) adios (NULL, "re-format message and try again"); if (!recipients) adios (NULL, "no addressees"); } static int get_header (char *header, struct headers *table) { struct headers *h; for (h = table; h->value; h++) if (!mh_strcasecmp (header, h->value)) return (h - table); return NOTOK; } static int putadr (char *name, char *aka, struct mailname *mp, FILE *out, unsigned int flags) { int len; char *cp; char buffer[BUFSIZ]; if (mp->m_mbox == NULL || ((flags & HTRY) && !insert (mp))) return 0; if ((flags & (HBCC | HDCC | HEFM)) || mp->m_ingrp) return 1; if (!nameoutput) { fprintf (out, "%s: ", name); linepos += (nameoutput = strlen (name) + 2); } if (*aka && mp->m_type != UUCPHOST && !mp->m_pers) mp->m_pers = getcpy (aka); if (format) { if (mp->m_gname) { snprintf (buffer, sizeof(buffer), "%s;", mp->m_gname); cp = buffer; } else { cp = adrformat (mp); } } else { cp = mp->m_text; } len = strlen (cp); if (linepos != nameoutput) { if (len + linepos + 2 > outputlinelen) fprintf (out, ",\n%*s", linepos = nameoutput, ""); else { fputs (", ", out); linepos += 2; } } fputs (cp, out); linepos += len; return (flags & HTRY); } static void putgrp (char *name, char *group, FILE *out, unsigned int flags) { int len; char *cp; if (flags & HBCC) return; if (!nameoutput) { fprintf (out, "%s: ", name); linepos += (nameoutput = strlen (name) + 2); } cp = concat (group, ";", NULL); len = strlen (cp); if (linepos > nameoutput) { if (len + linepos + 2 > outputlinelen) { fprintf (out, ",\n%*s", nameoutput, ""); linepos = nameoutput; } else { fputs (", ", out); linepos += 2; } } fputs (cp, out); linepos += len; } static int insert (struct mailname *np) { struct mailname *mp; if (np->m_mbox == NULL) return 0; for (mp = np->m_type == LOCALHOST ? &localaddrs : np->m_type == UUCPHOST ? &uuaddrs : &netaddrs; mp->m_next; mp = mp->m_next) if (!mh_strcasecmp (np->m_host, mp->m_next->m_host) && !mh_strcasecmp (np->m_mbox, mp->m_next->m_mbox) && np->m_bcc == mp->m_next->m_bcc) return 0; mp->m_next = np; recipients++; return 1; } static void pl (void) { int i; struct mailname *mp; printf ("-------\n\t-- Addresses --\nlocal:\t"); for (mp = localaddrs.m_next; mp; mp = mp->m_next) printf ("%s%s%s", mp->m_mbox, mp->m_bcc ? "[BCC]" : "", mp->m_next ? ",\n\t" : ""); printf ("\nnet:\t"); for (mp = netaddrs.m_next; mp; mp = mp->m_next) printf ("%s%s@%s%s%s", mp->m_path ? mp->m_path : "", mp->m_mbox, mp->m_host, mp->m_bcc ? "[BCC]" : "", mp->m_next ? ",\n\t" : ""); printf ("\nuucp:\t"); for (mp = uuaddrs.m_next; mp; mp = mp->m_next) printf ("%s!%s%s%s", mp->m_host, mp->m_mbox, mp->m_bcc ? "[BCC]" : "", mp->m_next ? ",\n\t" : ""); printf ("\n\t-- Folder Copies --\nfcc:\t"); for (i = 0; i < fccind; i++) printf ("%s%s", fccfold[i], i + 1 < fccind ? ",\n\t" : ""); printf ("\n"); } static void anno (void) { struct mailname *mp; for (mp = localaddrs.m_next; mp; mp = mp->m_next) if (annoaux (mp) == NOTOK) goto oops; for (mp = netaddrs.m_next; mp; mp = mp->m_next) if (annoaux (mp) == NOTOK) goto oops; for (mp = uuaddrs.m_next; mp; mp = mp->m_next) if (annoaux (mp) == NOTOK) break; oops: ; close (pfd); pfd = NOTOK; } static int annoaux (struct mailname *mp) { int i; char buffer[BUFSIZ]; snprintf (buffer, sizeof(buffer), "%s\n", adrformat (mp)); i = strlen (buffer); return (write (pfd, buffer, i) == i ? OK : NOTOK); } static void insert_fcc (struct headers *hdr, unsigned char *pp) { unsigned char *cp; for (cp = pp; isspace (*cp); cp++) continue; for (pp += strlen (pp) - 1; pp > cp && isspace (*pp); pp--) continue; if (pp >= cp) *++pp = 0; if (*cp == 0) return; if (fccind >= FCCS) adios (NULL, "too many %ss", hdr->value); fccfold[fccind++] = getcpy (cp); } /* * BCC GENERATION */ static void make_bcc_file (int dashstuff) { int fd, i; pid_t child_id; char *vec[6]; FILE *out; char *tfile = NULL; tfile = m_mktemp2(NULL, "bccs", NULL, &out); if (tfile == NULL) adios("bcc", "unable to create temporary file"); chmod (bccfil, 0600); strncpy (bccfil, tfile, sizeof(bccfil)); fprintf (out, "Date: %s\n", dtime (&tclock, 0)); if (msgid) fprintf (out, "Message-ID: <%d.%ld@%s>\n", (int) getpid (), (long) tclock, LocalName (1)); if (subject) fprintf (out, "Subject: %s", subject); fprintf (out, "BCC:\n"); /* * Use MIME encapsulation for Bcc messages */ if (mime) { char *cp; /* * Check if any lines in the message clash with the * prefix for the MIME multipart separator. If there * is a clash, increment one of the letters in the * prefix and check again. */ if ((cp = strchr(prefix, 'a')) == NULL) adios (NULL, "lost prefix start"); while (find_prefix () == NOTOK) { if (*cp < 'z') (*cp)++; else if (*++cp == 0) adios (NULL, "can't find a unique delimiter string"); else (*cp)++; } fprintf (out, "%s: %s\n%s: multipart/digest; boundary=\"", VRSN_FIELD, VRSN_VALUE, TYPE_FIELD); fprintf (out, "%s\"\n\n--%s\n\n", prefix, prefix); } else { fprintf (out, "\n------- Blind-Carbon-Copy\n\n"); } fflush (out); /* * Do mhl filtering of Bcc messages instead * of MIME encapsulation. */ if (filter != NULL) { vec[0] = r1bindex (mhlproc, '/'); for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: adios ("fork", "unable to"); case OK: dup2 (fileno (out), 1); i = 1; vec[i++] = "-forward"; vec[i++] = "-form"; vec[i++] = filter; vec[i++] = tmpfil; /* was the flag -[no]dashstuffing specified? */ if (dashstuff > 0) vec[i++] = "-dashstuffing"; else if (dashstuff < 0) vec[i++] = "-nodashstuffing"; vec[i] = NULL; execvp (mhlproc, vec); fprintf (stderr, "unable to exec "); perror (mhlproc); _exit (-1); default: pidXwait (child_id, mhlproc); break; } } else { if ((fd = open (tmpfil, O_RDONLY)) == NOTOK) adios (tmpfil, "unable to re-open"); /* * If using MIME encapsulation, or if the -nodashstuffing * flag was given, then just copy message. Else do * RFC934 quoting (dashstuffing). */ if (mime || dashstuff < 0) cpydata (fd, fileno (out), tmpfil, bccfil); else cpydgst (fd, fileno (out), tmpfil, bccfil); close (fd); } fseek (out, 0L, SEEK_END); if (mime) fprintf (out, "\n--%s--\n", prefix); else fprintf (out, "\n------- End of Blind-Carbon-Copy\n"); fclose (out); } /* * Scan message to check if any lines clash with * the prefix of the MIME multipart separator. */ static int find_prefix (void) { int result = OK; unsigned char buffer[BUFSIZ]; FILE *in; if ((in = fopen (tmpfil, "r")) == NULL) adios (tmpfil, "unable to re-open"); while (fgets (buffer, sizeof(buffer) - 1, in)) if (buffer[0] == '-' && buffer[1] == '-') { unsigned char *cp; for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--) if (!isspace (*cp)) break; *++cp = '\0'; if (strcmp (buffer + 2, prefix) == 0) { result = NOTOK; break; } } fclose (in); return result; } #define plural(x) (x == 1 ? "" : "s") static void chkadr (void) { if (badadr && unkadr) die (NULL, "%d address%s unparsable, %d addressee%s undeliverable", badadr, plural (badadr), unkadr, plural (badadr)); if (badadr) die (NULL, "%d address%s unparsable", badadr, plural (badadr)); if (unkadr) die (NULL, "%d addressee%s undeliverable", unkadr, plural (unkadr)); } static void do_addresses (int bccque, int talk) { int retval; int state; struct mailname *lp; state = 0; for (lp = localaddrs.m_next; lp; lp = lp->m_next) if (lp->m_bcc ? bccque : !bccque) { if (talk && !state) printf (" -- Local Recipients --\n"); do_an_address (lp, talk); state++; } state = 0; for (lp = uuaddrs.m_next; lp; lp = lp->m_next) if (lp->m_bcc ? bccque : !bccque) { if (talk && !state) printf (" -- UUCP Recipients --\n"); do_an_address (lp, talk); state++; } state = 0; for (lp = netaddrs.m_next; lp; lp = lp->m_next) if (lp->m_bcc ? bccque : !bccque) { if (talk && !state) printf (" -- Network Recipients --\n"); do_an_address (lp, talk); state++; } chkadr (); if (rp_isbad (retval = sm_waend ())) die (NULL, "problem ending addresses; %s", rp_string (retval)); } /* * MTS-SPECIFIC INTERACTION */ /* * SENDMAIL/SMTP routines */ static void post (char *file, int bccque, int talk, char *envelope) { int fd, onex; int retval; onex = !(msgflags & MINV) || bccque; if (verbose) { if (msgflags & MINV) printf (" -- Posting for %s Recipients --\n", bccque ? "Blind" : "Sighted"); else printf (" -- Posting for All Recipients --\n"); } sigon (); if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch, verbose, snoop, onex, queued, sasl, saslssf, saslmech, user, tls)) || rp_isbad (retval = sm_winit (envelope))) die (NULL, "problem initializing server; %s", rp_string (retval)); do_addresses (bccque, talk && verbose); if ((fd = open (file, O_RDONLY)) == NOTOK) die (file, "unable to re-open"); do_text (file, fd); close (fd); fflush (stdout); sm_end (onex ? OK : DONE); sigoff (); if (verbose) { if (msgflags & MINV) printf (" -- %s Recipient Copies Posted --\n", bccque ? "Blind" : "Sighted"); else printf (" -- Recipient Copies Posted --\n"); } fflush (stdout); } /* Address Verification */ static void verify_all_addresses (int talk, char *envelope) { int retval; struct mailname *lp; sigon (); if (!whomsw || checksw) if (rp_isbad (retval = sm_init (clientsw, serversw, port, watch, verbose, snoop, 0, queued, sasl, saslssf, saslmech, user, tls)) || rp_isbad (retval = sm_winit (envelope))) die (NULL, "problem initializing server; %s", rp_string (retval)); if (talk && !whomsw) printf (" -- Address Verification --\n"); if (talk && localaddrs.m_next) printf (" -- Local Recipients --\n"); for (lp = localaddrs.m_next; lp; lp = lp->m_next) do_an_address (lp, talk); if (talk && uuaddrs.m_next) printf (" -- UUCP Recipients --\n"); for (lp = uuaddrs.m_next; lp; lp = lp->m_next) do_an_address (lp, talk); if (talk && netaddrs.m_next) printf (" -- Network Recipients --\n"); for (lp = netaddrs.m_next; lp; lp = lp->m_next) do_an_address (lp, talk); chkadr (); if (talk && !whomsw) printf (" -- Address Verification Successful --\n"); if (!whomsw || checksw) sm_end (DONE); fflush (stdout); sigoff (); } static void do_an_address (struct mailname *lp, int talk) { int retval; char *mbox, *host; char addr[BUFSIZ]; switch (lp->m_type) { case LOCALHOST: mbox = lp->m_mbox; host = lp->m_host; strncpy (addr, mbox, sizeof(addr)); break; case UUCPHOST: mbox = auxformat (lp, 0); host = NULL; snprintf (addr, sizeof(addr), "%s!%s", lp->m_host, lp->m_mbox); break; default: /* let SendMail decide if the host is bad */ mbox = lp->m_mbox; host = lp->m_host; snprintf (addr, sizeof(addr), "%s at %s", mbox, host); break; } if (talk) printf (" %s%s", addr, whomsw && lp->m_bcc ? "[BCC]" : ""); if (whomsw && !checksw) { putchar ('\n'); return; } if (talk) printf (": "); fflush (stdout); switch (retval = sm_wadr (mbox, host, lp->m_type != UUCPHOST ? lp->m_path : NULL)) { case RP_OK: if (talk) printf ("address ok\n"); break; case RP_NO: case RP_USER: if (!talk) fprintf (stderr, " %s: ", addr); fprintf (talk ? stdout : stderr, "loses; %s\n", rp_string (retval)); unkadr++; break; default: if (!talk) fprintf (stderr, " %s: ", addr); die (NULL, "unexpected response; %s", rp_string (retval)); } fflush (stdout); } static void do_text (char *file, int fd) { int retval, state; char buf[BUFSIZ]; lseek (fd, (off_t) 0, SEEK_SET); while ((state = read (fd, buf, sizeof(buf))) > 0) { if (rp_isbad (retval = sm_wtxt (buf, state))) die (NULL, "problem writing text; %s\n", rp_string (retval)); } if (state == NOTOK) die (file, "problem reading from"); switch (retval = sm_wtend ()) { case RP_OK: break; case RP_NO: case RP_NDEL: die (NULL, "posting failed; %s", rp_string (retval)); default: die (NULL, "unexpected response; %s", rp_string (retval)); } } /* * SIGNAL HANDLING */ static void sigser (int i) { NMH_UNUSED (i); unlink (tmpfil); if (msgflags & MINV) unlink (bccfil); if (!whomsw || checksw) sm_end (NOTOK); done (1); } static void sigon (void) { if (debug) return; hstat = SIGNAL2 (SIGHUP, sigser); istat = SIGNAL2 (SIGINT, sigser); qstat = SIGNAL2 (SIGQUIT, sigser); tstat = SIGNAL2 (SIGTERM, sigser); } static void sigoff (void) { if (debug) return; SIGNAL (SIGHUP, hstat); SIGNAL (SIGINT, istat); SIGNAL (SIGQUIT, qstat); SIGNAL (SIGTERM, tstat); } /* * FCC INTERACTION */ static void p_refile (char *file) { int i; if (fccind == 0) return; if (verbose) printf (" -- Filing Folder Copies --\n"); for (i = 0; i < fccind; i++) fcc (file, fccfold[i]); if (verbose) printf (" -- Folder Copies Filed --\n"); } /* * Call the `fileproc' to add the file to the folder. */ static void fcc (char *file, char *folder) { pid_t child_id; int i, status; char fold[BUFSIZ]; if (verbose) printf (" %sFcc %s: ", msgstate == RESENT ? "Resent-" : "", folder); fflush (stdout); for (i = 0; (child_id = fork ()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: if (!verbose) fprintf (stderr, " %sFcc %s: ", msgstate == RESENT ? "Resent-" : "", folder); fprintf (verbose ? stdout : stderr, "no forks, so not ok\n"); break; case OK: /* see if we need to add `+' */ snprintf (fold, sizeof(fold), "%s%s", *folder == '+' || *folder == '@' ? "" : "+", folder); /* now exec the fileproc */ execlp (fileproc, r1bindex (fileproc, '/'), "-link", "-file", file, fold, NULL); _exit (-1); default: if ((status = pidwait (child_id, OK))) { if (!verbose) fprintf (stderr, " %sFcc %s: ", msgstate == RESENT ? "Resent-" : "", folder); pidstatus (status, verbose ? stdout : stderr, NULL); } else { if (verbose) printf ("folder ok\n"); } } fflush (stdout); } /* * TERMINATION */ static void die (char *what, char *fmt, ...) { va_list ap; unlink (tmpfil); if (msgflags & MINV) unlink (bccfil); if (!whomsw || checksw) sm_end (NOTOK); va_start(ap, fmt); advertise (what, NULL, fmt, ap); va_end(ap); done (1); } nmh-1.5/uip/prompter.c000644 007761 000765 00000020264 11765267273 014727 0ustar00kenhkenh000000 000000 /* * prompter.c -- simple prompting editor front-end * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #define QUOTE '\\' #ifndef CKILL # define CKILL '@' #endif #ifndef CERASE # define CERASE '#' #endif static struct swit switches[] = { #define ERASESW 0 { "erase chr", 0 }, #define KILLSW 1 { "kill chr", 0 }, #define PREPSW 2 { "prepend", 0 }, #define NPREPSW 3 { "noprepend", 0 }, #define RAPDSW 4 { "rapid", 0 }, #define NRAPDSW 5 { "norapid", 0 }, #define BODYSW 6 { "body", -4 }, #define NBODYSW 7 { "nobody", -6 }, #define DOTSW 8 { "doteof", 0 }, #define NDOTSW 9 { "nodoteof", 0 }, #define VERSIONSW 10 { "version", 0 }, #define HELPSW 11 { "help", 0 }, { NULL, 0 } }; static struct termios tio; #define ERASE tio.c_cc[VERASE] #define KILL tio.c_cc[VKILL] #define INTR tio.c_cc[VINTR] static int wtuser = 0; static int sigint = 0; static jmp_buf sigenv; /* * prototypes */ int getln (char *, int); static int chrcnv (char *); static void chrdsp (char *, char); static void intrser (int); int main (int argc, char **argv) { int body = 1, prepend = 1, rapid = 0; int doteof = 0, fdi, fdo, i, state; char *cp, *drft = NULL, *erasep = NULL; char *killp = NULL, name[NAMESZ], field[BUFSIZ]; char buffer[BUFSIZ], tmpfil[BUFSIZ]; char **arguments, **argp; FILE *in, *out; char *tfile = NULL; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buffer, sizeof(buffer), "%s [switches] file", invo_name); print_help (buffer, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case ERASESW: if (!(erasep = *argp++) || *erasep == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case KILLSW: if (!(killp = *argp++) || *killp == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case PREPSW: prepend++; continue; case NPREPSW: prepend = 0; continue; case RAPDSW: rapid++; continue; case NRAPDSW: rapid = 0; continue; case BODYSW: body++; continue; case NBODYSW: body = 0; continue; case DOTSW: doteof++; continue; case NDOTSW: doteof = 0; continue; } } else { if (!drft) drft = cp; } if (!drft) adios (NULL, "usage: %s [switches] file", invo_name); if ((in = fopen (drft, "r")) == NULL) adios (drft, "unable to open"); tfile = m_mktemp2(NULL, invo_name, NULL, &out); if (tfile == NULL) adios("prompter", "unable to create temporary file"); chmod (tmpfil, 0600); strncpy (tmpfil, tfile, sizeof(tmpfil)); /* * Are we changing the kill or erase character? */ if (killp || erasep) { cc_t save_erase, save_kill; /* get the current terminal attributes */ tcgetattr(0, &tio); /* save original kill, erase character for later */ save_kill = KILL; save_erase = ERASE; /* set new kill, erase character in terminal structure */ KILL = killp ? chrcnv (killp) : save_kill; ERASE = erasep ? chrcnv (erasep) : save_erase; /* set the new terminal attributes */ tcsetattr(0, TCSADRAIN, &tio); /* print out new kill erase characters */ chrdsp ("erase", ERASE); chrdsp (", kill", KILL); chrdsp (", intr", INTR); putchar ('\n'); fflush (stdout); /* * We set the kill and erase character back to original * setup in terminal structure so we can easily * restore it upon exit. */ KILL = save_kill; ERASE = save_erase; } sigint = 0; SIGNAL2 (SIGINT, intrser); /* * Loop through the lines of the draft skeleton. */ for (state = FLD;;) { switch (state = m_getfld (state, name, field, sizeof(field), in)) { case FLD: case FLDEOF: case FLDPLUS: /* * Check if the value of field contains anything * other than space or tab. */ for (cp = field; *cp; cp++) if (*cp != ' ' && *cp != '\t') break; /* If so, just add header line to draft */ if (*cp++ != '\n' || *cp != 0) { printf ("%s:%s", name, field); fprintf (out, "%s:%s", name, field); while (state == FLDPLUS) { state = m_getfld (state, name, field, sizeof(field), in); printf ("%s", field); fprintf (out, "%s", field); } } else { /* Else, get value of header field */ printf ("%s: ", name); fflush (stdout); i = getln (field, sizeof(field)); if (i == -1) { abort: if (killp || erasep) { tcsetattr(0, TCSADRAIN, &tio); } unlink (tmpfil); done (1); } if (i != 0 || (field[0] != '\n' && field[0] != 0)) { fprintf (out, "%s:", name); do { if (field[0] != ' ' && field[0] != '\t') putc (' ', out); fprintf (out, "%s", field); } while (i == 1 && (i = getln (field, sizeof(field))) >= 0); if (i == -1) goto abort; } } if (state == FLDEOF) { /* moby hack */ fprintf (out, "--------\n"); printf ("--------\n"); if (!body) break; goto no_body; } continue; case BODY: case BODYEOF: case FILEEOF: if (!body) break; fprintf (out, "--------\n"); if (field[0] == 0 || !prepend) printf ("--------\n"); if (field[0]) { if (prepend && body) { printf ("\n--------Enter initial text\n\n"); fflush (stdout); for (;;) { getln (buffer, sizeof(buffer)); if (doteof && buffer[0] == '.' && buffer[1] == '\n') break; if (buffer[0] == 0) break; fprintf (out, "%s", buffer); } } do { fprintf (out, "%s", field); if (!rapid && !sigint) printf ("%s", field); } while (state == BODY && (state = m_getfld (state, name, field, sizeof(field), in))); if (prepend || !body) break; else printf ("\n--------Enter additional text\n\n"); } no_body: fflush (stdout); for (;;) { getln (field, sizeof(field)); if (doteof && field[0] == '.' && field[1] == '\n') break; if (field[0] == 0) break; fprintf (out, "%s", field); } break; default: adios (NULL, "skeleton is poorly formatted"); } break; } if (body) printf ("--------\n"); fflush (stdout); fclose (in); fclose (out); SIGNAL (SIGINT, SIG_IGN); if (killp || erasep) { tcsetattr(0, TCSADRAIN, &tio); } if ((fdi = open (tmpfil, O_RDONLY)) == NOTOK) adios (tmpfil, "unable to re-open"); if ((fdo = creat (drft, m_gmprot ())) == NOTOK) adios (drft, "unable to write"); cpydata (fdi, fdo, tmpfil, drft); close (fdi); close (fdo); unlink (tmpfil); context_save (); /* save the context file */ done (0); return 1; } int getln (char *buffer, int n) { int c; char *cp; cp = buffer; *cp = 0; switch (setjmp (sigenv)) { case OK: wtuser = 1; break; case DONE: wtuser = 0; return 0; default: wtuser = 0; return NOTOK; } for (;;) { switch (c = getchar ()) { case EOF: clearerr (stdin); longjmp (sigenv, DONE); case '\n': if (cp[-1] == QUOTE) { cp[-1] = c; wtuser = 0; return 1; } *cp++ = c; *cp = 0; wtuser = 0; return 0; default: if (cp < buffer + n) *cp++ = c; *cp = 0; } } } static void intrser (int i) { NMH_UNUSED (i); if (wtuser) longjmp (sigenv, NOTOK); sigint++; } static int chrcnv (char *cp) { return (*cp != QUOTE ? *cp : m_atoi (++cp)); } static void chrdsp (char *s, char c) { printf ("%s ", s); if (c < ' ' || c == 0177) printf ("^%c", c ^ 0100); else printf ("%c", c); } nmh-1.5/uip/rcvdist.c000644 007761 000765 00000015043 11765267273 014534 0ustar00kenhkenh000000 000000 /* * rcvdist.c -- asynchronously redistribute messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include static struct swit switches[] = { #define FORMSW 0 { "form formfile", 4 }, #define VERSIONSW 1 { "version", 0 }, #define HELPSW 2 { "help", 0 }, { NULL, 0 } }; static char backup[BUFSIZ] = ""; static char drft[BUFSIZ] = ""; static char tmpfil[BUFSIZ] = ""; /* * prototypes */ static void rcvdistout (FILE *, char *, char *); static void unlink_done (int) NORETURN; int main (int argc, char **argv) { pid_t child_id; int i, vecp = 1; char *addrs = NULL, *cp, *form = NULL, buf[BUFSIZ]; char **argp, **arguments, *vec[MAXARGS]; FILE *fp; char *tfile = NULL; done=unlink_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: vec[vecp++] = --cp; continue; case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [switches for postproc] address ...", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; } } addrs = addrs ? add (cp, add (", ", addrs)) : getcpy (cp); } if (addrs == NULL) adios (NULL, "usage: %s [switches] [switches for postproc] address ...", invo_name); umask (~m_gmprot ()); tfile = m_mktemp2(NULL, invo_name, NULL, &fp); if (tfile == NULL) adios("rcvdist", "unable to create temporary file"); strncpy (tmpfil, tfile, sizeof(tmpfil)); cpydata (fileno (stdin), fileno (fp), "message", tmpfil); fseek (fp, 0L, SEEK_SET); tfile = m_mktemp2(NULL, invo_name, NULL, NULL); if (tfile == NULL) adios("forw", "unable to create temporary file"); strncpy (drft, tfile, sizeof(tmpfil)); rcvdistout (fp, form, addrs); fclose (fp); if (distout (drft, tmpfil, backup) == NOTOK) done (1); vec[0] = r1bindex (postproc, '/'); vec[vecp++] = "-dist"; vec[vecp++] = drft; if ((cp = context_find ("mhlproc"))) { vec[vecp++] = "-mhlproc"; vec[vecp++] = cp; } vec[vecp] = NULL; for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: admonish (NULL, "unable to fork");/* fall */ case OK: execvp (postproc, vec); fprintf (stderr, "unable to exec "); perror (postproc); _exit (1); default: done (pidXwait(child_id, postproc)); } return 0; /* dead code to satisfy the compiler */ } /* very similar to routine in replsbr.c */ #define SBUFSIZ 256 static int outputlinelen = OUTPUTLINELEN; static struct format *fmt; static int ncomps = 0; static char **compbuffers = 0; static struct comp **used_buf = 0; static int dat[5]; static char *addrcomps[] = { "from", "sender", "reply-to", "to", "cc", "bcc", "resent-from", "resent-sender", "resent-reply-to", "resent-to", "resent-cc", "resent-bcc", NULL }; static void rcvdistout (FILE *inb, char *form, char *addrs) { register int char_read = 0, format_len, i, state; register char *tmpbuf, **nxtbuf, **ap; char *cp, *scanl, name[NAMESZ]; register struct comp *cptr, **savecomp; FILE *out; if (!(out = fopen (drft, "w"))) adios (drft, "unable to create"); /* get new format string */ cp = new_fs (form ? form : rcvdistcomps, NULL, NULL); format_len = strlen (cp); ncomps = fmt_compile (cp, &fmt) + 1; if (!(nxtbuf = compbuffers = (char **) calloc ((size_t) ncomps, sizeof(char *)))) adios (NULL, "unable to allocate component buffers"); if (!(savecomp = used_buf = (struct comp **) calloc ((size_t) (ncomps + 1), sizeof(struct comp *)))) adios (NULL, "unable to allocate component buffer stack"); savecomp += ncomps + 1; *--savecomp = 0; for (i = ncomps; i--;) *nxtbuf++ = mh_xmalloc (SBUFSIZ); nxtbuf = compbuffers; tmpbuf = *nxtbuf++; for (ap = addrcomps; *ap; ap++) { FINDCOMP (cptr, *ap); if (cptr) cptr->c_type |= CT_ADDR; } FINDCOMP (cptr, "addresses"); if (cptr) cptr->c_text = addrs; for (state = FLD;;) { switch (state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb)) { case FLD: case FLDPLUS: if ((cptr = wantcomp[CHASH (name)])) do { if (!mh_strcasecmp (name, cptr->c_name)) { char_read += msg_count; if (!cptr->c_text) { cptr->c_text = tmpbuf; *--savecomp = cptr; tmpbuf = *nxtbuf++; } else { i = strlen (cp = cptr->c_text) - 1; if (cp[i] == '\n') { if (cptr->c_type & CT_ADDR) { cp[i] = 0; cp = add (",\n\t", cp); } else cp = add ("\t", cp); } cptr->c_text = add (tmpbuf, cp); } while (state == FLDPLUS) { state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb); cptr->c_text = add (tmpbuf, cptr->c_text); char_read += msg_count; } break; } } while ((cptr = cptr->c_next)); while (state == FLDPLUS) state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb); break; case LENERR: case FMTERR: case BODY: case FILEEOF: goto finished; default: adios (NULL, "m_getfld() returned %d", state); } } finished: ; i = format_len + char_read + 256; scanl = mh_xmalloc ((size_t) i + 2); dat[0] = dat[1] = dat[2] = dat[4] = 0; dat[3] = outputlinelen; fmt_scan (fmt, scanl, i, dat); fputs (scanl, out); if (ferror (out)) adios (drft, "error writing"); fclose (out); free (scanl); for (nxtbuf = compbuffers, i = ncomps; (cptr = *savecomp++); nxtbuf++, i--) free (cptr->c_text); while (i-- > 0) free (*nxtbuf++); free ((char *) compbuffers); free ((char *) used_buf); } static void unlink_done (int status) { if (backup[0]) unlink (backup); if (drft[0]) unlink (drft); if (tmpfil[0]) unlink (tmpfil); exit (status ? RCV_MBX : RCV_MOK); } nmh-1.5/uip/rcvpack.c000644 007761 000765 00000004177 11765267273 014515 0ustar00kenhkenh000000 000000 /* * rcvpack.c -- append message to a file * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include static struct swit switches[] = { #define MBOXSW 0 { "mbox", 0 }, #define MMDFSW 1 { "mmdf", 0 }, #define VERSIONSW 2 { "version", 0 }, #define HELPSW 3 { "help", 0 }, { NULL, 0 } }; /* * default format in which to save messages */ static int mbx_style = MBOX_FORMAT; int main (int argc, char **argv) { int md; char *cp, *file = NULL, buf[BUFSIZ]; char **argp, **arguments; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case MBOXSW: mbx_style = MBOX_FORMAT; continue; case MMDFSW: mbx_style = MMDF_FORMAT; continue; } } if (file) adios (NULL, "only one file at a time!"); else file = cp; } if (!file) adios (NULL, "%s [switches] file", invo_name); rewind (stdin); /* open and lock the file */ if ((md = mbx_open (file, mbx_style, getuid(), getgid(), m_gmprot())) == NOTOK) done (RCV_MBX); /* append the message */ if (mbx_copy (file, mbx_style, md, fileno(stdin), 1, NULL, 0) == NOTOK) { mbx_close (file, md); done (RCV_MBX); } /* close and unlock the file */ if (mbx_close (file, md) == NOTOK) done (RCV_MBX); done (RCV_MOK); return 1; } nmh-1.5/uip/rcvstore.c000644 007761 000765 00000012560 11765267273 014726 0ustar00kenhkenh000000 000000 /* * rcvstore.c -- asynchronously add mail to a folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include static struct swit switches[] = { #define CRETSW 0 { "create", 0 }, #define NCRETSW 1 { "nocreate", 0 }, #define UNSEENSW 2 { "unseen", 0 }, #define NUNSEENSW 3 { "nounseen", 0 }, #define PUBSW 4 { "public", 0 }, #define NPUBSW 5 { "nopublic", 0 }, #define ZEROSW 6 { "zero", 0 }, #define NZEROSW 7 { "nozero", 0 }, #define SEQSW 8 { "sequence name", 0 }, #define VERSIONSW 9 { "version", 0 }, #define HELPSW 10 { "help", 0 }, { NULL, 0 } }; /* * name of temporary file to store incoming message */ static char *tmpfilenam = NULL; static void unlink_done(int) NORETURN; int main (int argc, char **argv) { int publicsw = -1, zerosw = 0; int create = 1, unseensw = 1; int fd, msgnum; size_t seqp = 0; char *cp, *maildir, *folder = NULL, buf[BUFSIZ]; char **argp, **arguments, *seqs[NUMATTRS+1]; struct msgs *mp; struct stat st; done=unlink_done; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case SEQSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument name to %s", argp[-2]); /* check if too many sequences specified */ if (seqp >= NUMATTRS) adios (NULL, "too many sequences (more than %d) specified", NUMATTRS); seqs[seqp++] = cp; continue; case UNSEENSW: unseensw = 1; continue; case NUNSEENSW: unseensw = 0; continue; case PUBSW: publicsw = 1; continue; case NPUBSW: publicsw = 0; continue; case ZEROSW: zerosw++; continue; case NZEROSW: zerosw = 0; continue; case CRETSW: create++; continue; case NCRETSW: create = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { adios (NULL, "usage: %s [+folder] [switches]", invo_name); } } seqs[seqp] = NULL; /* NULL terminate list of sequences */ if (!context_find ("path")) free (path ("./", TFOLDER)); /* if no folder is given, use default folder */ if (!folder) folder = getfolder (0); maildir = m_maildir (folder); /* check if folder exists */ if (stat (maildir, &st) == NOTOK) { if (errno != ENOENT) adios (maildir, "error on folder"); if (!create) adios (NULL, "folder %s doesn't exist", maildir); if (!makedir (maildir)) adios (NULL, "unable to create folder %s", maildir); } if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* ignore a few signals */ SIGNAL (SIGHUP, SIG_IGN); SIGNAL (SIGINT, SIG_IGN); SIGNAL (SIGQUIT, SIG_IGN); SIGNAL (SIGTERM, SIG_IGN); /* create a temporary file */ tmpfilenam = m_mktemp (invo_name, &fd, NULL); if (tmpfilenam == NULL) { adios ("rcvstore", "unable to create temporary file"); } chmod (tmpfilenam, m_gmprot()); /* copy the message from stdin into temp file */ cpydata (fileno (stdin), fd, "standard input", tmpfilenam); if (fstat (fd, &st) == NOTOK) { unlink (tmpfilenam); adios (tmpfilenam, "unable to fstat"); } if (close (fd) == NOTOK) adios (tmpfilenam, "error closing"); /* don't add file if it is empty */ if (st.st_size == 0) { unlink (tmpfilenam); advise (NULL, "empty file"); done (0); } /* * read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* * Link message into folder, and possibly add * to the Unseen-Sequence's. */ if ((msgnum = folder_addmsg (&mp, tmpfilenam, 0, unseensw, 0, 0, (char *)0)) == -1) done (1); /* * Add the message to any extra sequences * that have been specified. */ for (seqp = 0; seqs[seqp]; seqp++) { if (!seq_addmsg (mp, seqs[seqp], msgnum, publicsw, zerosw)) done (1); } seq_setunseen (mp, 0); /* synchronize any Unseen-Sequence's */ seq_save (mp); /* synchronize and save message sequences */ folder_free (mp); /* free folder/message structure */ context_save (); /* save the global context file */ unlink (tmpfilenam); /* remove temporary file */ tmpfilenam = NULL; done (0); return 1; } /* * Clean up and exit */ static void unlink_done(int status) { if (tmpfilenam && *tmpfilenam) unlink (tmpfilenam); exit (status); } nmh-1.5/uip/rcvtty.c000644 007761 000765 00000015317 11765267273 014415 0ustar00kenhkenh000000 000000 /* * rcvtty.c -- a rcvmail program (a lot like rcvalert) handling IPC ttys * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ /* Changed to use getutent() and friends. Assumes that when getutent() exists, * a number of other things also exist. Please check. * Ruud de Rooij Sun, 28 May 2000 17:28:55 +0200 */ #include #include #include #include #include #include #include #include #include #ifdef HAVE_GETUTXENT #include #endif /* HAVE_GETUTXENT */ #define SCANFMT \ "%2(hour{dtimenow}):%02(min{dtimenow}): %<(size)%5(size) %>%<{encrypted}E%>\ %<(mymbox{from})%<{to}To:%14(friendly{to})%>%>%<(zero)%17(friendly{from})%> \ %{subject}%<{body}<<%{body}>>%>" static struct swit switches[] = { #define BIFFSW 0 { "biff", 0 }, #define FORMSW 1 { "form formatfile", 0 }, #define FMTSW 2 { "format string", 5 }, #define WIDTHSW 3 { "width columns", 0 }, #define NLSW 4 { "newline", 0 }, #define NNLSW 5 { "nonewline", 0 }, #define BELSW 6 { "bell", 0 }, #define NBELSW 7 { "nobell", 0 }, #define VERSIONSW 8 { "version", 0 }, #define HELPSW 9 { "help", 0 }, { NULL, 0 } }; static jmp_buf myctx; static int bell = 1; static int newline = 1; static int biff = 0; static int width = 0; static char *form = NULL; static char *format = NULL; /* * external prototypes */ char *getusername(void); /* * static prototypes */ static void alrmser (int); static int message_fd (char **); static int header_fd (void); static void alert (char *, int); int main (int argc, char **argv) { int md, vecp = 0; char *cp, *user, buf[BUFSIZ], tty[BUFSIZ]; char **argp, **arguments, *vec[MAXARGS]; struct utmpx *utp; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: vec[vecp++] = --cp; continue; case HELPSW: snprintf (buf, sizeof(buf), "%s [command ...]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case BIFFSW: biff = 1; continue; case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') adios (NULL, "missing argument to %s", argp[-2]); form = NULL; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios(NULL, "missing argument to %s", argp[-2]); width = atoi(cp); continue; case NLSW: newline = 1; continue; case NNLSW: newline = 0; continue; case BELSW: bell = 1; continue; case NBELSW: bell = 0; continue; } } vec[vecp++] = cp; } vec[vecp] = 0; if ((md = vecp ? message_fd (vec) : header_fd ()) == NOTOK) exit (RCV_MBX); user = getusername(); #if HAVE_GETUTXENT setutxent(); while ((utp = getutxent()) != NULL) { if (utp->ut_type == USER_PROCESS && utp->ut_user[0] != 0 && utp->ut_line[0] != 0 && strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) { strncpy (tty, utp->ut_line, sizeof(utp->ut_line)); alert (tty, md); } } endutxent(); #endif /* HAVE_GETUTXENT */ exit (RCV_MOK); return 0; /* dead code to satisfy the compiler */ } static void alrmser (int i) { NMH_UNUSED (i); longjmp (myctx, 1); } static int message_fd (char **vec) { pid_t child_id; int bytes, fd, seconds; char tmpfil[BUFSIZ]; struct stat st; fd = mkstemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil))); unlink (tmpfil); if ((child_id = vfork()) == NOTOK) { /* fork error */ close (fd); return header_fd (); } else if (child_id) { /* parent process */ if (!setjmp (myctx)) { SIGNAL (SIGALRM, alrmser); bytes = fstat(fileno (stdin), &st) != NOTOK ? (int) st.st_size : 100; /* amount of time to wait depends on message size */ if (bytes <= 100) { /* give at least 5 minutes */ seconds = 300; } else if (bytes >= 90000) { /* but 30 minutes should be long enough */ seconds = 1800; } else { seconds = (bytes / 60) + 300; } alarm ((unsigned int) seconds); pidwait(child_id, OK); alarm (0); if (fstat (fd, &st) != NOTOK && st.st_size > (off_t) 0) return fd; } else { /* * Ruthlessly kill the child and anything * else in its process group. */ killpg(child_id, SIGKILL); } close (fd); return header_fd (); } /* child process */ rewind (stdin); if (dup2 (fd, 1) == NOTOK || dup2 (fd, 2) == NOTOK) _exit (-1); closefds (3); setpgid ((pid_t) 0, getpid ()); /* put in own process group */ execvp (vec[0], vec); _exit (-1); return 1; /* dead code to satisfy compiler */ } static int header_fd (void) { int fd; char *nfs; char *tfile = NULL; tfile = m_mktemp2(NULL, invo_name, &fd, NULL); if (tfile == NULL) return NOTOK; unlink (tfile); rewind (stdin); /* get new format string */ nfs = new_fs (form, format, SCANFMT); scan (stdin, 0, 0, nfs, width, 0, 0, NULL, 0L, 0); if (newline) write (fd, "\n\r", 2); write (fd, scanl, strlen (scanl)); if (bell) write (fd, "\007", 1); return fd; } static void alert (char *tty, int md) { int i, td, mask; char buffer[BUFSIZ], ttyspec[BUFSIZ]; struct stat st; snprintf (ttyspec, sizeof(ttyspec), "/dev/%s", tty); /* * The mask depends on whether we are checking for * write permission based on `biff' or `mesg'. */ mask = biff ? S_IEXEC : (S_IWRITE >> 3); if (stat (ttyspec, &st) == NOTOK || (st.st_mode & mask) == 0) return; if (!setjmp (myctx)) { SIGNAL (SIGALRM, alrmser); alarm (2); td = open (ttyspec, O_WRONLY); alarm (0); if (td == NOTOK) return; } else { alarm (0); return; } lseek (md, (off_t) 0, SEEK_SET); while ((i = read (md, buffer, sizeof(buffer))) > 0) if (write (td, buffer, i) != i) break; close (td); } nmh-1.5/uip/refile.c000644 007761 000765 00000021574 11765267273 014332 0ustar00kenhkenh000000 000000 /* * refile.c -- move or link message(s) from a source folder * -- into one or more destination folders * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include static struct swit switches[] = { #define DRAFTSW 0 { "draft", 0 }, #define LINKSW 1 { "link", 0 }, #define NLINKSW 2 { "nolink", 0 }, #define PRESSW 3 { "preserve", 0 }, #define NPRESSW 4 { "nopreserve", 0 }, #define UNLINKSW 5 { "unlink", 0 }, #define NUNLINKSW 6 { "nounlink", 0 }, #define SRCSW 7 { "src +folder", 0 }, #define FILESW 8 { "file file", 0 }, #define RPROCSW 9 { "rmmproc program", 0 }, #define NRPRCSW 10 { "normmproc", 0 }, #define VERSIONSW 11 { "version", 0 }, #define HELPSW 12 { "help", 0 }, { NULL, 0 } }; static char maildir[BUFSIZ]; struct st_fold { char *f_name; struct msgs *f_mp; }; /* * static prototypes */ static void opnfolds (struct st_fold *, int); static void clsfolds (struct st_fold *, int); static void remove_files (int, char **); static int m_file (char *, struct st_fold *, int, int, int); int main (int argc, char **argv) { int linkf = 0, preserve = 0, filep = 0; int foldp = 0, isdf = 0, unlink_msgs = 0; int i, msgnum; char *cp, *folder = NULL, buf[BUFSIZ]; char **argp, **arguments; char *filevec[NFOLDERS + 2]; char **files = &filevec[1]; /* leave room for remove_files:vec[0] */ struct st_fold folders[NFOLDERS + 1]; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [msgs] [switches] +folder ...", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case LINKSW: linkf++; continue; case NLINKSW: linkf = 0; continue; case PRESSW: preserve++; continue; case NPRESSW: preserve = 0; continue; case UNLINKSW: unlink_msgs++; continue; case NUNLINKSW: unlink_msgs = 0; continue; case SRCSW: if (folder) adios (NULL, "only one source folder at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); folder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DRAFTSW: if (filep > NFOLDERS) adios (NULL, "only %d files allowed!", NFOLDERS); isdf = 0; files[filep++] = getcpy (m_draft (NULL, NULL, 1, &isdf)); continue; case FILESW: if (filep > NFOLDERS) adios (NULL, "only %d files allowed!", NFOLDERS); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); files[filep++] = path (cp, TFILE); continue; case RPROCSW: if (!(rmmproc = *argp++) || *rmmproc == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NRPRCSW: rmmproc = NULL; continue; } } if (*cp == '+' || *cp == '@') { if (foldp > NFOLDERS) adios (NULL, "only %d folders allowed!", NFOLDERS); folders[foldp++].f_name = pluspath (cp); } else app_msgarg(&msgs, cp); } if (!context_find ("path")) free (path ("./", TFOLDER)); if (foldp == 0) adios (NULL, "no folder specified"); #ifdef WHATNOW if (!msgs.size && !foldp && !filep && (cp = getenv ("mhdraft")) && *cp) files[filep++] = cp; #endif /* WHATNOW */ /* * We are refiling a file to the folders */ if (filep > 0) { if (folder || msgs.size) adios (NULL, "use -file or some messages, not both"); opnfolds (folders, foldp); for (i = 0; i < filep; i++) if (m_file (files[i], folders, foldp, preserve, 0)) done (1); /* If -nolink, then "remove" files */ if (!linkf) remove_files (filep, filevec); done (0); } if (!msgs.size) app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); strncpy (maildir, m_maildir (folder), sizeof(maildir)); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read source folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse the message range/sequence/name and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ /* create folder structures for each destination folder */ opnfolds (folders, foldp); /* Link all the selected messages into destination folders. * * This causes the add hook to be run for messages that are * linked into another folder. The refile hook is run for * messages that are moved to another folder. */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) { cp = getcpy (m_name (msgnum)); if (m_file (cp, folders, foldp, preserve, !linkf)) done (1); free (cp); } } /* * This is a hack. If we are using an external rmmproc, * then save the current folder to the context file, * so the external rmmproc will remove files from the correct * directory. This should be moved to folder_delmsgs(). */ if (rmmproc) { context_replace (pfolder, folder); context_save (); fflush (stdout); } /* If -nolink, then "remove" messages from source folder. * * Note that folder_delmsgs does not call the delete hook * because the message has already been handled above. */ if (!linkf) { folder_delmsgs (mp, unlink_msgs, 1); } clsfolds (folders, foldp); if (mp->hghsel != mp->curmsg && (mp->numsel != mp->nummsg || linkf)) seq_setcur (mp, mp->hghsel); seq_save (mp); /* synchronize message sequences */ context_replace (pfolder, folder); /* update current folder */ context_save (); /* save the context file */ folder_free (mp); /* free folder structure */ done (0); return 1; } /* * Read all the destination folders and * create folder structures for all of them. */ static void opnfolds (struct st_fold *folders, int nfolders) { char nmaildir[BUFSIZ]; register struct st_fold *fp, *ep; register struct msgs *mp; for (fp = folders, ep = folders + nfolders; fp < ep; fp++) { chdir (m_maildir ("")); strncpy (nmaildir, m_maildir (fp->f_name), sizeof(nmaildir)); create_folder (nmaildir, 0, done); if (chdir (nmaildir) == NOTOK) adios (nmaildir, "unable to change directory to"); if (!(mp = folder_read (fp->f_name))) adios (NULL, "unable to read folder %s", fp->f_name); mp->curmsg = 0; fp->f_mp = mp; chdir (maildir); } } /* * Set the Previous-Sequence and then sychronize the * sequence file, for each destination folder. */ static void clsfolds (struct st_fold *folders, int nfolders) { register struct st_fold *fp, *ep; register struct msgs *mp; for (fp = folders, ep = folders + nfolders; fp < ep; fp++) { mp = fp->f_mp; seq_setprev (mp); seq_save (mp); } } /* * If you have a "rmmproc" defined, we called that * to remove all the specified files. If "rmmproc" * is not defined, then just unlink the files. */ static void remove_files (int filep, char **files) { int i; char **vec; /* If rmmproc is defined, we use that */ if (rmmproc) { vec = files++; /* vec[0] = filevec[0] */ files[filep] = NULL; /* NULL terminate list */ fflush (stdout); vec[0] = r1bindex (rmmproc, '/'); execvp (rmmproc, vec); adios (rmmproc, "unable to exec"); } /* Else just unlink the files */ files++; /* advance past filevec[0] */ for (i = 0; i < filep; i++) { if (unlink (files[i]) == NOTOK) admonish (files[i], "unable to unlink"); } } /* * Link (or copy) the message into each of * the destination folders. */ static int m_file (char *msgfile, struct st_fold *folders, int nfolders, int preserve, int refile) { int msgnum; struct st_fold *fp, *ep; for (fp = folders, ep = folders + nfolders; fp < ep; fp++) { if ((msgnum = folder_addmsg (&fp->f_mp, msgfile, 1, 0, preserve, nfolders == 1 && refile, maildir)) == -1) return 1; } return 0; } nmh-1.5/uip/repl.c000644 007761 000765 00000025625 11765267273 014027 0ustar00kenhkenh000000 000000 /* * repl.c -- reply to a message * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include static struct swit switches[] = { #define GROUPSW 0 { "group", 0 }, #define NGROUPSW 1 { "nogroup", 0 }, #define ANNOSW 2 { "annotate", 0 }, #define NANNOSW 3 { "noannotate", 0 }, #define CCSW 4 { "cc all|to|cc|me", 0 }, #define NCCSW 5 { "nocc type", 0 }, #define DFOLDSW 6 { "draftfolder +folder", 0 }, #define DMSGSW 7 { "draftmessage msg", 0 }, #define NDFLDSW 8 { "nodraftfolder", 0 }, #define EDITRSW 9 { "editor editor", 0 }, #define NEDITSW 10 { "noedit", 0 }, #define FCCSW 11 { "fcc folder", 0 }, #define FILTSW 12 { "filter filterfile", 0 }, #define FORMSW 13 { "form formfile", 0 }, #define FRMTSW 14 { "format", 5 }, #define NFRMTSW 15 { "noformat", 7 }, #define INPLSW 16 { "inplace", 0 }, #define NINPLSW 17 { "noinplace", 0 }, #define MIMESW 18 { "mime", 0 }, #define NMIMESW 19 { "nomime", 0 }, #define QURYSW 20 { "query", 0 }, #define NQURYSW 21 { "noquery", 0 }, #define WHATSW 22 { "whatnowproc program", 0 }, #define NWHATSW 23 { "nowhatnowproc", 0 }, #define WIDTHSW 24 { "width columns", 0 }, #define VERSIONSW 25 { "version", 0 }, #define HELPSW 26 { "help", 0 }, #define FILESW 27 { "file file", 4 }, /* interface from msh */ #define BILDSW 28 { "build", 5 }, /* interface from mhe */ #define ATFILESW 29 { "atfile", 0 }, #define NOATFILESW 30 { "noatfile", 0 }, #define FMTPROCSW 31 { "fmtproc program", 0 }, #define NFMTPROCSW 32 { "nofmtproc", 0 }, { NULL, 0 } }; static struct swit ccswitches[] = { #define CTOSW 0 { "to", 0 }, #define CCCSW 1 { "cc", 0 }, #define CMESW 2 { "me", 0 }, #define CALSW 3 { "all", 0 }, { NULL, 0 } }; static struct swit aqrnl[] = { #define NOSW 0 { "quit", 0 }, #define YESW 1 { "replace", 0 }, #define LISTDSW 2 { "list", 0 }, #define REFILSW 3 { "refile +folder", 0 }, #define NEWSW 4 { "new", 0 }, { NULL, 0 } }; static struct swit aqrl[] = { { "quit", 0 }, { "replace", 0 }, { "list", 0 }, { "refile +folder", 0 }, { NULL, 0 } }; short ccto = -1; /* global for replsbr */ short cccc = -1; short ccme = -1; short querysw = 0; short outputlinelen = OUTPUTLINELEN; short groupreply = 0; /* Is this a group reply? */ int mime = 0; /* include original as MIME part */ char *form = NULL; /* form (components) file */ char *filter = NULL; /* message filter file */ char *fcc = NULL; /* folders to add to Fcc: header */ /* * prototypes */ void docc (char *, int); int main (int argc, char **argv) { int i, isdf = 0; int anot = 0, inplace = 1; int nedit = 0, nwhat = 0; int atfile = 1; int fmtproc = -1; char *cp, *cwd, *dp, *maildir, *file = NULL; char *folder = NULL, *msg = NULL, *dfolder = NULL; char *dmsg = NULL, *ed = NULL, drft[BUFSIZ], buf[BUFSIZ]; char **argp, **arguments; struct msgs *mp = NULL; struct stat st; FILE *in; int buildsw = 0; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s: [+folder] [msg] [switches]", invo_name); print_help (buf, switches, 1); done (0); case VERSIONSW: print_version(invo_name); done (1); case GROUPSW: groupreply++; continue; case NGROUPSW: groupreply = 0; continue; case ANNOSW: anot++; continue; case NANNOSW: anot = 0; continue; case CCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); docc (cp, 1); continue; case NCCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); docc (cp, 0); continue; case EDITRSW: if (!(ed = *argp++) || *ed == '-') adios (NULL, "missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: nedit++; continue; case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') adios (NULL, "missing argument to %s", argp[-2]); nwhat = 0; continue; case BILDSW: buildsw++; /* fall... */ case NWHATSW: nwhat++; continue; case FCCSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dp = NULL; if (*cp == '@') cp = dp = path (cp + 1, TSUBCWF); if (fcc) fcc = add (", ", fcc); fcc = add (cp, fcc); if (dp) free (dp); continue; case FILESW: if (file) adios (NULL, "only one file at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case FILTSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); filter = getcpy (etcpath (cp)); mime = 0; continue; case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case FRMTSW: filter = getcpy (etcpath (mhlreply)); mime = 0; continue; case NFRMTSW: filter = NULL; continue; case INPLSW: inplace++; continue; case NINPLSW: inplace = 0; continue; case MIMESW: mime++; filter = NULL; continue; case NMIMESW: mime = 0; continue; case QURYSW: querysw++; continue; case NQURYSW: querysw = 0; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if ((outputlinelen = atoi (cp)) < 10) adios (NULL, "impossible width %d", outputlinelen); continue; case DFOLDSW: if (dfolder) adios (NULL, "only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) adios (NULL, "only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; isdf = NOTOK; continue; case ATFILESW: atfile++; continue; case NOATFILESW: atfile = 0; continue; case FMTPROCSW: if (!(formatproc = *argp++) || *formatproc == '-') adios (NULL, "missing argument to %s", argp[-2]); fmtproc = 1; continue; case NFMTPROCSW: fmtproc = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { if (msg) adios (NULL, "only one message at a time!"); else msg = cp; } } if (ccto == -1) ccto = groupreply; if (cccc == -1) cccc = groupreply; if (ccme == -1) ccme = groupreply; cwd = getcpy (pwd ()); if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && (msg || folder)) adios (NULL, "can't mix files and folders/msgs"); try_it_again: strncpy (drft, buildsw ? m_maildir ("reply") : m_draft (dfolder, NULL, NOUSE, &isdf), sizeof(drft)); /* Check if a draft exists */ if (!buildsw && stat (drft, &st) != NOTOK) { printf ("Draft \"%s\" exists (%ld bytes).", drft, (long) st.st_size); for (i = LISTDSW; i != YESW;) { if (!(argp = getans ("\nDisposition? ", isdf ? aqrnl : aqrl))) done (1); switch (i = smatch (*argp, isdf ? aqrnl : aqrl)) { case NOSW: done (0); case NEWSW: dmsg = NULL; goto try_it_again; case YESW: break; case LISTDSW: showfile (++argp, drft); break; case REFILSW: if (refile (++argp, drft) == 0) i = YESW; break; default: advise (NULL, "say what?"); break; } } } if (file) { /* * We are replying to a file. */ anot = 0; /* we don't want to annotate a file */ } else { /* * We are replying to a message. */ if (!msg) msg = "cur"; if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse the message range/sequence/name and set SELECTED */ if (!m_convert (mp, msg)) done (1); seq_setprev (mp); /* set the previous-sequence */ if (mp->numsel > 1) adios (NULL, "only one message at a time!"); context_replace (pfolder, folder); /* update current folder */ seq_setcur (mp, mp->lowsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_save (); /* save the context file */ } msg = file ? file : getcpy (m_name (mp->lowsel)); if ((in = fopen (msg, "r")) == NULL) adios (msg, "unable to open"); /* find form (components) file */ if (!form) { if (groupreply) form = etcpath (replgroupcomps); else form = etcpath (replcomps); } replout (in, msg, drft, mp, outputlinelen, mime, form, filter, fcc, fmtproc); fclose (in); if (nwhat) done (0); what_now (ed, nedit, NOUSE, drft, msg, 0, mp, anot ? "Replied" : NULL, inplace, cwd, atfile); done (1); return 1; } void docc (char *cp, int ccflag) { switch (smatch (cp, ccswitches)) { case AMBIGSW: ambigsw (cp, ccswitches); done (1); case UNKWNSW: adios (NULL, "-%scc %s unknown", ccflag ? "" : "no", cp); case CTOSW: ccto = ccflag; break; case CCCSW: cccc = ccflag; break; case CMESW: ccme = ccflag; break; case CALSW: ccto = cccc = ccme = ccflag; break; } } nmh-1.5/uip/replsbr.c000644 007761 000765 00000027331 11762736347 014532 0ustar00kenhkenh000000 000000 /* * replsbr.c -- routines to help repl along... * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include /* L_SET */ #include extern short ccto; /* from repl.c */ extern short cccc; extern short ccme; extern short querysw; static int dftype=0; static char *badaddrs = NULL; static char *dfhost = NULL; static struct mailname mq; static int nodupcheck = 0; /* If set, no check for duplicates */ /* * Buffer size for content part of header fields. * We want this to be large enough so that we don't * do a lot of extra FLDPLUS calls on m_getfld but * small enough so that we don't snarf the entire * message body when we're not going to use any of it. */ #define SBUFSIZ 256 static struct format *fmt; static int ncomps = 0; /* # of interesting components */ static char **compbuffers = NULL; /* buffers for component text */ static struct comp **used_buf = NULL; /* stack for comp that use buffers */ static int dat[5]; /* aux. data for format routine */ static char *addrcomps[] = { "from", "sender", "reply-to", "to", "cc", "bcc", "resent-from", "resent-sender", "resent-reply-to", "resent-to", "resent-cc", "resent-bcc", NULL }; /* * static prototypes */ static int insert (struct mailname *); static void replfilter (FILE *, FILE *, char *, int); void replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, int mime, char *form, char *filter, char *fcc, int fmtproc) { register int state, i; register struct comp *cptr; register char *tmpbuf; register char **nxtbuf; register char **ap; register struct comp **savecomp; int char_read = 0, format_len, mask; char name[NAMESZ], *scanl; unsigned char *cp; FILE *out; NMH_UNUSED (msg); mask = umask(~m_gmprot()); if ((out = fopen (drft, "w")) == NULL) adios (drft, "unable to create"); umask(mask); /* get new format string */ cp = new_fs (form, NULL, NULL); format_len = strlen (cp); /* compile format string */ ncomps = fmt_compile (cp, &fmt) + 1; if (!(nxtbuf = compbuffers = (char **) calloc((size_t) ncomps, sizeof(char *)))) adios (NULL, "unable to allocate component buffers"); if (!(savecomp = used_buf = (struct comp **) calloc((size_t) (ncomps+1), sizeof(struct comp *)))) adios (NULL, "unable to allocate component buffer stack"); savecomp += ncomps + 1; *--savecomp = NULL; /* point at zero'd end minus 1 */ for (i = ncomps; i--; ) *nxtbuf++ = mh_xmalloc(SBUFSIZ); nxtbuf = compbuffers; /* point at start */ tmpbuf = *nxtbuf++; for (ap = addrcomps; *ap; ap++) { FINDCOMP (cptr, *ap); if (cptr) cptr->c_type |= CT_ADDR; } /* * ignore any components killed by command line switches */ if (!ccto) { FINDCOMP (cptr, "to"); if (cptr) cptr->c_name = ""; } if (!cccc) { FINDCOMP (cptr, "cc"); if (cptr) cptr->c_name = ""; } /* set up the "fcc" pseudo-component */ if (fcc) { FINDCOMP (cptr, "fcc"); if (cptr) cptr->c_text = getcpy (fcc); } if ((cp = getenv("USER"))) { FINDCOMP (cptr, "user"); if (cptr) cptr->c_text = getcpy(cp); } if (!ccme) ismymbox (NULL); /* * pick any interesting stuff out of msg "inb" */ for (state = FLD;;) { state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb); switch (state) { case FLD: case FLDPLUS: /* * if we're interested in this component, save a pointer * to the component text, then start using our next free * buffer as the component temp buffer (buffer switching * saves an extra copy of the component text). */ if ((cptr = wantcomp[CHASH(name)])) do { if (!mh_strcasecmp(name, cptr->c_name)) { char_read += msg_count; if (! cptr->c_text) { cptr->c_text = tmpbuf; *--savecomp = cptr; tmpbuf = *nxtbuf++; } else { i = strlen (cp = cptr->c_text) - 1; if (cp[i] == '\n') { if (cptr->c_type & CT_ADDR) { cp[i] = '\0'; cp = add (",\n\t", cp); } else { cp = add ("\t", cp); } } cptr->c_text = add (tmpbuf, cp); } while (state == FLDPLUS) { state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb); cptr->c_text = add (tmpbuf, cptr->c_text); char_read += msg_count; } break; } } while ((cptr = cptr->c_next)); while (state == FLDPLUS) state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb); break; case LENERR: case FMTERR: case BODY: case FILEEOF: goto finished; default: adios (NULL, "m_getfld() returned %d", state); } } /* * format and output the header lines. */ finished: /* * if there's a "Subject" component, strip any "Re:"s off it */ FINDCOMP (cptr, "subject") if (cptr && (cp = cptr->c_text)) { register char *sp = cp; for (;;) { while (isspace(*cp)) cp++; if(uprf(cp, "re:")) cp += 3; else break; sp = cp; } if (sp != cptr->c_text) { cp = cptr->c_text; cptr->c_text = getcpy (sp); free (cp); } } i = format_len + char_read + 256; scanl = mh_xmalloc ((size_t) i + 2); dat[0] = 0; dat[1] = 0; dat[2] = 0; dat[3] = outputlinelen; dat[4] = 0; fmt_scan (fmt, scanl, i, dat); fputs (scanl, out); if (badaddrs) { fputs ("\nrepl: bad addresses:\n", out); fputs ( badaddrs, out); } /* * Check if we should filter the message * or add mhn directives */ if (filter) { fflush(out); if (ferror (out)) adios (drft, "error writing"); replfilter (inb, out, filter, fmtproc); } else if (mime && mp) { fprintf (out, "#forw [original message] +%s %s\n", mp->foldpath, m_name (mp->lowsel)); } fflush(out); if (ferror (out)) adios (drft, "error writing"); fclose (out); /* return dynamically allocated buffers */ free (scanl); for (nxtbuf = compbuffers, i = ncomps; (cptr = *savecomp++); nxtbuf++, i--) free (cptr->c_text); /* if not nxtbuf, nxtbuf already freed */ while ( i-- > 0) free (*nxtbuf++); /* free unused nxtbufs */ free ((char *) compbuffers); free ((char *) used_buf); } static char *buf; /* our current working buffer */ static char *bufend; /* end of working buffer */ static char *last_dst; /* buf ptr at end of last call */ static unsigned int bufsiz=0; /* current size of buf */ #define BUFINCR 512 /* how much to expand buf when if fills */ #define CPY(s) { cp = (s); while ((*dst++ = *cp++)) ; --dst; } /* * check if there's enough room in buf for str. * add more mem if needed */ #define CHECKMEM(str) \ if ((len = strlen (str)) >= bufend - dst) {\ int i = dst - buf;\ int n = last_dst - buf;\ bufsiz += ((dst + len - bufend) / BUFINCR + 1) * BUFINCR;\ buf = mh_xrealloc (buf, bufsiz);\ dst = buf + i;\ last_dst = buf + n;\ bufend = buf + bufsiz;\ } /* * fmt_scan will call this routine if the user includes the function * "(formataddr {component})" in a format string. "orig" is the * original contents of the string register. "str" is the address * string to be formatted and concatenated onto orig. This routine * returns a pointer to the concatenated address string. * * We try to not do a lot of malloc/copy/free's (which is why we * don't call "getcpy") but still place no upper limit on the * length of the result string. */ char * formataddr (char *orig, char *str) { register int len; char baddr[BUFSIZ], error[BUFSIZ]; register int isgroup; register char *dst; register char *cp; register char *sp; register struct mailname *mp = NULL; /* if we don't have a buffer yet, get one */ if (bufsiz == 0) { buf = mh_xmalloc (BUFINCR); last_dst = buf; /* XXX */ bufsiz = BUFINCR - 6; /* leave some slop */ bufend = buf + bufsiz; } /* * If "orig" points to our buffer we can just pick up where we * left off. Otherwise we have to copy orig into our buffer. */ if (orig == buf) dst = last_dst; else if (!orig || !*orig) { dst = buf; *dst = '\0'; } else { dst = last_dst; /* XXX */ CHECKMEM (orig); CPY (orig); } /* concatenate all the new addresses onto 'buf' */ for (isgroup = 0; (cp = getname (str)); ) { if ((mp = getm (cp, dfhost, dftype, AD_NAME, error)) == NULL) { snprintf (baddr, sizeof(baddr), "\t%s -- %s\n", cp, error); badaddrs = add (baddr, badaddrs); continue; } if (isgroup && (mp->m_gname || !mp->m_ingrp)) { *dst++ = ';'; isgroup = 0; } if (insert (mp)) { /* if we get here we're going to add an address */ if (dst != buf) { *dst++ = ','; *dst++ = ' '; } if (mp->m_gname) { CHECKMEM (mp->m_gname); CPY (mp->m_gname); isgroup++; } sp = adrformat (mp); CHECKMEM (sp); CPY (sp); } } if (isgroup) *dst++ = ';'; *dst = '\0'; last_dst = dst; return (buf); } /* * fmt_scan will call this routine if the user includes the function * "(concataddr {component})" in a format string. This behaves exactly * like formataddr, except that it does NOT suppress duplicate addresses * between calls. * * As an implementation detail: I thought about splitting out formataddr() * into the generic part and duplicate-suppressing part, but the call to * insert() was buried deep within a couple of loops and I didn't see a * way to do it easily. So instead we simply set a special flag to stop * the duplicate check and call formataddr(). */ char * concataddr(char *orig, char *str) { char *cp; nodupcheck = 1; cp = formataddr(orig, str); nodupcheck = 0; return cp; } static int insert (struct mailname *np) { char buffer[BUFSIZ]; register struct mailname *mp; if (nodupcheck) return 1; if (np->m_mbox == NULL) return 0; for (mp = &mq; mp->m_next; mp = mp->m_next) { if (!mh_strcasecmp (np->m_host, mp->m_next->m_host) && !mh_strcasecmp (np->m_mbox, mp->m_next->m_mbox)) return 0; } if (!ccme && ismymbox (np)) return 0; if (querysw) { snprintf (buffer, sizeof(buffer), "Reply to %s? ", adrformat (np)); if (!gans (buffer, anoyes)) return 0; } mp->m_next = np; #ifdef ISI if (ismymbox (np)) ccme = 0; #endif return 1; } /* * Call the mhlproc * * This function expects that argument out has been fflushed by the caller. */ static void replfilter (FILE *in, FILE *out, char *filter, int fmtproc) { int pid; char *mhl; char *errstr; char *arglist[7]; if (filter == NULL) return; if (access (filter, R_OK) == NOTOK) adios (filter, "unable to read"); mhl = r1bindex (mhlproc, '/'); rewind (in); lseek (fileno(in), (off_t) 0, SEEK_SET); switch (pid = vfork()) { case NOTOK: adios ("fork", "unable to"); case OK: dup2 (fileno (in), fileno (stdin)); dup2 (fileno (out), fileno (stdout)); closefds (3); arglist[0] = mhl; arglist[1] = "-form"; arglist[2] = filter; arglist[3] = "-noclear"; switch (fmtproc) { case 1: arglist[4] = "-fmtproc"; arglist[5] = formatproc; arglist[6] = NULL; break; case 0: arglist[4] = "-nofmtproc"; arglist[5] = NULL; break; default: arglist[4] = NULL; } execvp (mhlproc, arglist); errstr = strerror(errno); write(2, "unable to exec ", 15); write(2, mhlproc, strlen(mhlproc)); write(2, ": ", 2); write(2, errstr, strlen(errstr)); write(2, "\n", 1); _exit (-1); default: if (pidXwait (pid, mhl)) done (1); fseek (out, 0L, SEEK_END); break; } } nmh-1.5/uip/rmf.c000644 007761 000765 00000012575 11765267273 013651 0ustar00kenhkenh000000 000000 /* * rmf.c -- remove a folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include static struct swit switches[] = { #define INTRSW 0 { "interactive", 0 }, #define NINTRSW 1 { "nointeractive", 0 }, #define VERSIONSW 2 { "version", 0 }, #define HELPSW 3 { "help", 0 }, { NULL, 0 } }; /* * static prototypes */ static int rmf(char *); static void rma (char *); int main (int argc, char **argv) { int defolder = 0, interactive = -1; char *cp, *folder = NULL, newfolder[BUFSIZ]; char buf[BUFSIZ], **argp, **arguments; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case INTRSW: interactive = 1; continue; case NINTRSW: interactive = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { adios (NULL, "usage: %s [+folder] [switches]", invo_name); } } if (!context_find ("path")) free (path ("./", TFOLDER)); if (!folder) { folder = getfolder (1); defolder++; } if (strcmp (m_mailpath (folder), pwd ()) == 0) adios (NULL, "sorry, you can't remove the current working directory"); if (interactive == -1) interactive = defolder; if (strchr (folder, '/') && (*folder != '/') && (*folder != '.')) { for (cp = copy (folder, newfolder); cp > newfolder && *cp != '/'; cp--) continue; if (cp > newfolder) *cp = '\0'; else strncpy (newfolder, getfolder(0), sizeof(newfolder)); } else { strncpy (newfolder, getfolder(0), sizeof(newfolder)); } if (interactive) { cp = concat ("Remove folder \"", folder, "\"? ", NULL); if (!getanswer (cp)) done (0); free (cp); } if (rmf (folder) == OK) { char *cfolder = context_find(pfolder); if (cfolder && strcmp (cfolder, newfolder)) { printf ("[+%s now current]\n", newfolder); context_replace (pfolder, newfolder); /* update current folder */ } } context_save (); /* save the context file */ done (0); return 1; } static int rmf (char *folder) { int i, j, others; register char *maildir; char cur[BUFSIZ]; register struct dirent *dp; register DIR *dd; switch (i = chdir (maildir = m_maildir (folder))) { case OK: if (access (".", W_OK) != NOTOK && access ("..", W_OK) != NOTOK) break; /* fall otherwise */ case NOTOK: snprintf (cur, sizeof(cur), "atr-%s-%s", current, m_mailpath (folder)); if (!context_del (cur)) { printf ("[+%s de-referenced]\n", folder); return OK; } advise (NULL, "you have no profile entry for the %s folder +%s", i == NOTOK ? "unreadable" : "read-only", folder); return NOTOK; } if ((dd = opendir (".")) == NULL) adios (NULL, "unable to read folder +%s", folder); others = 0; /* * Run the external delete hook program. */ (void)ext_hook("del-hook", maildir, (char *)0); j = strlen(BACKUP_PREFIX); while ((dp = readdir (dd))) { switch (dp->d_name[0]) { case '.': if (strcmp (dp->d_name, ".") == 0 || strcmp (dp->d_name, "..") == 0) continue; /* else fall */ case ',': break; default: if (m_atoi (dp->d_name)) break; if (strcmp (dp->d_name, LINK) == 0 || strncmp (dp->d_name, BACKUP_PREFIX, j) == 0) break; admonish (NULL, "file \"%s/%s\" not deleted", folder, dp->d_name); others++; continue; } if (unlink (dp->d_name) == NOTOK) { admonish (dp->d_name, "unable to unlink %s:", folder); others++; } } closedir (dd); /* * Remove any relevant private sequences * or attributes from context file. */ rma (folder); chdir (".."); if (others == 0 && remdir (maildir)) return OK; advise (NULL, "folder +%s not removed", folder); return NOTOK; } /* * Remove all the (private) sequence information for * this folder from the profile/context list. */ static void rma (char *folder) { register int alen, j, plen; register char *cp; register struct node *np, *pp; alen = strlen ("atr-"); plen = strlen (cp = m_mailpath (folder)) + 1; /* * Search context list for keys that look like * "atr-something-folderpath", and remove them. */ for (np = m_defs, pp = NULL; np; np = np->n_next) { if (ssequal ("atr-", np->n_name) && (j = strlen (np->n_name) - plen) > alen && *(np->n_name + j) == '-' && strcmp (cp, np->n_name + j + 1) == 0) { if (!np->n_context) admonish (NULL, "bug: context_del(key=\"%s\")", np->n_name); if (pp) { pp->n_next = np->n_next; np = pp; } else { m_defs = np->n_next; } ctxflags |= CTXMOD; } else { pp = np; } } } nmh-1.5/uip/rmm.c000644 007761 000765 00000006074 11765267273 013655 0ustar00kenhkenh000000 000000 /* * rmm.c -- remove a message(s) * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include static struct swit switches[] = { #define UNLINKSW 0 { "unlink", 0 }, #define NUNLINKSW 1 { "nounlink", 0 }, #define VERSIONSW 2 { "version", 0 }, #define HELPSW 3 { "help", 0 }, { NULL, 0 } }; int main (int argc, char **argv) { int msgnum, unlink_msgs = 0; char *cp, *maildir, *folder = NULL; char buf[BUFSIZ], **argp; char **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case UNLINKSW: unlink_msgs++; continue; case NUNLINKSW: unlink_msgs = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } if (!context_find ("path")) free (path ("./", TFOLDER)); if (!msgs.size) app_msgarg(&msgs, "cur"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ /* * This is hackish. If we are using a external rmmproc, * then we need to update the current folder in the * context so the external rmmproc will remove files * from the correct directory. This should be moved to * folder_delmsgs(). */ if (rmmproc) { context_replace (pfolder, folder); context_save (); fflush (stdout); } /* "remove" the SELECTED messages */ folder_delmsgs (mp, unlink_msgs, 0); seq_save (mp); /* synchronize message sequences */ context_replace (pfolder, folder); /* update current folder */ context_save (); /* save the context file */ folder_free (mp); /* free folder structure */ done (0); return 1; } nmh-1.5/uip/scan.c000644 007761 000765 00000015734 11765267273 014011 0ustar00kenhkenh000000 000000 /* * scan.c -- display a one-line "scan" listing of folder or messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include static struct swit switches[] = { #define CLRSW 0 { "clear", 0 }, #define NCLRSW 1 { "noclear", 0 }, #define FORMSW 2 { "form formatfile", 0 }, #define FMTSW 3 { "format string", 5 }, #define HEADSW 4 { "header", 0 }, #define NHEADSW 5 { "noheader", 0 }, #define WIDTHSW 6 { "width columns", 0 }, #define REVSW 7 { "reverse", 0 }, #define NREVSW 8 { "noreverse", 0 }, #define FILESW 9 { "file file", 4 }, #define VERSIONSW 10 { "version", 0 }, #define HELPSW 11 { "help", 0 }, { NULL, 0 } }; /* * global for sbr/formatsbr.c - yech! */ #ifdef LBL extern struct msgs *fmt_current_folder; #endif /* * prototypes */ void clear_screen(void); /* from termsbr.c */ int main (int argc, char **argv) { int clearflag = 0, hdrflag = 0, ontty; int width = 0, revflag = 0; int i, state, msgnum; int seqnum[NUMATTRS], unseen, num_unseen_seq = 0; char *cp, *maildir, *file = NULL, *folder = NULL; char *form = NULL, *format = NULL, buf[BUFSIZ]; char **argp, *nfs, **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; FILE *in; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case CLRSW: clearflag++; continue; case NCLRSW: clearflag = 0; continue; case FORMSW: if (!(form = *argp++) || *form == '-') adios (NULL, "missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') adios (NULL, "missing argument to %s", argp[-2]); form = NULL; continue; case HEADSW: hdrflag++; continue; case NHEADSW: hdrflag = 0; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); width = atoi (cp); continue; case REVSW: revflag++; continue; case NREVSW: revflag = 0; continue; case FILESW: if (!(cp = *argp++) || (cp[0] == '-' && cp[1])) adios (NULL, "missing argument to %s", argp[-2]); if (strcmp (file = cp, "-")) file = path (cp, TFILE); continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } if (!context_find ("path")) free (path ("./", TFOLDER)); /* * Get new format string. Must be before chdir(). */ nfs = new_fs (form, format, FORMAT); /* * We are scanning a maildrop file */ if (file) { if (msgs.size) adios (NULL, "\"msgs\" not allowed with -file"); if (folder) adios (NULL, "\"+folder\" not allowed with -file"); /* check if "file" is really stdin */ if (strcmp (file, "-") == 0) { in = stdin; file = "stdin"; } else { if ((in = fopen (file, "r")) == NULL) adios (file, "unable to open"); } #ifndef JLR if (hdrflag) { printf ("FOLDER %s\t%s\n", file, dtimenow (1)); } #endif /* JLR */ m_unknown (in); for (msgnum = 1; ; ++msgnum) { state = scan (in, msgnum, -1, nfs, width, 0, 0, hdrflag ? file : NULL, 0L, 1); if (state != SCNMSG && state != SCNENC) break; } fclose (in); done (0); } /* * We are scanning a folder */ if (!msgs.size) app_msgarg(&msgs, "all"); if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done(1); seq_setprev (mp); /* set the Previous-Sequence */ context_replace (pfolder, folder); /* update current folder */ seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ /* * Get the sequence number for each sequence * specified by Unseen-Sequence */ if ((cp = context_find (usequence)) && *cp) { char **ap, *dp; dp = getcpy(cp); ap = brkstring (dp, " ", "\n"); for (i = 0; ap && *ap; i++, ap++) seqnum[i] = seq_getnum (mp, *ap); num_unseen_seq = i; if (dp) free(dp); } ontty = isatty (fileno (stdout)); #ifdef LBL else fmt_current_folder = mp; #endif for (msgnum = revflag ? mp->hghsel : mp->lowsel; (revflag ? msgnum >= mp->lowsel : msgnum <= mp->hghsel); msgnum += (revflag ? -1 : 1)) { if (is_selected(mp, msgnum)) { if ((in = fopen (cp = m_name (msgnum), "r")) == NULL) { #if 0 if (errno != EACCES) #endif admonish (cp, "unable to open message"); #if 0 else printf ("%*d unreadable\n", DMAXFOLDER, msgnum); #endif continue; } #ifndef JLR if (hdrflag) { printf ("FOLDER %s\t%s\n", folder, dtimenow(1)); } #endif /* JLR */ /* * Check if message is in any sequence given * by Unseen-Sequence profile entry. */ unseen = 0; for (i = 0; i < num_unseen_seq; i++) { if (in_sequence(mp, seqnum[i], msgnum)) { unseen = 1; break; } } switch (state = scan (in, msgnum, 0, nfs, width, msgnum == mp->curmsg, unseen, folder, 0L, 1)) { case SCNMSG: case SCNENC: case SCNERR: break; default: adios (NULL, "scan() botch (%d)", state); case SCNEOF: #if 0 printf ("%*d empty\n", DMAXFOLDER, msgnum); #else advise (NULL, "message %d: empty", msgnum); #endif break; } hdrflag = 0; fclose (in); if (ontty) fflush (stdout); } } #ifdef LBL seq_save (mp); /* because formatsbr might have made changes */ #endif folder_free (mp); /* free folder/message structure */ if (clearflag) clear_screen (); done (0); return 1; } nmh-1.5/uip/scansbr.c000644 007761 000765 00000022447 11762736347 014517 0ustar00kenhkenh000000 000000 /* * scansbr.c -- routines to help scan along... * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #ifdef _FSTDIO # define _ptr _p /* Gag */ # define _cnt _w /* Wretch */ #endif #define MAXSCANL 256 /* longest possible scan line */ /* * Buffer size for content part of header fields. We want this * to be large enough so that we don't do a lot of extra FLDPLUS * calls on m_getfld but small enough so that we don't snarf * the entire message body when we're only going to display 30 * characters of it. */ #define SBUFSIZ 512 static struct format *fmt; #ifdef JLR static struct format *fmt_top; #endif /* JLR */ static struct comp *datecomp; /* pntr to "date" comp */ static struct comp *bodycomp; /* pntr to "body" pseudo-comp * * (if referenced) */ static int ncomps = 0; /* # of interesting components */ static char **compbuffers = 0; /* buffers for component text */ static struct comp **used_buf = 0; /* stack for comp that use buffers */ static int dat[5]; /* aux. data for format routine */ char *scanl = 0; /* text of most recent scanline */ #define DIEWRERR() adios (scnmsg, "write error on") #define FPUTS(buf) {\ if (mh_fputs(buf,scnout) == EOF)\ DIEWRERR();\ } /* * prototypes */ static int mh_fputs(char *, FILE *); #ifdef MULTIBYTE_SUPPORT #define SCAN_CHARWIDTH MB_CUR_MAX #else #define SCAN_CHARWIDTH 1 #endif int scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, int unseen, char *folder, long size, int noisy) { int i, compnum, encrypted, state; unsigned char *cp, *tmpbuf; char **nxtbuf; char *saved_c_text = NULL; struct comp *cptr; struct comp **savecomp; char *scnmsg = NULL; FILE *scnout = NULL; char name[NAMESZ]; static int rlwidth, slwidth; /* first-time only initialization */ if (!scanl) { if (width == 0) { if ((width = sc_width ()) < WIDTH/2) width = WIDTH/2; else if (width > MAXSCANL) width = MAXSCANL; } dat[3] = slwidth = width; scanl = (char *) mh_xmalloc((size_t) SCAN_CHARWIDTH * (slwidth + 2) ); if (outnum) umask(~m_gmprot()); /* Compile format string */ ncomps = fmt_compile (nfs, &fmt) + 1; #ifdef JLR fmt_top = fmt; #endif /* JLR */ FINDCOMP(bodycomp, "body"); FINDCOMP(datecomp, "date"); FINDCOMP(cptr, "folder"); if (cptr && folder) cptr->c_text = folder; FINDCOMP(cptr, "encrypted"); if (!cptr) if ((cptr = (struct comp *) calloc (1, sizeof(*cptr)))) { cptr->c_name = "encrypted"; cptr->c_next = wantcomp[i = CHASH (cptr->c_name)]; wantcomp[i] = cptr; ncomps++; } FINDCOMP (cptr, "dtimenow"); if (cptr) cptr->c_text = getcpy(dtimenow (0)); nxtbuf = compbuffers = (char **) calloc((size_t) ncomps, sizeof(char *)); if (nxtbuf == NULL) adios (NULL, "unable to allocate component buffers"); used_buf = (struct comp **) calloc((size_t) (ncomps+1), sizeof(struct comp *)); if (used_buf == NULL) adios (NULL, "unable to allocate component buffer stack"); used_buf += ncomps+1; *--used_buf = 0; rlwidth = bodycomp && (width > SBUFSIZ) ? width : SBUFSIZ; for (i = ncomps; i--; ) *nxtbuf++ = mh_xmalloc(rlwidth); } /* * each-message initialization */ nxtbuf = compbuffers; savecomp = used_buf; tmpbuf = *nxtbuf++; dat[0] = innum ? innum : outnum; dat[1] = curflg; dat[4] = unseen; /* * Get the first field. If the message is non-empty * and we're doing an "inc", open the output file. */ if ((state = m_getfld (FLD, name, tmpbuf, rlwidth, inb)) == FILEEOF) { if (ferror(inb)) { advise("read", "unable to"); /* "read error" */ return SCNFAT; } else { return SCNEOF; } } if (outnum) { if (outnum > 0) { scnmsg = m_name (outnum); if (*scnmsg == '?') /* msg num out of range */ return SCNNUM; } else { scnmsg = "/dev/null"; } if ((scnout = fopen (scnmsg, "w")) == NULL) adios (scnmsg, "unable to write"); } /* scan - main loop */ for (compnum = 1; ; state = m_getfld (state, name, tmpbuf, rlwidth, inb)) { switch (state) { case FLD: case FLDPLUS: compnum++; if (outnum) { FPUTS (name); if ( putc (':', scnout) == EOF) DIEWRERR(); FPUTS (tmpbuf); } /* * if we're interested in this component, save a pointer * to the component text, then start using our next free * buffer as the component temp buffer (buffer switching * saves an extra copy of the component text). */ if ((cptr = wantcomp[CHASH(name)])) { do { if (!mh_strcasecmp(name, cptr->c_name)) { if (! cptr->c_text) { cptr->c_text = tmpbuf; for (cp = tmpbuf + strlen (tmpbuf) - 1; cp >= tmpbuf; cp--) if (isspace (*cp)) *cp = 0; else break; *--savecomp = cptr; tmpbuf = *nxtbuf++; } break; } } while ((cptr = cptr->c_next)); } while (state == FLDPLUS) { state = m_getfld (state, name, tmpbuf, rlwidth, inb); if (outnum) FPUTS (tmpbuf); } break; case BODY: compnum = -1; /* * A slight hack ... if we have less than rlwidth characters * in the buffer, call m_getfld again. */ if ((i = strlen(tmpbuf)) < rlwidth) { state = m_getfld (state, name, tmpbuf + i, rlwidth - i, inb); } if (! outnum) { state = FILEEOF; /* stop now if scan cmd */ goto finished; } if (putc ('\n', scnout) == EOF) DIEWRERR(); FPUTS (tmpbuf); /* * performance hack: some people like to run "inc" on * things like net.sources or large digests. We do a * copy directly into the output buffer rather than * going through an intermediate buffer. * * We need the amount of data m_getfld found & don't * want to do a strlen on the long buffer so there's * a hack in m_getfld to save the amount of data it * returned in the global "msg_count". */ body:; while (state == BODY) { #ifdef LINUX_STDIO if (scnout->_IO_write_ptr == scnout->_IO_write_end) { #elif defined(__DragonFly__) if (((struct __FILE_public *)scnout)->_w <= 0) { #else if (scnout->_cnt <= 0) { #endif if (fflush(scnout) == EOF) DIEWRERR (); } #ifdef LINUX_STDIO state = m_getfld(state, name, scnout->_IO_write_ptr, (long)scnout->_IO_write_ptr-(long)scnout->_IO_write_end , inb); scnout->_IO_write_ptr += msg_count; #elif defined(__DragonFly__) state = m_getfld( state, name, ((struct __FILE_public *)scnout)->_p, -(((struct __FILE_public *)scnout)->_w), inb ); ((struct __FILE_public *)scnout)->_w -= msg_count; ((struct __FILE_public *)scnout)->_p += msg_count; #else state = m_getfld( state, name, scnout->_ptr, -(scnout->_cnt), inb ); scnout->_cnt -= msg_count; scnout->_ptr += msg_count; #endif } goto finished; case LENERR: case FMTERR: fprintf (stderr, innum ? "??Format error (message %d) in " : "??Format error in ", outnum ? outnum : innum); fprintf (stderr, "component %d\n", compnum); if (outnum) { FPUTS ("\n\nBAD MSG:\n"); FPUTS (name); if (putc ('\n', scnout) == EOF) DIEWRERR(); state = BODY; goto body; } /* fall through */ case FILEEOF: goto finished; default: adios (NULL, "getfld() returned %d", state); } } /* * format and output the scan line. */ finished: if (ferror(inb)) { advise("read", "unable to"); /* "read error" */ return SCNFAT; } /* Save and restore buffer so we don't trash our dynamic pool! */ if (bodycomp) { saved_c_text = bodycomp->c_text; bodycomp->c_text = tmpbuf; } if (size) dat[2] = size; else if (outnum > 0) { dat[2] = ftell(scnout); if (dat[2] == EOF) DIEWRERR(); } if ((datecomp && !datecomp->c_text) || (!size && !outnum)) { struct stat st; fstat (fileno(inb), &st); if (!size && !outnum) dat[2] = st.st_size; if (datecomp) { if (! datecomp->c_text) { if (datecomp->c_tws == NULL) datecomp->c_tws = (struct tws *) calloc((size_t) 1, sizeof(*datecomp->c_tws)); if (datecomp->c_tws == NULL) adios (NULL, "unable to allocate tws buffer"); *datecomp->c_tws = *dlocaltime ((time_t *) &st.st_mtime); datecomp->c_flags |= CF_DATEFAB|CF_TRUE; } else { datecomp->c_flags &= ~CF_DATEFAB; } } } fmt_scan (fmt, scanl, slwidth, dat); #if 0 fmt = fmt_scan (fmt, scanl, slwidth, dat); if (!fmt) fmt = fmt_top; /* reset for old format files */ #endif if (bodycomp) bodycomp->c_text = saved_c_text; if (noisy) fputs (scanl, stdout); FINDCOMP (cptr, "encrypted"); encrypted = cptr && cptr->c_text; /* return dynamically allocated buffers to pool */ while ((cptr = *savecomp++)) { *--nxtbuf = cptr->c_text; cptr->c_text = NULL; } *--nxtbuf = tmpbuf; if (outnum && (ferror(scnout) || fclose (scnout) == EOF)) DIEWRERR(); return (state != FILEEOF ? SCNERR : encrypted ? SCNENC : SCNMSG); } static int mh_fputs(char *s, FILE *stream) { char c; while ((c = *s++)) if (putc (c,stream) == EOF ) return(EOF); return (0); } nmh-1.5/uip/send.c000644 007761 000765 00000027052 11765267273 014012 0ustar00kenhkenh000000 000000 /* * send.c -- send a composed message * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #ifndef CYRUS_SASL # define SASLminc(a) (a) #else /* CYRUS_SASL */ # define SASLminc(a) 0 #endif /* CYRUS_SASL */ #ifndef TLS_SUPPORT # define TLSminc(a) (a) #else /* TLS_SUPPORT */ # define TLSminc(a) 0 #endif /* TLS_SUPPORT */ static struct swit switches[] = { #define ALIASW 0 { "alias aliasfile", 0 }, #define DEBUGSW 1 { "debug", -5 }, #define DRAFTSW 2 { "draft", 0 }, #define DFOLDSW 3 { "draftfolder +folder", 6 }, #define DMSGSW 4 { "draftmessage msg", 6 }, #define NDFLDSW 5 { "nodraftfolder", 0 }, #define FILTSW 6 { "filter filterfile", 0 }, #define NFILTSW 7 { "nofilter", 0 }, #define FRMTSW 8 { "format", 0 }, #define NFRMTSW 9 { "noformat", 0 }, #define FORWSW 10 { "forward", 0 }, #define NFORWSW 11 { "noforward", 0 }, #define MIMESW 12 { "mime", 0 }, #define NMIMESW 13 { "nomime", 0 }, #define MSGDSW 14 { "msgid", 0 }, #define NMSGDSW 15 { "nomsgid", 0 }, #define PUSHSW 16 { "push", 0 }, #define NPUSHSW 17 { "nopush", 0 }, #define SPLITSW 18 { "split seconds", 0 }, #define UNIQSW 19 { "unique", -6 }, #define NUNIQSW 20 { "nounique", -8 }, #define VERBSW 21 { "verbose", 0 }, #define NVERBSW 22 { "noverbose", 0 }, #define WATCSW 23 { "watch", 0 }, #define NWATCSW 24 { "nowatch", 0 }, #define WIDTHSW 25 { "width columns", 0 }, #define VERSIONSW 26 { "version", 0 }, #define HELPSW 27 { "help", 0 }, #define BITSTUFFSW 28 { "dashstuffing", -12 }, #define NBITSTUFFSW 29 { "nodashstuffing", -14 }, #define MAILSW 30 { "mail", -4 }, #define SAMLSW 31 { "saml", -4 }, #define SENDSW 32 { "send", -4 }, #define SOMLSW 33 { "soml", -4 }, #define CLIESW 34 { "client host", -6 }, #define SERVSW 35 { "server host", 6 }, #define SNOOPSW 36 { "snoop", 5 }, #define SASLSW 37 { "sasl", SASLminc(4) }, #define NOSASLSW 38 { "nosasl", SASLminc(-6) }, #define SASLMXSSFSW 39 { "saslmaxssf", SASLminc(-10) }, #define SASLMECHSW 40 { "saslmech mechanism", SASLminc(-5) }, #define USERSW 41 { "user username", SASLminc(-4) }, #define ATTACHSW 42 { "attach", 6 }, #define NOATTACHSW 43 { "noattach", 0 }, #define ATTACHFORMATSW 44 { "attachformat", 7 }, #define PORTSW 45 { "port server-port-name/number" , 4 }, #define TLSSW 46 { "tls", TLSminc(-3) }, #define NTLSSW 47 { "notls", TLSminc(-5) }, { NULL, 0 } }; static struct swit anyl[] = { #define NOSW 0 { "no", 0 }, #define YESW 1 { "yes", 0 }, #define LISTDSW 2 { "list", 0 }, { NULL, 0 } }; extern int debugsw; /* from sendsbr.c */ extern int forwsw; extern int inplace; extern int pushsw; extern int splitsw; extern int unique; extern int verbsw; extern char *altmsg; /* .. */ extern char *annotext; extern char *distfile; int main (int argc, char **argv) { int msgp = 0, distsw = 0, vecp = 1; int isdf = 0, mime = 0; int msgnum, status; char *cp, *dfolder = NULL, *maildir = NULL; char buf[BUFSIZ], **ap, **argp, **arguments; char *msgs[MAXARGS], *vec[MAXARGS]; struct msgs *mp; struct stat st; char *attach = NMH_ATTACH_HEADER; /* header field name for attachments */ int attachformat = 1; /* mhbuild format specifier for attachments */ #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; vec[vecp++] = "-library"; vec[vecp++] = getcpy (m_maildir ("")); if ((cp = context_find ("fileproc"))) { vec[vecp++] = "-fileproc"; vec[vecp++] = cp; } if ((cp = context_find ("mhlproc"))) { vec[vecp++] = "-mhlproc"; vec[vecp++] = cp; } while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [file] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case DRAFTSW: msgs[msgp++] = draft; continue; case DFOLDSW: if (dfolder) adios (NULL, "only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); msgs[msgp++] = cp; continue; case NDFLDSW: dfolder = NULL; isdf = NOTOK; continue; case PUSHSW: pushsw++; continue; case NPUSHSW: pushsw = 0; continue; case SPLITSW: if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1) adios (NULL, "missing argument to %s", argp[-2]); continue; case UNIQSW: unique++; continue; case NUNIQSW: unique = 0; continue; case FORWSW: forwsw++; continue; case NFORWSW: forwsw = 0; continue; case VERBSW: verbsw++; vec[vecp++] = --cp; continue; case NVERBSW: verbsw = 0; vec[vecp++] = --cp; continue; case MIMESW: mime++; vec[vecp++] = --cp; continue; case NMIMESW: mime = 0; vec[vecp++] = --cp; continue; case DEBUGSW: debugsw++; /* fall */ case NFILTSW: case FRMTSW: case NFRMTSW: case BITSTUFFSW: case NBITSTUFFSW: case MSGDSW: case NMSGDSW: case WATCSW: case NWATCSW: case MAILSW: case SAMLSW: case SENDSW: case SOMLSW: case SNOOPSW: case SASLSW: case NOSASLSW: case TLSSW: case NTLSSW: vec[vecp++] = --cp; continue; case ALIASW: case FILTSW: case WIDTHSW: case CLIESW: case SERVSW: case SASLMECHSW: case SASLMXSSFSW: case USERSW: case PORTSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); vec[vecp++] = cp; continue; case ATTACHSW: if (!(attach = *argp++) || *attach == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NOATTACHSW: attach = NULL; continue; case ATTACHFORMATSW: if (! *argp || **argp == '-') adios (NULL, "missing argument to %s", argp[-1]); else { attachformat = atoi (*argp); if (attachformat < 0 || attachformat > ATTACHFORMATS - 1) { advise (NULL, "unsupported attachformat %d", attachformat); continue; } } ++argp; continue; } } else { msgs[msgp++] = cp; } } /* * check for "Aliasfile:" profile entry */ if ((cp = context_find ("Aliasfile"))) { char *dp = NULL; for (ap = brkstring(dp = getcpy(cp), " ", "\n"); ap && *ap; ap++) { vec[vecp++] = "-alias"; vec[vecp++] = *ap; } } if (dfolder == NULL) { if (msgp == 0) { #ifdef WHATNOW if ((cp = getenv ("mhdraft")) && *cp) { msgs[msgp++] = cp; goto go_to_it; } #endif /* WHATNOW */ msgs[msgp++] = getcpy (m_draft (NULL, NULL, 1, &isdf)); if (stat (msgs[0], &st) == NOTOK) adios (msgs[0], "unable to stat draft file"); cp = concat ("Use \"", msgs[0], "\"? ", NULL); for (status = LISTDSW; status != YESW;) { if (!(argp = getans (cp, anyl))) done (1); switch (status = smatch (*argp, anyl)) { case NOSW: done (0); case YESW: break; case LISTDSW: showfile (++argp, msgs[0]); break; default: advise (NULL, "say what?"); break; } } } else { for (msgnum = 0; msgnum < msgp; msgnum++) msgs[msgnum] = getcpy (m_maildir (msgs[msgnum])); } } else { if (!context_find ("path")) free (path ("./", TFOLDER)); if (!msgp) msgs[msgp++] = "cur"; maildir = m_maildir (dfolder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (dfolder))) adios (NULL, "unable to read folder %s", dfolder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", dfolder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous-sequence */ for (msgp = 0, msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) { msgs[msgp++] = getcpy (m_name (msgnum)); unset_exists (mp, msgnum); } } mp->msgflags |= SEQMOD; seq_save (mp); } #ifdef WHATNOW go_to_it: #endif /* WHATNOW */ if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0) if ((cp = context_find ("signature")) && *cp) m_putenv ("SIGNATURE", cp); for (msgnum = 0; msgnum < msgp; msgnum++) if (stat (msgs[msgnum], &st) == NOTOK) adios (msgs[msgnum], "unable to stat draft file"); if ((annotext = getenv ("mhannotate")) == NULL || *annotext == 0) annotext = NULL; if (annotext && ((cp = getenv ("mhinplace")) != NULL && *cp != 0)) inplace = atoi (cp); if ((altmsg = getenv ("mhaltmsg")) == NULL || *altmsg == 0) altmsg = NULL; /* used by dist interface - see below */ if ((cp = getenv ("mhdist")) && *cp && (distsw = atoi (cp)) && altmsg) { vec[vecp++] = "-dist"; distfile = getcpy (m_mktemp2 (altmsg, invo_name, NULL, NULL)); unlink(distfile); if (link (altmsg, distfile) == NOTOK) { if (errno != EXDEV #ifdef EISREMOTE && errno != EISREMOTE #endif /* EISREMOTE */ ) adios (distfile, "unable to link %s to", altmsg); free (distfile); distfile = getcpy (m_mktemp2(NULL, invo_name, NULL, NULL)); { int in, out; struct stat st; if ((in = open (altmsg, O_RDONLY)) == NOTOK) adios (altmsg, "unable to open"); fstat(in, &st); if ((out = creat (distfile, (int) st.st_mode & 0777)) == NOTOK) adios (distfile, "unable to write"); cpydata (in, out, altmsg, distfile); close (in); close (out); } } } else { distfile = NULL; } if (altmsg == NULL || stat (altmsg, &st) == NOTOK) { st.st_mtime = 0; st.st_dev = 0; st.st_ino = 0; } if (pushsw) push (); status = 0; vec[0] = r1bindex (postproc, '/'); closefds (3); for (msgnum = 0; msgnum < msgp; msgnum++) { switch (sendsbr (vec, vecp, msgs[msgnum], &st, 1, attach, attachformat)) { case DONE: done (++status); case NOTOK: status++; /* fall */ case OK: break; } } context_save (); /* save the context file */ done (status); return 1; } nmh-1.5/uip/sendsbr.c000644 007761 000765 00000070471 11762736347 014524 0ustar00kenhkenh000000 000000 /* * sendsbr.c -- routines to help WhatNow/Send along * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_TIME_H # include #endif #include int debugsw = 0; /* global */ int forwsw = 1; int inplace = 1; int pushsw = 0; int splitsw = -1; int unique = 0; int verbsw = 0; char *altmsg = NULL; /* .. */ char *annotext = NULL; char *distfile = NULL; static jmp_buf env; static char body_file_name[MAXPATHLEN + 1]; /* name of temporary file for body content */ static char composition_file_name[MAXPATHLEN + 1]; /* name of mhbuild composition temporary file */ static int field_size; /* size of header field buffer */ static char *field; /* header field buffer */ static FILE *draft_file; /* draft file pointer */ static FILE *body_file; /* body file pointer */ static FILE *composition_file; /* composition file pointer */ /* * external prototypes */ int sendsbr (char **, int, char *, struct stat *, int, char *, int); char *getusername (void); /* * static prototypes */ static void armed_done (int) NORETURN; static void alert (char *, int); static int tmp_fd (void); static void anno (int, struct stat *); static void annoaux (int); static int splitmsg (char **, int, char *, struct stat *, int); static int sendaux (char **, int, char *, struct stat *); static int attach(char *, char *, int); static void clean_up_temporary_files(void); static int get_line(void); static void make_mime_composition_file_entry(char *, int); /* * Entry point into (back-end) routines to send message. */ int sendsbr (char **vec, int vecp, char *drft, struct stat *st, int rename_drft, char *attachment_header_field_name, int attachformat) { int status; char buffer[BUFSIZ], file[BUFSIZ]; struct stat sts; char *original_draft; /* name of original draft file */ char *p; /* string pointer for building file name */ /* * Save the original name of the draft file. The name of the draft file is changed * to a temporary file containing the built MIME message if there are attachments. * We need the original name so that it can be renamed after the message is sent. */ original_draft = drft; /* * There might be attachments if a header field name for attachments is supplied. * Convert the draft to a MIME message. Use the mhbuild composition file for the * draft if there was a successful conversion because that now contains the MIME * message. A nice side effect of this is that it leaves the original draft file * untouched so that it can be retrieved and modified if desired. */ if (attachment_header_field_name != (char *)0) { switch (attach(attachment_header_field_name, drft, attachformat)) { case OK: drft = composition_file_name; break; case NOTOK: return (NOTOK); case DONE: break; } } done=armed_done; switch (setjmp (env)) { case OK: /* * If given -push and -unique (which is undocumented), then * rename the draft file. I'm not quite sure why. */ if (pushsw && unique) { char *cp = m_mktemp2(drft, invo_name, NULL, NULL); if (cp == NULL) { adios ("sendsbr", "unable to create temporary file"); } if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK) adios (file, "unable to rename %s to", drft); drft = file; } /* * Check if we need to split the message into * multiple messages of type "message/partial". */ if (splitsw >= 0 && !distfile && stat (drft, &sts) != NOTOK && sts.st_size >= CPERMSG) { status = splitmsg (vec, vecp, drft, st, splitsw) ? NOTOK : OK; } else { status = sendaux (vec, vecp, drft, st) ? NOTOK : OK; } /* rename the original draft */ if (rename_drft && status == OK && rename (original_draft, strncpy (buffer, m_backup (original_draft), sizeof(buffer))) == NOTOK) advise (buffer, "unable to rename %s to", drft); break; default: status = DONE; break; } done=exit; if (distfile) unlink (distfile); /* * Get rid of any temporary files that we created for attachments. Also get rid of * the renamed composition file that mhbuild leaves as a turd. It looks confusing, * but we use the body file name to help build the renamed composition file name. */ if (drft == composition_file_name) { clean_up_temporary_files(); if (strlen(composition_file_name) >= sizeof (composition_file_name) - 6) advise((char *)0, "unable to remove original composition file."); else { if ((p = strrchr(composition_file_name, '/')) == (char *)0) p = composition_file_name; else p++; (void)strcpy(body_file_name, p); *p++ = ','; (void)strcpy(p, body_file_name); (void)strcat(p, ".orig"); (void)unlink(composition_file_name); } } return status; } static int attach(char *attachment_header_field_name, char *draft_file_name, int attachformat) { char buf[MAXPATHLEN + 6]; /* miscellaneous buffer */ int c; /* current character for body copy */ int has_attachment; /* draft has at least one attachment */ int has_body; /* draft has a message body */ int length; /* length of attachment header field name */ char *p; /* miscellaneous string pointer */ FILE *fp; /* pointer for mhn.defaults */ /* * Open up the draft file. */ if ((draft_file = fopen(draft_file_name, "r")) == (FILE *)0) adios((char *)0, "can't open draft file `%s'.", draft_file_name); /* * Allocate a buffer to hold the header components as they're read in. * This buffer might need to be quite large, so we grow it as needed. */ field = (char *)mh_xmalloc(field_size = 256); /* * Scan the draft file for a header field name that matches the -attach * argument. The existence of one indicates that the draft has attachments. * Bail out if there are no attachments because we're done. Read to the * end of the headers even if we have no attachments. */ length = strlen(attachment_header_field_name); has_attachment = 0; while (get_line() != EOF && *field != '\0' && *field != '-') if (strncasecmp(field, attachment_header_field_name, length) == 0 && field[length] == ':') has_attachment = 1; if (has_attachment == 0) return (DONE); /* * We have at least one attachment. Look for at least one non-blank line * in the body of the message which indicates content in the body. */ has_body = 0; while (get_line() != EOF) { for (p = field; *p != '\0'; p++) { if (*p != ' ' && *p != '\t') { has_body = 1; break; } } if (has_body) break; } /* * Make names for the temporary files. */ (void)strncpy(body_file_name, m_mktemp(m_maildir(invo_name), NULL, NULL), sizeof (body_file_name)); (void)strncpy(composition_file_name, m_mktemp(m_maildir(invo_name), NULL, NULL), sizeof (composition_file_name)); if (has_body) body_file = fopen(body_file_name, "w"); composition_file = fopen(composition_file_name, "w"); if ((has_body && body_file == (FILE *)0) || composition_file == (FILE *)0) { clean_up_temporary_files(); adios((char *)0, "unable to open all of the temporary files."); } /* * Start at the beginning of the draft file. Copy all non-attachment header fields * to the temporary composition file. Then add the dashed line separator. */ rewind(draft_file); while (get_line() != EOF && *field != '\0' && *field != '-') if (strncasecmp(field, attachment_header_field_name, length) != 0 || field[length] != ':') (void)fprintf(composition_file, "%s\n", field); (void)fputs("--------\n", composition_file); /* * Copy the message body to a temporary file. */ if (has_body) { while ((c = getc(draft_file)) != EOF) putc(c, body_file); (void)fclose(body_file); } /* * Add a mhbuild MIME composition file line for the body if there was one. */ if (has_body) make_mime_composition_file_entry(body_file_name, attachformat); /* * Now, go back to the beginning of the draft file and look for header fields * that specify attachments. Add a mhbuild MIME composition file for each. */ if ((fp = fopen (p = etcpath ("mhn.defaults"), "r"))) { readconfig ((struct node **) NULL, fp, p, 0); fclose(fp); } rewind(draft_file); while (get_line() != EOF && *field != '\0' && *field != '-') { if (strncasecmp(field, attachment_header_field_name, length) == 0 && field[length] == ':') { for (p = field + length + 1; *p == ' ' || *p == '\t'; p++) ; make_mime_composition_file_entry(p, attachformat); } } (void)fclose(composition_file); /* * We're ready to roll! Run mhbuild on the composition file. Note that mhbuild * is in the context as buildmimeproc. */ (void)sprintf(buf, "%s %s", buildmimeproc, composition_file_name); if (system(buf) != 0) { clean_up_temporary_files(); return (NOTOK); } return (OK); } static void clean_up_temporary_files(void) { (void)unlink(body_file_name); (void)unlink(composition_file_name); return; } static int get_line(void) { int c; /* current character */ int n; /* number of bytes in buffer */ char *p; /* buffer pointer */ /* * Get a line from the input file, growing the field buffer as needed. We do this * so that we can fit an entire line in the buffer making it easy to do a string * comparison on both the field name and the field body which might be a long path * name. */ for (n = 0, p = field; (c = getc(draft_file)) != EOF; *p++ = c) { if (c == '\n' && (c = getc(draft_file)) != ' ' && c != '\t') { (void)ungetc(c, draft_file); c = '\n'; break; } if (++n >= field_size - 1) { field = (char *)mh_xrealloc((void *)field, field_size += 256); p = field + n - 1; } } /* * NUL-terminate the field.. */ *p = '\0'; return (c); } static void make_mime_composition_file_entry(char *file_name, int attachformat) { int binary; /* binary character found flag */ int c; /* current character */ char cmd[MAXPATHLEN + 6]; /* file command buffer */ char *content_type; /* mime content type */ FILE *fp; /* content and pipe file pointer */ struct node *np; /* context scan node pointer */ char *p; /* miscellaneous string pointer */ struct stat st; /* file status buffer */ content_type = (char *)0; /* * Check the file name for a suffix. Scan the context for that suffix on a * mhshow-suffix- entry. We use these entries to be compatible with mhnshow, * and there's no reason to make the user specify each suffix twice. Context * entries of the form "mhshow-suffix-contenttype" in the name have the suffix * in the field, including the dot. */ if ((p = strrchr(file_name, '.')) != (char *)0) { for (np = m_defs; np; np = np->n_next) { if (strncasecmp(np->n_name, "mhshow-suffix-", 14) == 0 && mh_strcasecmp(p, np->n_field) == 0) { content_type = np->n_name + 14; break; } } } /* * No content type was found, either because there was no matching entry in the * context or because the file name has no suffix. Open the file and check for * non-ASCII characters. Choose the content type based on this check. */ if (content_type == (char *)0) { if ((fp = fopen(file_name, "r")) == (FILE *)0) { clean_up_temporary_files(); adios((char *)0, "unable to access file \"%s\"", file_name); } binary = 0; while ((c = getc(fp)) != EOF) { if (c > 127 || c < 0) { binary = 1; break; } } (void)fclose(fp); content_type = binary ? "application/octet-stream" : "text/plain"; } /* * Make sure that the attachment file exists and is readable. Append a mhbuild * directive to the draft file. This starts with the content type. Append a * file name attribute and a private x-unix-mode attribute. Also append a * description obtained (if possible) by running the "file" command on the file. */ if (stat(file_name, &st) == -1 || access(file_name, R_OK) != 0) { clean_up_temporary_files(); adios((char *)0, "unable to access file \"%s\"", file_name); } switch (attachformat) { case 0: /* Insert name, file mode, and Content-Id. */ (void)fprintf(composition_file, "#%s; name=\"%s\"; x-unix-mode=0%.3ho", content_type, ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1, (unsigned short)(st.st_mode & 0777)); if (strlen(file_name) > MAXPATHLEN) { clean_up_temporary_files(); adios((char *)0, "attachment file name `%s' too long.", file_name); } (void)sprintf(cmd, "file '%s'", file_name); if ((fp = popen(cmd, "r")) != (FILE *)0 && fgets(cmd, sizeof (cmd), fp) != (char *)0) { *strchr(cmd, '\n') = '\0'; /* * The output of the "file" command is of the form * * file: description * * Strip off the "file:" and subsequent white space. */ for (p = cmd; *p != '\0'; p++) { if (*p == ':') { for (p++; *p != '\0'; p++) { if (*p != '\t') break; } break; } } if (*p != '\0') /* Insert Content-Description. */ (void)fprintf(composition_file, " [ %s ]", p); (void)pclose(fp); } break; case 1: if (stringdex (m_maildir(invo_name), file_name) == 0) { /* Content had been placed by send into a temp file. Don't generate Content-Disposition header, because it confuses Microsoft Outlook, Build 10.0.6626, at least. */ (void) fprintf (composition_file, "#%s <>", content_type); } else { /* Suppress Content-Id, insert simple Content-Disposition and Content-Description with filename. */ p = strrchr(file_name, '/'); (void) fprintf (composition_file, "#%s; name=\"%s\" <> [%s]{attachment}", content_type, (p == (char *)0) ? file_name : p + 1, (p == (char *)0) ? file_name : p + 1); } break; case 2: if (stringdex (m_maildir(invo_name), file_name) == 0) { /* Content had been placed by send into a temp file. Don't generate Content-Disposition header, because it confuses Microsoft Outlook, Build 10.0.6626, at least. */ (void) fprintf (composition_file, "#%s <>", content_type); } else { /* Suppress Content-Id, insert Content-Disposition with modification date and Content-Description wtih filename. */ p = strrchr(file_name, '/'); (void) fprintf (composition_file, "#%s; name=\"%s\" <>[%s]{attachment; modification-date=\"%s\"}", content_type, (p == (char *)0) ? file_name : p + 1, (p == (char *)0) ? file_name : p + 1, dtime (&st.st_mtime, 0)); } break; default: adios ((char *)0, "unsupported attachformat %d", attachformat); } /* * Finish up with the file name. */ (void)fprintf(composition_file, " %s\n", file_name); return; } /* * Split large message into several messages of * type "message/partial" and send them. */ static int splitmsg (char **vec, int vecp, char *drft, struct stat *st, int delay) { int compnum, nparts, partno, state, status; long pos, start; time_t clock; char *cp, *dp, buffer[BUFSIZ], msgid[BUFSIZ]; char subject[BUFSIZ]; char name[NAMESZ], partnum[BUFSIZ]; FILE *in; if ((in = fopen (drft, "r")) == NULL) adios (drft, "unable to open for reading"); cp = dp = NULL; start = 0L; /* * Scan through the message and examine the various header fields, * as well as locate the beginning of the message body. */ for (compnum = 1, state = FLD;;) { switch (state = m_getfld (state, name, buffer, sizeof(buffer), in)) { case FLD: case FLDPLUS: case FLDEOF: compnum++; /* * This header field is discarded. */ if (!mh_strcasecmp (name, "Message-ID")) { while (state == FLDPLUS) state = m_getfld (state, name, buffer, sizeof(buffer), in); } else if (uprf (name, XXX_FIELD_PRF) || !mh_strcasecmp (name, VRSN_FIELD) || !mh_strcasecmp (name, "Subject") || !mh_strcasecmp (name, "Encrypted")) { /* * These header fields are copied to the enclosed * header of the first message in the collection * of message/partials. For the "Subject" header * field, we also record it, so that a modified * version of it, can be copied to the header * of each messsage/partial in the collection. */ if (!mh_strcasecmp (name, "Subject")) { size_t sublen; strncpy (subject, buffer, BUFSIZ); sublen = strlen (subject); if (sublen > 0 && subject[sublen - 1] == '\n') subject[sublen - 1] = '\0'; } dp = add (concat (name, ":", buffer, NULL), dp); while (state == FLDPLUS) { state = m_getfld (state, name, buffer, sizeof(buffer), in); dp = add (buffer, dp); } } else { /* * These header fields are copied to the header of * each message/partial in the collection. */ cp = add (concat (name, ":", buffer, NULL), cp); while (state == FLDPLUS) { state = m_getfld (state, name, buffer, sizeof(buffer), in); cp = add (buffer, cp); } } if (state != FLDEOF) { start = ftell (in) + 1; continue; } /* else fall... */ case BODY: case BODYEOF: case FILEEOF: break; case LENERR: case FMTERR: adios (NULL, "message format error in component #%d", compnum); default: adios (NULL, "getfld () returned %d", state); } break; } if (cp == NULL) adios (NULL, "headers missing from draft"); nparts = 1; pos = start; while (fgets (buffer, sizeof(buffer) - 1, in)) { long len; if ((pos += (len = strlen (buffer))) > CPERMSG) { nparts++; pos = len; } } /* Only one part, nothing to split */ if (nparts == 1) { free (cp); if (dp) free (dp); fclose (in); return sendaux (vec, vecp, drft, st); } if (!pushsw) { printf ("Sending as %d Partial Messages\n", nparts); fflush (stdout); } status = OK; vec[vecp++] = "-partno"; vec[vecp++] = partnum; if (delay == 0) vec[vecp++] = "-queued"; time (&clock); snprintf (msgid, sizeof(msgid), "<%d.%ld@%s>", (int) getpid(), (long) clock, LocalName(1)); fseek (in, start, SEEK_SET); for (partno = 1; partno <= nparts; partno++) { char tmpdrf[BUFSIZ]; FILE *out; char *cp = m_mktemp2(drft, invo_name, NULL, &out); if (cp == NULL) { adios (drft, "unable to create temporary file for"); } strncpy(tmpdrf, cp, sizeof(tmpdrf)); chmod (tmpdrf, 0600); /* * Output the header fields */ fputs (cp, out); fprintf (out, "Subject: %s (part %d of %d)\n", subject, partno, nparts); fprintf (out, "%s: %s\n", VRSN_FIELD, VRSN_VALUE); fprintf (out, "%s: message/partial; id=\"%s\";\n", TYPE_FIELD, msgid); fprintf (out, "\tnumber=%d; total=%d\n", partno, nparts); fprintf (out, "%s: part %d of %d\n\n", DESCR_FIELD, partno, nparts); /* * If this is the first in the collection, output the * header fields we are encapsulating at the beginning * of the body of the first message. */ if (partno == 1) { if (dp) fputs (dp, out); fprintf (out, "Message-ID: %s\n", msgid); fprintf (out, "\n"); } pos = 0; for (;;) { long len; if (!fgets (buffer, sizeof(buffer) - 1, in)) { if (partno == nparts) break; adios (NULL, "premature eof"); } if ((pos += (len = strlen (buffer))) > CPERMSG) { fseek (in, -len, SEEK_CUR); break; } fputs (buffer, out); } if (fflush (out)) adios (tmpdrf, "error writing to"); fclose (out); if (!pushsw && verbsw) { printf ("\n"); fflush (stdout); } /* Pause here, if a delay is specified */ if (delay > 0 && 1 < partno && partno <= nparts) { if (!pushsw) { printf ("pausing %d seconds before sending part %d...\n", delay, partno); fflush (stdout); } sleep ((unsigned int) delay); } snprintf (partnum, sizeof(partnum), "%d", partno); status = sendaux (vec, vecp, tmpdrf, st); unlink (tmpdrf); if (status != OK) break; /* * This is so sendaux will only annotate * the altmsg the first time it is called. */ annotext = NULL; } free (cp); if (dp) free (dp); fclose (in); /* close the draft */ return status; } /* * Annotate original message, and * call `postproc' to send message. */ static int sendaux (char **vec, int vecp, char *drft, struct stat *st) { pid_t child_id; int i, status, fd, fd2; char backup[BUFSIZ], buf[BUFSIZ]; fd = pushsw ? tmp_fd () : NOTOK; fd2 = NOTOK; vec[vecp++] = drft; if (annotext) { if ((fd2 = tmp_fd ()) != NOTOK) { vec[vecp++] = "-idanno"; snprintf (buf, sizeof(buf), "%d", fd2); vec[vecp++] = buf; } else { admonish (NULL, "unable to create file for annotation list"); } } if (distfile && distout (drft, distfile, backup) == NOTOK) done (1); vec[vecp] = NULL; for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case -1: /* oops -- fork error */ adios ("fork", "unable to"); break; /* NOT REACHED */ case 0: /* * child process -- send it * * If fd is ok, then we are pushing and fd points to temp * file, so capture anything on stdout and stderr there. */ if (fd != NOTOK) { dup2 (fd, fileno (stdout)); dup2 (fd, fileno (stderr)); close (fd); } execvp (postproc, vec); fprintf (stderr, "unable to exec "); perror (postproc); _exit (-1); break; /* NOT REACHED */ default: /* * parent process -- wait for it */ if ((status = pidwait(child_id, NOTOK)) == OK) { if (annotext && fd2 != NOTOK) anno (fd2, st); } else { /* * If postproc failed, and we have good fd (which means * we pushed), then mail error message (and possibly the * draft) back to the user. */ if (fd != NOTOK) { alert (drft, fd); close (fd); } else { advise (NULL, "message not delivered to anyone"); } if (annotext && fd2 != NOTOK) close (fd2); if (distfile) { unlink (drft); if (rename (backup, drft) == NOTOK) advise (drft, "unable to rename %s to", backup); } } break; } return status; } /* * Mail error notification (and possibly a copy of the * message) back to the user, using the mailproc */ static void alert (char *file, int out) { pid_t child_id; int i, in; char buf[BUFSIZ]; for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: /* oops -- fork error */ advise ("fork", "unable to"); case OK: /* child process -- send it */ SIGNAL (SIGHUP, SIG_IGN); SIGNAL (SIGINT, SIG_IGN); SIGNAL (SIGQUIT, SIG_IGN); SIGNAL (SIGTERM, SIG_IGN); if (forwsw) { if ((in = open (file, O_RDONLY)) == NOTOK) { admonish (file, "unable to re-open"); } else { lseek (out, (off_t) 0, SEEK_END); strncpy (buf, "\nMessage not delivered to anyone.\n", sizeof(buf)); write (out, buf, strlen (buf)); strncpy (buf, "\n------- Unsent Draft\n\n", sizeof(buf)); write (out, buf, strlen (buf)); cpydgst (in, out, file, "temporary file"); close (in); strncpy (buf, "\n------- End of Unsent Draft\n", sizeof(buf)); write (out, buf, strlen (buf)); if (rename (file, strncpy (buf, m_backup (file), sizeof(buf))) == NOTOK) admonish (buf, "unable to rename %s to", file); } } lseek (out, (off_t) 0, SEEK_SET); dup2 (out, fileno (stdin)); close (out); /* create subject for error notification */ snprintf (buf, sizeof(buf), "send failed on %s", forwsw ? "enclosed draft" : file); execlp (mailproc, r1bindex (mailproc, '/'), getusername (), "-subject", buf, NULL); fprintf (stderr, "unable to exec "); perror (mailproc); _exit (-1); default: /* no waiting... */ break; } } static int tmp_fd (void) { int fd; char *tfile = NULL; tfile = m_mktemp2(NULL, invo_name, &fd, NULL); if (tfile == NULL) return NOTOK; fchmod(fd, 0600); if (debugsw) advise (NULL, "temporary file %s selected", tfile); else if (unlink (tfile) == NOTOK) advise (tfile, "unable to remove"); return fd; } static void anno (int fd, struct stat *st) { pid_t child_id; sigset_t set, oset; static char *cwd = NULL; struct stat st2; if (altmsg && (stat (altmsg, &st2) == NOTOK || st->st_mtime != st2.st_mtime || st->st_dev != st2.st_dev || st->st_ino != st2.st_ino)) { if (debugsw) admonish (NULL, "$mhaltmsg mismatch"); return; } child_id = debugsw ? NOTOK : fork (); switch (child_id) { case NOTOK: /* oops */ if (!debugsw) advise (NULL, "unable to fork, so doing annotations by hand..."); if (cwd == NULL) cwd = getcpy (pwd ()); case OK: /* block a few signals */ sigemptyset (&set); sigaddset (&set, SIGHUP); sigaddset (&set, SIGINT); sigaddset (&set, SIGQUIT); sigaddset (&set, SIGTERM); sigprocmask (SIG_BLOCK, &set, &oset); annoaux (fd); if (child_id == OK) _exit (0); /* reset the signal mask */ sigprocmask (SIG_SETMASK, &oset, &set); chdir (cwd); break; default: /* no waiting... */ close (fd); break; } } static void annoaux (int fd) { int fd2, fd3, msgnum; char *cp, *folder, *maildir; char buffer[BUFSIZ], **ap; FILE *fp; struct msgs *mp; if ((folder = getenv ("mhfolder")) == NULL || *folder == 0) { if (debugsw) admonish (NULL, "$mhfolder not set"); return; } maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) { if (debugsw) admonish (maildir, "unable to change directory to"); return; } if (!(mp = folder_read (folder))) { if (debugsw) admonish (NULL, "unable to read folder %s", folder); return; } /* check for empty folder */ if (mp->nummsg == 0) { if (debugsw) admonish (NULL, "no messages in %s", folder); goto oops; } if ((cp = getenv ("mhmessages")) == NULL || *cp == 0) { if (debugsw) admonish (NULL, "$mhmessages not set"); goto oops; } if (!debugsw /* MOBY HACK... */ && pushsw && (fd3 = open ("/dev/null", O_RDWR)) != NOTOK && (fd2 = dup (fileno (stderr))) != NOTOK) { dup2 (fd3, fileno (stderr)); close (fd3); } else fd2 = NOTOK; for (ap = brkstring (cp = getcpy (cp), " ", NULL); *ap; ap++) m_convert (mp, *ap); free (cp); if (fd2 != NOTOK) dup2 (fd2, fileno (stderr)); if (mp->numsel == 0) { if (debugsw) admonish (NULL, "no messages to annotate"); goto oops; } lseek (fd, (off_t) 0, SEEK_SET); if ((fp = fdopen (fd, "r")) == NULL) { if (debugsw) admonish (NULL, "unable to fdopen annotation list"); goto oops; } cp = NULL; while (fgets (buffer, sizeof(buffer), fp) != NULL) cp = add (buffer, cp); fclose (fp); if (debugsw) advise (NULL, "annotate%s with %s: \"%s\"", inplace ? " inplace" : "", annotext, cp); for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { if (debugsw) advise (NULL, "annotate message %d", msgnum); annotate (m_name (msgnum), annotext, cp, inplace, 1, -2, 0); } } free (cp); oops: folder_free (mp); /* free folder/message structure */ } static void armed_done (int status) { longjmp (env, status ? status : NOTOK); exit (status); } nmh-1.5/uip/show.c000644 007761 000765 00000030003 11765267273 014027 0ustar00kenhkenh000000 000000 /* * show.c -- show/list messages * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include static struct swit switches[] = { #define CHECKMIMESW 0 { "checkmime", 0 }, #define NOCHECKMIMESW 1 { "nocheckmime", 0 }, #define HEADSW 2 { "header", 0 }, #define NHEADSW 3 { "noheader", 0 }, #define FORMSW 4 { "form formfile", 0 }, #define PROGSW 5 { "moreproc program", 0 }, #define NPROGSW 6 { "nomoreproc", 0 }, #define LENSW 7 { "length lines", 0 }, #define WIDTHSW 8 { "width columns", 0 }, #define SHOWSW 9 { "showproc program", 0 }, #define SHOWMIMESW 10 { "showmimeproc program", 0 }, #define NSHOWSW 11 { "noshowproc", 0 }, #define DRFTSW 12 { "draft", 0 }, #define FILESW 13 { "file file", -4 }, /* interface from showfile */ #define FMTPROCSW 14 { "fmtproc program", 0 }, #define NFMTPROCSW 15 { "nofmtproc", 0 }, #define VERSIONSW 16 { "version", 0 }, #define HELPSW 17 { "help", 0 }, { NULL, 0 } }; /* * static prototypes */ static int is_nontext(char *); #define SHOW 0 #define NEXT 1 #define PREV 2 int main (int argc, char **argv) { int draftsw = 0, headersw = 1, msgp = 0; int nshow = 0, checkmime = 1, mime; int vecp = 1, procp = 1, isdf = 0, mode = SHOW, msgnum; char *cp, *maildir, *file = NULL, *folder = NULL, *proc; char buf[BUFSIZ], **argp, **arguments; char *msgs[MAXARGS], *vec[MAXARGS]; struct msgs *mp = NULL; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); if (!mh_strcasecmp (invo_name, "next")) { mode = NEXT; } else if (!mh_strcasecmp (invo_name, "prev")) { mode = PREV; } arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: case NPROGSW: case NFMTPROCSW: vec[vecp++] = --cp; continue; case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] %s[switches] [switches for showproc]", invo_name, mode == SHOW ? "[msgs] ": ""); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case DRFTSW: if (file) adios (NULL, "only one file at a time!"); draftsw++; if (mode == SHOW) continue; usage: adios (NULL, "usage: %s [+folder] [switches] [switches for showproc]", invo_name); case FILESW: if (mode != SHOW) goto usage; if (draftsw || file) adios (NULL, "only one file at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case HEADSW: headersw++; continue; case NHEADSW: headersw = 0; continue; case FORMSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); vec[vecp++] = getcpy (etcpath(cp)); continue; case PROGSW: case LENSW: case WIDTHSW: case FMTPROCSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); vec[vecp++] = cp; continue; case SHOWSW: if (!(showproc = *argp++) || *showproc == '-') adios (NULL, "missing argument to %s", argp[-2]); nshow = 0; continue; case NSHOWSW: nshow++; continue; case SHOWMIMESW: if (!(showmimeproc = *argp++) || *showmimeproc == '-') adios (NULL, "missing argument to %s", argp[-2]); nshow = 0; continue; case CHECKMIMESW: checkmime++; continue; case NOCHECKMIMESW: checkmime = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else { if (mode != SHOW) goto usage; else msgs[msgp++] = cp; } } procp = vecp; if (!context_find ("path")) free (path ("./", TFOLDER)); if (draftsw || file) { if (msgp) adios (NULL, "only one file at a time!"); vec[vecp++] = draftsw ? getcpy (m_draft (folder, msgp ? msgs[0] : NULL, 1, &isdf)) : file; goto go_to_it; } #ifdef WHATNOW if (!msgp && !folder && mode == SHOW && (cp = getenv ("mhdraft")) && *cp) { draftsw++; vec[vecp++] = cp; goto go_to_it; } #endif /* WHATNOW */ if (!msgp) { switch (mode) { case NEXT: msgs[msgp++] = "next"; break; case PREV: msgs[msgp++] = "prev"; break; default: msgs[msgp++] = "cur"; break; } } if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgp; msgnum++) if (!m_convert (mp, msgs[msgnum])) done (1); /* * Set the SELECT_UNSEEN bit for all the SELECTED messages, * since we will use that as a tag to know which messages * to remove from the "unseen" sequence. */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected(mp, msgnum)) set_unseen (mp, msgnum); seq_setprev (mp); /* set the Previous-Sequence */ seq_setunseen (mp, 1); /* unset the Unseen-Sequence */ if (mp->numsel > MAXARGS - 2) adios (NULL, "more than %d messages for show exec", MAXARGS - 2); for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected(mp, msgnum)) vec[vecp++] = getcpy (m_name (msgnum)); seq_setcur (mp, mp->hghsel); /* update current message */ seq_save (mp); /* synchronize sequences */ context_replace (pfolder, folder); /* update current folder */ context_save (); /* save the context file */ if (headersw && vecp == 2) printf ("(Message %s:%s)\n", folder, vec[1]); go_to_it: ; fflush (stdout); vec[vecp] = NULL; /* * Decide which "proc" to use */ mime = 0; if (nshow) { proc = catproc; } else { /* check if any messages are non-text MIME messages */ if (checkmime && !getenv ("NOMHNPROC")) { if (!draftsw && !file) { /* loop through selected messages and check for MIME */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum) && is_nontext (m_name (msgnum))) { mime = 1; break; } } else { /* check the file or draft for MIME */ if (is_nontext (vec[vecp - 1])) mime = 1; } } /* Set the "proc" */ if (mime) proc = showmimeproc; else proc = showproc; } if (folder && !draftsw && !file) m_putenv ("mhfolder", folder); /* * For backward compatibility, if the "proc" is mhn, * then add "-show" option. Add "-file" if showing * file or draft. */ if (strcmp (r1bindex (proc, '/'), "mhn") == 0) { if (draftsw || file) { vec[vecp] = vec[vecp - 1]; vec[vecp - 1] = "-file"; vecp++; } vec[vecp++] = "-show"; vec[vecp] = NULL; } /* If the "proc" is "mhshow", add "-file" if showing file or draft. */ if (strcmp (r1bindex (proc, '/'), "mhshow") == 0 && (draftsw || file) ) { vec[vecp] = vec[vecp - 1]; vec[vecp - 1] = "-file"; vec[++vecp] = NULL; } /* * If "proc" is mhl, then run it internally * rather than exec'ing it. */ if (strcmp (r1bindex (proc, '/'), "mhl") == 0) { vec[0] = "mhl"; mhl (vecp, vec); done (0); } /* * If you are not using a nmh command as your "proc", then * add the path to the message names. Currently, we are just * checking for mhn here, since we've already taken care of mhl. */ if (!strcmp (r1bindex (proc, '/'), "mhl") && !draftsw && !file && chdir (maildir = concat (m_maildir (""), "/", NULL)) != NOTOK) { mp->foldpath = concat (mp->foldpath, "/", NULL); cp = ssequal (maildir, mp->foldpath) ? mp->foldpath + strlen (maildir) : mp->foldpath; for (msgnum = procp; msgnum < vecp; msgnum++) vec[msgnum] = concat (cp, vec[msgnum], NULL); } vec[0] = r1bindex (proc, '/'); execvp (proc, vec); adios (proc, "unable to exec"); return 0; /* dead code to satisfy the compiler */ } /* * Check if a message or file contains any non-text parts */ static int is_nontext (char *msgnam) { int result, state; unsigned char *bp, *dp; char *cp; char buf[BUFSIZ], name[NAMESZ]; FILE *fp; if ((fp = fopen (msgnam, "r")) == NULL) return 0; for (state = FLD;;) { switch (state = m_getfld (state, name, buf, sizeof(buf), fp)) { case FLD: case FLDPLUS: case FLDEOF: /* * Check Content-Type field */ if (!mh_strcasecmp (name, TYPE_FIELD)) { int passno; char c; cp = add (buf, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), fp); cp = add (buf, cp); } bp = cp; passno = 1; again: for (; isspace (*bp); bp++) continue; if (*bp == '(') { int i; for (bp++, i = 0;;) { switch (*bp++) { case '\0': invalid: result = 0; goto out; case '\\': if (*bp++ == '\0') goto invalid; continue; case '(': i++; /* and fall... */ default: continue; case ')': if (--i < 0) break; continue; } break; } } if (passno == 2) { if (*bp != '/') goto invalid; bp++; passno = 3; goto again; } for (dp = bp; istoken (*dp); dp++) continue; c = *dp; *dp = '\0'; if (!*bp) goto invalid; if (passno > 1) { if ((result = (mh_strcasecmp (bp, "plain") != 0))) goto out; *dp = c; for (dp++; isspace (*dp); dp++) continue; if (*dp) { if ((result = !uprf (dp, "charset"))) goto out; dp += sizeof("charset") - 1; while (isspace (*dp)) dp++; if (*dp++ != '=') goto invalid; while (isspace (*dp)) dp++; if (*dp == '"') { if ((bp = strchr(++dp, '"'))) *bp = '\0'; } else { for (bp = dp; *bp; bp++) if (!istoken (*bp)) { *bp = '\0'; break; } } } else { /* Default character set */ dp = "US-ASCII"; } /* Check the character set */ result = !check_charset (dp, strlen (dp)); } else { if (!(result = (mh_strcasecmp (bp, "text") != 0))) { *dp = c; bp = dp; passno = 2; goto again; } } out: free (cp); if (result) { fclose (fp); return result; } break; } /* * Check Content-Transfer-Encoding field */ if (!mh_strcasecmp (name, ENCODING_FIELD)) { cp = add (buf, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), fp); cp = add (buf, cp); } for (bp = cp; isspace (*bp); bp++) continue; for (dp = bp; istoken (*dp); dp++) continue; *dp = '\0'; result = (mh_strcasecmp (bp, "7bit") && mh_strcasecmp (bp, "8bit") && mh_strcasecmp (bp, "binary")); free (cp); if (result) { fclose (fp); return result; } break; } /* * Just skip the rest of this header * field and go to next one. */ while (state == FLDPLUS) state = m_getfld (state, name, buf, sizeof(buf), fp); break; /* * We've passed the message header, * so message is just text. */ default: fclose (fp); return 0; } } } nmh-1.5/uip/slocal.c000644 007761 000765 00000101725 11765267273 014336 0ustar00kenhkenh000000 000000 /* * slocal.c -- asynchronously filter and deliver new mail * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ /* * Under sendmail, users should add the line * * "| /usr/local/nmh/lib/slocal" * * to their $HOME/.forward file. * */ /* Changed to use getutent() and friends. Assumes that when getutent() exists, * a number of other things also exist. Please check. * Ruud de Rooij Sun, 28 May 2000 17:28:55 +0200 */ #include #include #include #include #include #include #include #include #include #include #include #include /* Hopefully, grp.h declares initgroups(). If we run into a platform where it doesn't, we could consider declaring it here as well. */ #include /* This define is needed for Berkeley db v2 and above to * make the header file expose the 'historical' ndbm APIs. * We define it unconditionally because this is simple and * harmless. */ #define DB_DBM_HSEARCH 1 #ifdef DB_DBM_HSEARCH #endif /* Use DB_DBM_HSEARCH to prevent warning from gcc -Wunused-macros. */ #ifdef NDBM_HEADER #include NDBM_HEADER #endif #ifdef HAVE_GETUTXENT #include #endif /* HAVE_GETUTXENT */ static struct swit switches[] = { #define ADDRSW 0 { "addr address", 0 }, #define USERSW 1 { "user name", 0 }, #define FILESW 2 { "file file", 0 }, #define SENDERSW 3 { "sender address", 0 }, #define MAILBOXSW 4 { "mailbox file", 0 }, #define HOMESW 5 { "home directory", -4 }, #define INFOSW 6 { "info data", 0 }, #define MAILSW 7 { "maildelivery file", 0 }, #define VERBSW 8 { "verbose", 0 }, #define NVERBSW 9 { "noverbose", 0 }, #define SUPPRESSDUP 10 { "suppressdup", 0 }, #define NSUPPRESSDUP 11 { "nosuppressdup", 0 }, #define DEBUGSW 12 { "debug", 0 }, #define VERSIONSW 13 { "version", 0 }, #define HELPSW 14 { "help", 0 }, { NULL, 0 } }; static int globbed = 0; /* have we built "vars" table yet? */ static int parsed = 0; /* have we built header field table yet */ static int utmped = 0; /* have we scanned umtp(x) file yet */ static int suppressdup = 0; /* are we suppressing duplicate messages? */ static int verbose = 0; static int debug = 0; static char *addr = NULL; static char *user = NULL; static char *info = NULL; static char *file = NULL; static char *sender = NULL; static char *envelope = NULL; /* envelope information ("From " line) */ static char *mbox = NULL; static char *home = NULL; static struct passwd *pw; /* passwd file entry */ static char ddate[BUFSIZ]; /* record the delivery date */ struct tws *now; static jmp_buf myctx; /* flags for pair->p_flags */ #define P_NIL 0x00 #define P_ADR 0x01 /* field is address */ #define P_HID 0x02 /* special (fake) field */ #define P_CHK 0x04 struct pair { char *p_name; char *p_value; char p_flags; }; #define NVEC 100 /* * Lookup table for matching fields and patterns * in messages. The rest of the table is added * when the message is parsed. */ static struct pair hdrs[NVEC + 1] = { { "source", NULL, P_HID }, { "addr", NULL, P_HID }, { "Return-Path", NULL, P_ADR }, { "Reply-To", NULL, P_ADR }, { "From", NULL, P_ADR }, { "Sender", NULL, P_ADR }, { "To", NULL, P_ADR }, { "cc", NULL, P_ADR }, { "Resent-Reply-To", NULL, P_ADR }, { "Resent-From", NULL, P_ADR }, { "Resent-Sender", NULL, P_ADR }, { "Resent-To", NULL, P_ADR }, { "Resent-cc", NULL, P_ADR }, { NULL, NULL, 0 } }; /* * The list of builtin variables to expand in a string * before it is executed by the "pipe" or "qpipe" action. */ static struct pair vars[] = { { "sender", NULL, P_NIL }, { "address", NULL, P_NIL }, { "size", NULL, P_NIL }, { "reply-to", NULL, P_CHK }, { "info", NULL, P_NIL }, { NULL, NULL, 0 } }; extern char **environ; /* * static prototypes */ static int localmail (int, char *); static int usr_delivery (int, char *, int); static int split (char *, char **); static int parse (int); static void expand (char *, char *, int); static void glob (int); static struct pair *lookup (struct pair *, char *); static int logged_in (void); static int timely (char *, char *); static int usr_file (int, char *, int); static int usr_pipe (int, char *, char *, char **, int); static int usr_folder (int, char *); static void alrmser (int); static void get_sender (char *, char **); static int copy_message (int, char *, int); static void verbose_printf (char *fmt, ...); static void adorn (char *, char *, ...); static void debug_printf (char *fmt, ...); static int suppress_duplicates (int, char *); static char *trim (char *); int main (int argc, char **argv) { int fd, status; FILE *fp = stdin; char *cp, *mdlvr = NULL, buf[BUFSIZ]; char mailbox[BUFSIZ], tmpfil[BUFSIZ]; char **argp, **arguments; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (*argv, '/'); /* foil search of user profile/context */ if (context_foil (NULL) == -1) done (1); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 0); argp = arguments; /* Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [address info sender]", invo_name); print_help (buf, switches, 0); done (1); case VERSIONSW: print_version(invo_name); done (1); case ADDRSW: if (!(addr = *argp++))/* allow -xyz arguments */ adios (NULL, "missing argument to %s", argp[-2]); continue; case INFOSW: if (!(info = *argp++))/* allow -xyz arguments */ adios (NULL, "missing argument to %s", argp[-2]); continue; case USERSW: if (!(user = *argp++))/* allow -xyz arguments */ adios (NULL, "missing argument to %s", argp[-2]); continue; case FILESW: if (!(file = *argp++) || *file == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case SENDERSW: if (!(sender = *argp++))/* allow -xyz arguments */ adios (NULL, "missing argument to %s", argp[-2]); continue; case MAILBOXSW: if (!(mbox = *argp++) || *mbox == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case HOMESW: if (!(home = *argp++) || *home == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case MAILSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (mdlvr) adios (NULL, "only one maildelivery file at a time!"); mdlvr = cp; continue; case VERBSW: verbose++; continue; case NVERBSW: verbose = 0; continue; case SUPPRESSDUP: suppressdup++; continue; case NSUPPRESSDUP: suppressdup = 0; continue; case DEBUGSW: debug++; continue; } } switch (argp - (argv + 1)) { case 1: addr = cp; break; case 2: info = cp; break; case 3: sender = cp; break; } } if (addr == NULL) addr = getusername (); if (user == NULL) user = (cp = strchr(addr, '.')) ? ++cp : addr; if ((pw = getpwnam (user)) == NULL) adios (NULL, "no such local user as %s", user); if (chdir (pw->pw_dir) == -1) chdir ("/"); umask (0077); if (geteuid() == 0) { setgid (pw->pw_gid); initgroups (pw->pw_name, pw->pw_gid); setuid (pw->pw_uid); } if (info == NULL) info = ""; setbuf (stdin, NULL); /* Record the delivery time */ if ((now = dlocaltimenow ()) == NULL) adios (NULL, "unable to ascertain local time"); snprintf (ddate, sizeof(ddate), "Delivery-Date: %s\n", dtimenow (0)); /* * Copy the message to a temporary file */ if (file) { int tempfd; /* getting message from file */ if ((tempfd = open (file, O_RDONLY)) == -1) adios (file, "unable to open"); if (debug) debug_printf ("retrieving message from file \"%s\"\n", file); if ((fd = copy_message (tempfd, tmpfil, 1)) == -1) adios (NULL, "unable to create temporary file"); close (tempfd); } else { /* getting message from stdin */ if (debug) debug_printf ("retrieving message from stdin\n"); if ((fd = copy_message (fileno (stdin), tmpfil, 1)) == -1) adios (NULL, "unable to create temporary file"); } if (debug) debug_printf ("temporary file=\"%s\"\n", tmpfil); /* Delete the temp file now or a copy of every single message passed through slocal will be left in the /tmp directory until deleted manually! This unlink() used to be under an 'else' of the 'if (debug)' above, but since some people like to always run slocal with -debug and log the results, the /tmp directory would get choked over time. Of course, now that we always delete the temp file, the "temporary file=" message above is somewhat pointless -- someone watching debug output wouldn't have a chance to 'tail -f' or 'ln' the temp file before it's unlinked. The best thing would be to delay this unlink() until later if debug == 1, but I'll leave that for someone who cares about the temp-file-accessing functionality (they'll have to watch out for cases where we adios()). */ unlink (tmpfil); if (!(fp = fdopen (fd, "r+"))) adios (NULL, "unable to access temporary file"); /* * If no sender given, extract it * from envelope information. */ if (sender == NULL) get_sender (envelope, &sender); if (mbox == NULL) { snprintf (mailbox, sizeof(mailbox), "%s/%s", mmdfldir[0] ? mmdfldir : pw->pw_dir, mmdflfil[0] ? mmdflfil : pw->pw_name); mbox = mailbox; } if (home == NULL) home = pw->pw_dir; if (debug) { debug_printf ("addr=\"%s\"\n", trim(addr)); debug_printf ("user=\"%s\"\n", trim(user)); debug_printf ("info=\"%s\"\n", trim(info)); debug_printf ("sender=\"%s\"\n", trim(sender)); debug_printf ("envelope=\"%s\"\n", envelope ? trim(envelope) : ""); debug_printf ("mbox=\"%s\"\n", trim(mbox)); debug_printf ("home=\"%s\"\n", trim(home)); debug_printf ("ddate=\"%s\"\n", trim(ddate)); debug_printf ("now=%02d:%02d\n\n", now->tw_hour, now->tw_min); } /* deliver the message */ status = localmail (fd, mdlvr); done (status != -1 ? RCV_MOK : RCV_MBX); return 1; } /* * Main routine for delivering message. */ static int localmail (int fd, char *mdlvr) { /* check if this message is a duplicate */ if (suppressdup && suppress_duplicates(fd, mdlvr ? mdlvr : ".maildelivery") == DONE) return 0; /* delivery according to personal Maildelivery file */ if (usr_delivery (fd, mdlvr ? mdlvr : ".maildelivery", 0) != -1) return 0; /* delivery according to global Maildelivery file */ if (usr_delivery (fd, maildelivery, 1) != -1) return 0; if (verbose) verbose_printf ("(delivering to standard mail spool)\n"); /* last resort - deliver to standard mail spool */ return usr_file (fd, mbox, MBOX_FORMAT); } #define matches(a,b) (stringdex (b, a) >= 0) /* * Parse the delivery file, and process incoming message. */ static int usr_delivery (int fd, char *delivery, int su) { int i, accept, status=1, won, vecp, next; char *field, *pattern, *action, *result, *string; char buffer[BUFSIZ], tmpbuf[BUFSIZ]; char *cp, *vec[NVEC]; struct stat st; struct pair *p; FILE *fp; /* open the delivery file */ if ((fp = fopen (delivery, "r")) == NULL) return -1; /* check if delivery file has bad ownership or permissions */ if (fstat (fileno (fp), &st) == -1 || (st.st_uid != 0 && (su || st.st_uid != pw->pw_uid)) || st.st_mode & (S_IWGRP|S_IWOTH)) { if (verbose) { verbose_printf ("WARNING: %s has bad ownership/modes (su=%d,uid=%d,owner=%d,mode=0%o)\n", delivery, su, (int) pw->pw_uid, (int) st.st_uid, (int) st.st_mode); } return -1; } won = 0; next = 1; /* read and process delivery file */ while (fgets (buffer, sizeof(buffer), fp)) { /* skip comments and empty lines */ if (*buffer == '#' || *buffer == '\n') continue; /* zap trailing newline */ if ((cp = strchr(buffer, '\n'))) *cp = 0; /* split buffer into fields */ vecp = split (buffer, vec); /* check for too few fields */ if (vecp < 5) { if (debug) debug_printf ("WARNING: entry with only %d fields, skipping.\n", vecp); continue; } if (debug) { for (i = 0; vec[i]; i++) debug_printf ("vec[%d]: \"%s\"\n", i, trim(vec[i])); } field = vec[0]; pattern = vec[1]; action = vec[2]; result = vec[3]; string = vec[4]; /* find out how to perform the action */ switch (result[0]) { case 'N': case 'n': /* * If previous condition failed, don't * do this - else fall through */ if (!next) continue; /* else fall */ case '?': /* * If already delivered, skip this action. Else * consider delivered if action is successful. */ if (won) continue; /* else fall */ case 'A': case 'a': /* * Take action, and consider delivered if * action is successful. */ accept = 1; break; case 'R': case 'r': default: /* * Take action, but don't consider delivered, even * if action is successful */ accept = 0; break; } if (vecp > 5) { if (!mh_strcasecmp (vec[5], "select")) { if (logged_in () != -1) continue; if (vecp > 7 && timely (vec[6], vec[7]) == -1) continue; } } /* check if the field matches */ switch (*field) { case '*': /* always matches */ break; case 'd': /* * "default" matches only if the message hasn't * been delivered yet. */ if (!mh_strcasecmp (field, "default")) { if (won) continue; break; } /* else fall */ default: /* parse message and build lookup table */ if (!parsed && parse (fd) == -1) { fclose (fp); return -1; } /* * find header field in lookup table, and * see if the pattern matches. */ if ((p = lookup (hdrs, field)) && (p->p_value != NULL) && matches (p->p_value, pattern)) { next = 1; } else { next = 0; continue; } break; } /* find out the action to perform */ switch (*action) { case 'q': /* deliver to quoted pipe */ if (mh_strcasecmp (action, "qpipe")) continue; /* else fall */ case '^': expand (tmpbuf, string, fd); if (split (tmpbuf, vec) < 1) continue; status = usr_pipe (fd, tmpbuf, vec[0], vec, 0); break; case 'p': /* deliver to pipe */ if (mh_strcasecmp (action, "pipe")) continue; /* else fall */ case '|': vec[2] = "sh"; vec[3] = "-c"; expand (tmpbuf, string, fd); vec[4] = tmpbuf; vec[5] = NULL; status = usr_pipe (fd, tmpbuf, "/bin/sh", vec + 2, 0); break; case 'f': /* mbox format */ if (!mh_strcasecmp (action, "file")) { status = usr_file (fd, string, MBOX_FORMAT); break; } /* deliver to nmh folder */ else if (mh_strcasecmp (action, "folder")) continue; /* else fall */ case '+': status = usr_folder (fd, string); break; case 'm': /* mmdf format */ if (!mh_strcasecmp (action, "mmdf")) { status = usr_file (fd, string, MMDF_FORMAT); break; } /* mbox format */ else if (mh_strcasecmp (action, "mbox")) continue; /* else fall */ case '>': /* mbox format */ status = usr_file (fd, string, MBOX_FORMAT); break; case 'd': /* ignore message */ if (mh_strcasecmp (action, "destroy")) continue; status = 0; break; } if (status) next = 0; /* action failed, mark for 'N' result */ if (accept && status == 0) won++; } fclose (fp); return (won ? 0 : -1); } #define QUOTE '\\' /* * Split buffer into fields (delimited by whitespace or * comma's). Return the number of fields found. */ static int split (char *cp, char **vec) { int i; unsigned char *s; s = cp; /* split into a maximum of NVEC fields */ for (i = 0; i <= NVEC;) { vec[i] = NULL; /* zap any whitespace and comma's */ while (isspace (*s) || *s == ',') *s++ = 0; /* end of buffer, time to leave */ if (*s == 0) break; /* get double quote text as a single field */ if (*s == '"') { for (vec[i++] = ++s; *s && *s != '"'; s++) { /* * Check for escaped double quote. We need * to shift the string to remove slash. */ if (*s == QUOTE) { if (*++s == '"') strcpy (s - 1, s); s--; } } if (*s == '"') /* zap trailing double quote */ *s++ = 0; continue; } if (*s == QUOTE && *++s != '"') s--; vec[i++] = s++; /* move forward to next field delimiter */ while (*s && !isspace (*s) && *s != ',') s++; } vec[i] = NULL; return i; } /* * Parse the headers of a message, and build the * lookup table for matching fields and patterns. */ static int parse (int fd) { int i, state; int fd1; char *cp, *dp, *lp; char name[NAMESZ], field[BUFSIZ]; struct pair *p, *q; FILE *in; if (parsed++) return 0; /* get a new FILE pointer to message */ if ((fd1 = dup (fd)) == -1) return -1; if ((in = fdopen (fd1, "r")) == NULL) { close (fd1); return -1; } rewind (in); /* add special entries to lookup table */ if ((p = lookup (hdrs, "source"))) p->p_value = getcpy (sender); if ((p = lookup (hdrs, "addr"))) p->p_value = getcpy (addr); /* * Scan the headers of the message and build * a lookup table. */ for (i = 0, state = FLD;;) { switch (state = m_getfld (state, name, field, sizeof(field), in)) { case FLD: case FLDEOF: case FLDPLUS: lp = add (field, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, field, sizeof(field), in); lp = add (field, lp); } for (p = hdrs; p->p_name; p++) { if (!mh_strcasecmp (p->p_name, name)) { if (!(p->p_flags & P_HID)) { if ((cp = p->p_value)) { if (p->p_flags & P_ADR) { dp = cp + strlen (cp) - 1; if (*dp == '\n') *dp = 0; cp = add (",\n\t", cp); } else { cp = add ("\t", cp); } } p->p_value = add (lp, cp); } free (lp); break; } } if (p->p_name == NULL && i < NVEC) { p->p_name = getcpy (name); p->p_value = lp; p->p_flags = P_NIL; p++, i++; p->p_name = NULL; } if (state != FLDEOF) continue; break; case BODY: case BODYEOF: case FILEEOF: break; case LENERR: case FMTERR: advise (NULL, "format error in message"); break; default: advise (NULL, "internal error in m_getfld"); fclose (in); return -1; } break; } fclose (in); if ((p = lookup (vars, "reply-to"))) { if ((q = lookup (hdrs, "reply-to")) == NULL || q->p_value == NULL) q = lookup (hdrs, "from"); p->p_value = getcpy (q ? q->p_value : ""); p->p_flags &= ~P_CHK; if (debug) debug_printf ("vars[%d]: name=\"%s\" value=\"%s\"\n", p - vars, p->p_name, trim(p->p_value)); } if (debug) { for (p = hdrs; p->p_name; p++) debug_printf ("hdrs[%d]: name=\"%s\" value=\"%s\"\n", p - hdrs, p->p_name, p->p_value ? trim(p->p_value) : ""); } return 0; } #define LPAREN '(' #define RPAREN ')' /* * Expand any builtin variables such as $(sender), * $(address), etc., in a string. */ static void expand (char *s1, char *s2, int fd) { char c, *cp; struct pair *p; if (!globbed) glob (fd); while ((c = *s2++)) { if (c != '$' || *s2 != LPAREN) { *s1++ = c; } else { for (cp = ++s2; *s2 && *s2 != RPAREN; s2++) continue; if (*s2 != RPAREN) { s2 = --cp; continue; } *s2++ = 0; if ((p = lookup (vars, cp))) { if (!parsed && (p->p_flags & P_CHK)) parse (fd); strcpy (s1, p->p_value); s1 += strlen (s1); } } } *s1 = 0; } /* * Fill in the information missing from the "vars" * table, which is necessary to expand any builtin * variables in the string for a "pipe" or "qpipe" * action. */ static void glob (int fd) { char buffer[BUFSIZ]; struct stat st; struct pair *p; if (globbed++) return; if ((p = lookup (vars, "sender"))) p->p_value = getcpy (sender); if ((p = lookup (vars, "address"))) p->p_value = getcpy (addr); if ((p = lookup (vars, "size"))) { snprintf (buffer, sizeof(buffer), "%d", fstat (fd, &st) != -1 ? (int) st.st_size : 0); p->p_value = getcpy (buffer); } if ((p = lookup (vars, "info"))) p->p_value = getcpy (info); if (debug) { for (p = vars; p->p_name; p++) debug_printf ("vars[%d]: name=\"%s\" value=\"%s\"\n", p - vars, p->p_name, trim(p->p_value)); } } /* * Find a matching name in a lookup table. If found, * return the "pairs" entry, else return NULL. */ static struct pair * lookup (struct pair *pairs, char *key) { for (; pairs->p_name; pairs++) if (!mh_strcasecmp (pairs->p_name, key)) return pairs; return NULL; } /* * Check utmp(x) file to see if user is currently * logged in. */ static int logged_in (void) { #if HAVE_GETUTXENT struct utmpx *utp; if (utmped) return utmped; setutxent(); while ((utp = getutxent()) != NULL) { if ( utp->ut_type == USER_PROCESS && utp->ut_user[0] != 0 && strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) { if (debug) continue; endutxent(); return (utmped = DONE); } } endutxent(); #endif /* HAVE_GETUTXENT */ return (utmped = NOTOK); } #define check(t,a,b) if (t < a || t > b) return -1 #define cmpar(h1,m1,h2,m2) if (h1 < h2 || (h1 == h2 && m1 < m2)) return 0 static int timely (char *t1, char *t2) { int t1hours, t1mins, t2hours, t2mins; if (sscanf (t1, "%d:%d", &t1hours, &t1mins) != 2) return -1; check (t1hours, 0, 23); check (t1mins, 0, 59); if (sscanf (t2, "%d:%d", &t2hours, &t2mins) != 2) return -1; check (t2hours, 0, 23); check (t2mins, 0, 59); cmpar (now->tw_hour, now->tw_min, t1hours, t1mins); cmpar (t2hours, t2mins, now->tw_hour, now->tw_min); return -1; } /* * Deliver message by appending to a file. */ static int usr_file (int fd, char *mailbox, int mbx_style) { int md, mapping; if (verbose) verbose_printf ("delivering to file \"%s\"", mailbox); if (mbx_style == MBOX_FORMAT) { if (verbose) verbose_printf (" (mbox style)"); mapping = 0; } else { if (verbose) verbose_printf (" (mmdf style)"); mapping = 1; } /* open and lock the file */ if ((md = mbx_open (mailbox, mbx_style, pw->pw_uid, pw->pw_gid, m_gmprot())) == -1) { if (verbose) adorn ("", "unable to open:"); return -1; } lseek (fd, (off_t) 0, SEEK_SET); /* append message to file */ if (mbx_copy (mailbox, mbx_style, md, fd, mapping, NULL, verbose) == -1) { if (verbose) adorn ("", "error writing to:"); return -1; } /* close and unlock file */ if (mbx_close (mailbox, md) == NOTOK) { if (verbose) adorn ("", "error closing:"); return -1; } if (verbose) verbose_printf (", success.\n"); return 0; } /* * Deliver message to a nmh folder. */ static int usr_folder (int fd, char *string) { int status; char folder[BUFSIZ], *vec[3]; /* get folder name ready */ if (*string == '+') strncpy(folder, string, sizeof(folder)); else snprintf(folder, sizeof(folder), "+%s", string); if (verbose) verbose_printf ("delivering to folder \"%s\"", folder + 1); vec[0] = "rcvstore"; vec[1] = folder; vec[2] = NULL; /* use rcvstore to put message in folder */ status = usr_pipe (fd, "rcvstore", rcvstoreproc, vec, 1); #if 0 /* * Currently, verbose status messages are handled by usr_pipe(). */ if (verbose) { if (status == 0) verbose_printf (", success.\n"); else verbose_printf (", failed.\n"); } #endif return status; } /* * Deliver message to a process. */ static int usr_pipe (int fd, char *cmd, char *pgm, char **vec, int suppress) { pid_t child_id; int i, bytes, seconds, status; struct stat st; if (verbose && !suppress) verbose_printf ("delivering to pipe \"%s\"", cmd); lseek (fd, (off_t) 0, SEEK_SET); for (i = 0; (child_id = fork()) == -1 && i < 5; i++) sleep (5); switch (child_id) { case -1: /* fork error */ if (verbose) adorn ("fork", "unable to"); return -1; case 0: /* child process */ if (fd != 0) dup2 (fd, 0); freopen ("/dev/null", "w", stdout); freopen ("/dev/null", "w", stderr); if (fd != 3) dup2 (fd, 3); closefds (4); #ifdef TIOCNOTTY if ((fd = open ("/dev/tty", O_RDWR)) != -1) { ioctl (fd, TIOCNOTTY, NULL); close (fd); } #endif /* TIOCNOTTY */ setpgid ((pid_t) 0, getpid ()); /* put in own process group */ *environ = NULL; m_putenv ("USER", pw->pw_name); m_putenv ("HOME", pw->pw_dir); m_putenv ("SHELL", pw->pw_shell); execvp (pgm, vec); _exit (-1); default: /* parent process */ if (! setjmp (myctx)) { SIGNAL (SIGALRM, alrmser); bytes = fstat (fd, &st) != -1 ? (int) st.st_size : 100; /* amount of time to wait depends on message size */ if (bytes <= 100) { /* give at least 5 minutes */ seconds = 300; } else if (bytes >= 90000) { /* a half hour is long enough */ seconds = 1800; } else { seconds = (bytes / 60) + 300; } alarm ((unsigned int) seconds); status = pidwait (child_id, 0); alarm (0); if (verbose) { if (status == 0) verbose_printf (", success.\n"); else if ((status & 0xff00) == 0xff00) verbose_printf (", system error\n"); else pidstatus (status, stdout, ", failed"); } return (status == 0 ? 0 : -1); } else { /* * Ruthlessly kill the child and anything * else in its process group. */ killpg(child_id, SIGKILL); if (verbose) verbose_printf (", timed-out; terminated\n"); return -1; } } } static void alrmser (int i) { NMH_UNUSED (i); longjmp (myctx, DONE); } /* * Get the `sender' from the envelope * information ("From " line). */ static void get_sender (char *envelope, char **sender) { int i; unsigned char *cp; unsigned char buffer[BUFSIZ]; if (envelope == NULL) { *sender = getcpy (""); return; } i = strlen ("From "); strncpy (buffer, envelope + i, sizeof(buffer)); if ((cp = strchr(buffer, '\n'))) { *cp = 0; cp -= 24; if (cp < buffer) cp = buffer; } else { cp = buffer; } *cp = 0; for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--) if (isspace (*cp)) *cp = 0; else break; *sender = getcpy (buffer); } /* * Copy message into a temporary file. * While copying, it will do some header processing * including the extraction of the envelope information. */ static int copy_message (int qd, char *tmpfil, int fold) { int i, first = 1, fd1, fd2; char buffer[BUFSIZ]; FILE *qfp, *ffp; char *tfile = NULL; tfile = m_mktemp2(NULL, invo_name, &fd1, NULL); if (tfile == NULL) return -1; fchmod(fd1, 0600); strncpy (tmpfil, tfile, BUFSIZ); if (!fold) { while ((i = read (qd, buffer, sizeof(buffer))) > 0) if (write (fd1, buffer, i) != i) { you_lose: close (fd1); unlink (tmpfil); return -1; } if (i == -1) goto you_lose; lseek (fd1, (off_t) 0, SEEK_SET); return fd1; } /* dup the fd for incoming message */ if ((fd2 = dup (qd)) == -1) { close (fd1); return -1; } /* now create a FILE pointer for it */ if ((qfp = fdopen (fd2, "r")) == NULL) { close (fd1); close (fd2); return -1; } /* dup the fd for temporary file */ if ((fd2 = dup (fd1)) == -1) { close (fd1); fclose (qfp); return -1; } /* now create a FILE pointer for it */ if ((ffp = fdopen (fd2, "r+")) == NULL) { close (fd1); close (fd2); fclose (qfp); return -1; } /* * copy message into temporary file * and massage the headers. Save * a copy of the "From " line for later. */ i = strlen ("From "); while (fgets (buffer, sizeof(buffer), qfp)) { if (first) { first = 0; if (!strncmp (buffer, "From ", i)) { /* get copy of envelope information ("From " line) */ envelope = getcpy (buffer); #if 0 /* First go ahead and put "From " line in message */ fputs (buffer, ffp); if (ferror (ffp)) goto fputs_error; #endif /* Put the delivery date in message */ fputs (ddate, ffp); if (ferror (ffp)) goto fputs_error; continue; } } fputs (buffer, ffp); if (ferror (ffp)) goto fputs_error; } fclose (ffp); if (ferror (qfp)) { close (fd1); fclose (qfp); return -1; } fclose (qfp); lseek (fd1, (off_t) 0, SEEK_SET); return fd1; fputs_error: close (fd1); fclose (ffp); fclose (qfp); return -1; } /* * Trim strings for pretty printing of debugging output */ static char * trim (char *cp) { char buffer[BUFSIZ*4]; unsigned char *bp, *sp; if (cp == NULL) return NULL; /* copy string into temp buffer */ strncpy (buffer, cp, sizeof(buffer)); bp = buffer; /* skip over leading whitespace */ while (isspace(*bp)) bp++; /* start at the end and zap trailing whitespace */ for (sp = bp + strlen(bp) - 1; sp >= bp; sp--) { if (isspace(*sp)) *sp = 0; else break; } /* replace remaining whitespace with spaces */ for (sp = bp; *sp; sp++) if (isspace(*sp)) *sp = ' '; /* now return a copy */ return getcpy(bp); } /* * Function for printing `verbose' messages. */ static void verbose_printf (char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf (stdout, fmt, ap); va_end(ap); fflush (stdout); /* now flush output */ } /* * Function for printing `verbose' delivery * error messages. */ static void adorn (char *what, char *fmt, ...) { va_list ap; int eindex; char *s; eindex = errno; /* save the errno */ fprintf (stdout, ", "); va_start(ap, fmt); vfprintf (stdout, fmt, ap); va_end(ap); if (what) { if (*what) fprintf (stdout, " %s: ", what); if ((s = strerror (eindex))) fprintf (stdout, "%s", s); else fprintf (stdout, "Error %d", eindex); } fputc ('\n', stdout); fflush (stdout); } /* * Function for printing `debug' messages. */ static void debug_printf (char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf (stderr, fmt, ap); va_end(ap); } /* * Check ndbm/db file(s) to see if the Message-Id of this * message matches the Message-Id of a previous message, * so we can discard it. If it doesn't match, we add the * Message-Id of this message to the ndbm/db file. */ static int suppress_duplicates (int fd, char *file) { int fd1, lockfd, state, result; char *cp, buf[BUFSIZ], name[NAMESZ]; datum key, value; DBM *db; FILE *in; if ((fd1 = dup (fd)) == -1) return -1; if (!(in = fdopen (fd1, "r"))) { close (fd1); return -1; } rewind (in); for (state = FLD;;) { state = m_getfld (state, name, buf, sizeof(buf), in); switch (state) { case FLD: case FLDPLUS: case FLDEOF: /* Search for the message ID */ if (mh_strcasecmp (name, "Message-ID")) { while (state == FLDPLUS) state = m_getfld (state, name, buf, sizeof(buf), in); continue; } cp = add (buf, NULL); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), in); cp = add (buf, cp); } key.dptr = trimcpy (cp); key.dsize = strlen (key.dptr) + 1; free (cp); cp = key.dptr; if (!(db = dbm_open (file, O_RDWR | O_CREAT, 0600))) { advise (file, "unable to perform dbm_open on"); free (cp); fclose (in); return -1; } /* * Since it is difficult to portable lock a ndbm file, * we will open and lock the Maildelivery file instead. * This will fail if your Maildelivery file doesn't * exist. */ if ((lockfd = lkopen(file, O_RDWR, 0)) == -1) { advise (file, "unable to perform file locking on"); free (cp); fclose (in); return -1; } value = dbm_fetch (db, key); if (value.dptr) { if (verbose) verbose_printf ("Message-ID: %s\n already received on %s", cp, value.dptr); result = DONE; } else { value.dptr = ddate + sizeof("Delivery-Date:"); value.dsize = strlen(value.dptr) + 1; if (dbm_store (db, key, value, DBM_INSERT)) advise (file, "possibly corrupt file"); result = 0; } dbm_close (db); lkclose(lockfd, file); free (cp); fclose (in); return result; break; case BODY: case BODYEOF: case FILEEOF: break; case LENERR: case FMTERR: default: break; } break; } fclose (in); return 0; } nmh-1.5/uip/sortm.c000644 007761 000765 00000033563 11765267273 014231 0ustar00kenhkenh000000 000000 /* * sortm.c -- sort messages in a folder by date/time * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include static struct swit switches[] = { #define DATESW 0 { "datefield field", 0 }, #define TEXTSW 1 { "textfield field", 0 }, #define NSUBJSW 2 { "notextfield", 0 }, #define SUBJSW 3 { "subject", -3 }, /* backward-compatibility */ #define LIMSW 4 { "limit days", 0 }, #define NLIMSW 5 { "nolimit", 0 }, #define VERBSW 6 { "verbose", 0 }, #define NVERBSW 7 { "noverbose", 0 }, #define VERSIONSW 8 { "version", 0 }, #define HELPSW 9 { "help", 0 }, { NULL, 0 } }; struct smsg { int s_msg; time_t s_clock; char *s_subj; }; static struct smsg *smsgs; int nmsgs; char *subjsort = (char *) 0; /* sort on subject if != 0 */ time_t datelimit = 0; int submajor = 0; /* if true, sort on subject-major */ int verbose; /* This keeps compiler happy on calls to qsort */ typedef int (*qsort_comp) (const void *, const void *); /* * static prototypes */ static int read_hdrs (struct msgs *, char *); static int get_fields (char *, int, struct smsg *); static int dsort (struct smsg **, struct smsg **); static int subsort (struct smsg **, struct smsg **); static int txtsort (struct smsg **, struct smsg **); static void rename_chain (struct msgs *, struct smsg **, int, int); static void rename_msgs (struct msgs *, struct smsg **); int main (int argc, char **argv) { int i, msgnum; unsigned char *cp; char *maildir, *datesw = NULL; char *folder = NULL, buf[BUFSIZ], **argp; char **arguments; struct msgs_array msgs = { 0, 0, NULL }; struct msgs *mp; struct smsg **dlist; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Parse arguments */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case DATESW: if (datesw) adios (NULL, "only one date field at a time"); if (!(datesw = *argp++) || *datesw == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case TEXTSW: if (subjsort) adios (NULL, "only one text field at a time"); if (!(subjsort = *argp++) || *subjsort == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case SUBJSW: subjsort = "subject"; continue; case NSUBJSW: subjsort = (char *)0; continue; case LIMSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); while (*cp == '0') cp++; /* skip any leading zeros */ if (!*cp) { /* hit end of string */ submajor++; /* sort subject-major */ continue; } if (!isdigit(*cp) || !(datelimit = atoi(cp))) adios (NULL, "impossible limit %s", cp); datelimit *= 60*60*24; continue; case NLIMSW: submajor = 0; /* use date-major, but */ datelimit = 0; /* use no limit */ continue; case VERBSW: verbose++; continue; case NVERBSW: verbose = 0; continue; } } if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder at a time!"); else folder = pluspath (cp); } else app_msgarg(&msgs, cp); } if (!context_find ("path")) free (path ("./", TFOLDER)); if (!msgs.size) app_msgarg(&msgs, "all"); if (!datesw) datesw = "date"; if (!folder) folder = getfolder (1); maildir = m_maildir (folder); if (chdir (maildir) == NOTOK) adios (maildir, "unable to change directory to"); /* read folder and create message structure */ if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) adios (NULL, "no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp, msgs.msgs[msgnum])) done (1); seq_setprev (mp); /* set the previous sequence */ if ((nmsgs = read_hdrs (mp, datesw)) <= 0) adios (NULL, "no messages to sort"); /* * sort a list of pointers to our "messages to be sorted". */ dlist = (struct smsg **) mh_xmalloc ((nmsgs+1) * sizeof(*dlist)); for (i = 0; i < nmsgs; i++) dlist[i] = &smsgs[i]; dlist[nmsgs] = 0; if (verbose) { /* announce what we're doing */ if (subjsort) printf ("sorting by %s-major %s-minor\n", submajor ? subjsort : datesw, submajor ? datesw : subjsort); else printf ("sorting by datefield %s\n", datesw); } /* first sort by date, or by subject-major, date-minor */ qsort ((char *) dlist, nmsgs, sizeof(*dlist), (qsort_comp) (submajor && subjsort ? txtsort : dsort)); /* * if we're sorting on subject, we need another list * in subject order, then a merge pass to collate the * two sorts. */ if (!submajor && subjsort) { /* already date sorted */ struct smsg **slist, **flist; register struct smsg ***il, **fp, **dp; slist = (struct smsg **) mh_xmalloc ((nmsgs+1) * sizeof(*slist)); memcpy((char *)slist, (char *)dlist, (nmsgs+1)*sizeof(*slist)); qsort((char *)slist, nmsgs, sizeof(*slist), (qsort_comp) subsort); /* * make an inversion list so we can quickly find * the collection of messages with the same subj * given a message number. */ il = (struct smsg ***) calloc (mp->hghsel+1, sizeof(*il)); if (! il) adios (NULL, "couldn't allocate msg list"); for (i = 0; i < nmsgs; i++) il[slist[i]->s_msg] = &slist[i]; /* * make up the final list, chronological but with * all the same subjects grouped together. */ flist = (struct smsg **) mh_xmalloc ((nmsgs+1) * sizeof(*flist)); fp = flist; for (dp = dlist; *dp;) { register struct smsg **s = il[(*dp++)->s_msg]; /* see if we already did this guy */ if (! s) continue; *fp++ = *s++; /* * take the next message(s) if there is one, * its subject isn't null and its subject * is the same as this one and it's not too * far away in time. */ while (*s && (*s)->s_subj[0] && strcmp((*s)->s_subj, s[-1]->s_subj) == 0 && (datelimit == 0 || (*s)->s_clock - s[-1]->s_clock <= datelimit)) { il[(*s)->s_msg] = 0; *fp++ = *s++; } } *fp = 0; free (slist); free (dlist); dlist = flist; } /* * At this point, dlist is a sorted array of pointers to smsg structures, * each of which contains a message number. */ rename_msgs (mp, dlist); context_replace (pfolder, folder); /* update current folder */ seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ done (0); return 1; } static int read_hdrs (struct msgs *mp, char *datesw) { int msgnum; struct tws tb; register struct smsg *s; twscopy (&tb, dlocaltimenow ()); smsgs = (struct smsg *) calloc ((size_t) (mp->hghsel - mp->lowsel + 2), sizeof(*smsgs)); if (smsgs == NULL) adios (NULL, "unable to allocate sort storage"); s = smsgs; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected(mp, msgnum)) { if (get_fields (datesw, msgnum, s)) { s->s_msg = msgnum; s++; } } } s->s_msg = 0; return(s - smsgs); } /* * Parse the message and get the data or subject field, * if needed. */ static int get_fields (char *datesw, int msg, struct smsg *smsg) { register int state; int compnum; char *msgnam, buf[BUFSIZ], nam[NAMESZ]; register struct tws *tw; register char *datecomp = NULL, *subjcomp = NULL; register FILE *in; if ((in = fopen (msgnam = m_name (msg), "r")) == NULL) { admonish (msgnam, "unable to read message"); return (0); } for (compnum = 1, state = FLD;;) { switch (state = m_getfld (state, nam, buf, sizeof(buf), in)) { case FLD: case FLDEOF: case FLDPLUS: compnum++; if (!mh_strcasecmp (nam, datesw)) { datecomp = add (buf, datecomp); while (state == FLDPLUS) { state = m_getfld (state, nam, buf, sizeof(buf), in); datecomp = add (buf, datecomp); } if (!subjsort || subjcomp) break; } else if (subjsort && !mh_strcasecmp (nam, subjsort)) { subjcomp = add (buf, subjcomp); while (state == FLDPLUS) { state = m_getfld (state, nam, buf, sizeof(buf), in); subjcomp = add (buf, subjcomp); } if (datecomp) break; } else { /* just flush this guy */ while (state == FLDPLUS) state = m_getfld (state, nam, buf, sizeof(buf), in); } continue; case BODY: case BODYEOF: case FILEEOF: break; case LENERR: case FMTERR: if (state == LENERR || state == FMTERR) admonish (NULL, "format error in message %d (header #%d)", msg, compnum); if (datecomp) free (datecomp); if (subjcomp) free (subjcomp); fclose (in); return (0); default: adios (NULL, "internal error -- you lose"); } break; } /* * If no date component, then use the modification * time of the file as its date */ if (!datecomp || (tw = dparsetime (datecomp)) == NULL) { struct stat st; admonish (NULL, "can't parse %s field in message %d", datesw, msg); fstat (fileno (in), &st); smsg->s_clock = st.st_mtime; } else { smsg->s_clock = dmktime (tw); } if (subjsort) { if (subjcomp) { /* * try to make the subject "canonical": delete * leading "re:", everything but letters & smash * letters to lower case. */ register char *cp, *cp2; register unsigned char c; cp = subjcomp; cp2 = subjcomp; if (strcmp (subjsort, "subject") == 0) { while ((c = *cp)) { if (! isspace(c)) { if(uprf(cp, "re:")) cp += 2; else break; } cp++; } } while ((c = *cp++)) { if (isalnum(c)) *cp2++ = isupper(c) ? tolower(c) : c; } *cp2 = '\0'; } else subjcomp = ""; smsg->s_subj = subjcomp; } fclose (in); if (datecomp) free (datecomp); return (1); } /* * sort on dates. */ static int dsort (struct smsg **a, struct smsg **b) { if ((*a)->s_clock < (*b)->s_clock) return (-1); else if ((*a)->s_clock > (*b)->s_clock) return (1); else if ((*a)->s_msg < (*b)->s_msg) return (-1); else return (1); } /* * sort on subjects. */ static int subsort (struct smsg **a, struct smsg **b) { register int i; if ((i = strcmp ((*a)->s_subj, (*b)->s_subj))) return (i); return (dsort (a, b)); } static int txtsort (struct smsg **a, struct smsg **b) { register int i; if ((i = strcmp ((*a)->s_subj, (*b)->s_subj))) return (i); else if ((*a)->s_msg < (*b)->s_msg) return (-1); else return (1); } static void rename_chain (struct msgs *mp, struct smsg **mlist, int msg, int endmsg) { int nxt, old, new; char *newname, oldname[BUFSIZ]; char newbuf[MAXPATHLEN + 1]; for (;;) { nxt = mlist[msg] - smsgs; /* mlist[msg] is a ptr into smsgs */ mlist[msg] = (struct smsg *)0; old = smsgs[nxt].s_msg; new = smsgs[msg].s_msg; strncpy (oldname, m_name (old), sizeof(oldname)); newname = m_name (new); if (verbose) printf ("message %d becomes message %d\n", old, new); (void)snprintf(oldname, sizeof (oldname), "%s/%d", mp->foldpath, old); (void)snprintf(newbuf, sizeof (newbuf), "%s/%d", mp->foldpath, new); ext_hook("ref-hook", oldname, newbuf); if (rename (oldname, newname) == NOTOK) adios (newname, "unable to rename %s to", oldname); copy_msg_flags (mp, new, old); if (mp->curmsg == old) seq_setcur (mp, new); if (nxt == endmsg) break; msg = nxt; } /* if (nxt != endmsg); */ /* rename_chain (mp, mlist, nxt, endmsg); */ } static void rename_msgs (struct msgs *mp, struct smsg **mlist) { int i, j, old, new; seqset_t tmpset; char f1[BUFSIZ], tmpfil[BUFSIZ]; char newbuf[MAXPATHLEN + 1]; struct smsg *sp; strncpy (tmpfil, m_name (mp->hghmsg + 1), sizeof(tmpfil)); for (i = 0; i < nmsgs; i++) { if (! (sp = mlist[i])) continue; /* did this one */ j = sp - smsgs; if (j == i) continue; /* this one doesn't move */ /* * the guy that was msg j is about to become msg i. * rename 'j' to make a hole, then recursively rename * guys to fill up the hole. */ old = smsgs[j].s_msg; new = smsgs[i].s_msg; strncpy (f1, m_name (old), sizeof(f1)); if (verbose) printf ("renaming message chain from %d to %d\n", old, new); /* * Run the external hook to refile the old message as the * temporary message number that is off of the end of the * messages in the folder. */ (void)snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, old); (void)snprintf(newbuf, sizeof (newbuf), "%s/%d", mp->foldpath, mp->hghmsg + 1); ext_hook("ref-hook", f1, newbuf); if (rename (f1, tmpfil) == NOTOK) adios (tmpfil, "unable to rename %s to ", f1); get_msg_flags (mp, &tmpset, old); rename_chain (mp, mlist, j, i); /* * Run the external hook to refile the temorary message number * to the real place. */ (void)snprintf(f1, sizeof (f1), "%s/%d", mp->foldpath, new); ext_hook("ref-hook", newbuf, f1); if (rename (tmpfil, m_name(new)) == NOTOK) adios (m_name(new), "unable to rename %s to", tmpfil); set_msg_flags (mp, &tmpset, new); mp->msgflags |= SEQMOD; } } nmh-1.5/uip/spost.c000644 007761 000765 00000050124 11765267273 014225 0ustar00kenhkenh000000 000000 /* * spost.c -- feed messages to sendmail * * This is a simpler, faster, replacement for "post" for use * when "sendmail" is the transport system. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #define MAX_SM_FIELD 1476 /* < largest hdr field sendmail will accept */ #define FCCS 10 /* max number of fccs allowed */ struct swit switches[] = { #define FILTSW 0 { "filter filterfile", 0 }, #define NFILTSW 1 { "nofilter", 0 }, #define REMVSW 2 { "remove", 0 }, #define NREMVSW 3 { "noremove", 0 }, #define VERBSW 4 { "verbose", 0 }, #define NVERBSW 5 { "noverbose", 0 }, #define WATCSW 6 { "watch", 0 }, #define NWATCSW 7 { "nowatch", 0 }, #define BACKSW 8 { "backup", 0 }, #define NBACKSW 9 { "nobackup", 0 }, #define ALIASW 10 { "alias aliasfile", 0 }, #define NALIASW 11 { "noalias", 0 }, #define WIDTHSW 12 { "width columns", 0 }, #define VERSIONSW 13 { "version", 0 }, #define HELPSW 14 { "help", 0 }, #define DEBUGSW 15 { "debug", -5 }, #define DISTSW 16 { "dist", -4 }, /* interface from dist */ #define WHOMSW 17 { "whom", -4 }, /* interface from whom */ #define PUSHSW 18 /* fork to sendmail then exit */ { "push", -4 }, #define NPUSHSW 19 /* exec sendmail */ { "nopush", -6 }, #define LIBSW 20 { "library directory", -7 }, #define ANNOSW 21 { "idanno number", -6 }, { NULL, 0 } }; /* flags for headers->flags */ #define HNOP 0x0000 /* just used to keep .set around */ #define HBAD 0x0001 /* bad header - don't let it through */ #define HADR 0x0002 /* header has an address field */ #define HSUB 0x0004 /* Subject: header */ #define HTRY 0x0008 /* try to send to addrs on header */ #define HBCC 0x0010 /* don't output this header */ /* #define HMNG 0x0020 */ /* munge this header */ #define HNGR 0x0040 /* no groups allowed in this header */ #define HFCC 0x0080 /* FCC: type header */ #define HNIL 0x0100 /* okay for this header not to have addrs */ #define HIGN 0x0200 /* ignore this header */ /* flags for headers->set */ #define MFRM 0x0001 /* we've seen a From: */ #define MDAT 0x0002 /* we've seen a Date: */ #define MRFM 0x0004 /* we've seen a Resent-From: */ #define MVIS 0x0008 /* we've seen sighted addrs */ #define MINV 0x0010 /* we've seen blind addrs */ #define MRDT 0x0020 /* we've seen a Resent-Date: */ struct headers { char *value; unsigned int flags; unsigned int set; }; static struct headers NHeaders[] = { { "Return-Path", HBAD, 0 }, { "Received", HBAD, 0 }, { "Reply-To", HADR|HNGR, 0 }, { "From", HADR|HNGR, MFRM }, { "Sender", HADR|HBAD, 0 }, { "Date", HNOP, MDAT }, { "Subject", HSUB, 0 }, { "To", HADR|HTRY, MVIS }, { "cc", HADR|HTRY, MVIS }, { "Bcc", HADR|HTRY|HBCC|HNIL, MINV }, { "Message-Id", HBAD, 0 }, { "Fcc", HFCC, 0 }, { "Envelope-From",HIGN, 0 }, { NULL, 0, 0 } }; static struct headers RHeaders[] = { { "Resent-Reply-To", HADR|HNGR, 0 }, { "Resent-From", HADR|HNGR, MRFM }, { "Resent-Sender", HADR|HBAD, 0 }, { "Resent-Date", HNOP, MRDT }, { "Resent-Subject", HSUB, 0 }, { "Resent-To", HADR|HTRY, MVIS }, { "Resent-cc", HADR|HTRY, MVIS }, { "Resent-Bcc", HADR|HTRY|HBCC, MINV }, { "Resent-Message-Id", HBAD, 0 }, { "Resent-Fcc", HFCC, 0 }, { "Reply-To", HADR, 0 }, { "Fcc", HIGN, 0 }, { "Envelope-From", HIGN, 0 }, { NULL, 0, 0 } }; static short fccind = 0; /* index into fccfold[] */ static int badmsg = 0; /* message has bad semantics */ static int verbose = 0; /* spell it out */ static int debug = 0; /* debugging post */ static int rmflg = 1; /* remove temporary file when done */ static int watch = 0; /* watch the delivery process */ static int backflg = 0; /* rename input file as *.bak when done */ static int whomflg = 0; /* if just checking addresses */ static int pushflg = 0; /* if going to fork to sendmail */ static int aliasflg = -1; /* if going to process aliases */ static int outputlinelen=72; static unsigned msgflags = 0; /* what we've seen */ static enum { normal, resent } msgstate = normal; static char tmpfil[] = "/tmp/pstXXXXXX"; static char from[BUFSIZ]; /* my network address */ static char signature[BUFSIZ]; /* my signature */ static char *filter = NULL; /* the filter for BCC'ing */ static char *subject = NULL; /* the subject field for BCC'ing */ static char *fccfold[FCCS]; /* foldernames for FCC'ing */ static struct headers *hdrtab; /* table for the message we're doing */ static FILE *out; /* output (temp) file */ extern char *sendmail; /* * external prototypes */ extern char *getfullname (void); extern char *getusername (void); /* * static prototypes */ static void putfmt (char *, char *, FILE *); static void start_headers (void); static void finish_headers (FILE *); static int get_header (char *, struct headers *); static void putadr (char *, struct mailname *); static int putone (char *, int, int); static void insert_fcc (struct headers *, unsigned char *); static void file (char *); static void fcc (char *, char *); #if 0 static void die (char *, char *, ...); static void make_bcc_file (void); #endif int main (int argc, char **argv) { int state, i, pid, compnum; char *cp, *msg = NULL, **argp, **arguments; char *sargv[16], buf[BUFSIZ], name[NAMESZ]; FILE *in; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* foil search of user profile/context */ if (context_foil (NULL) == -1) done (1); mts_init (invo_name); arguments = getarguments (invo_name, argc, argv, 0); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case DEBUGSW: debug++; continue; case DISTSW: msgstate = resent; continue; case WHOMSW: whomflg++; continue; case FILTSW: if (!(filter = *argp++) || *filter == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NFILTSW: filter = NULL; continue; case REMVSW: rmflg++; continue; case NREMVSW: rmflg = 0; continue; case BACKSW: backflg++; continue; case NBACKSW: backflg = 0; continue; case VERBSW: verbose++; continue; case NVERBSW: verbose = 0; continue; case WATCSW: watch++; continue; case NWATCSW: watch = 0; continue; case PUSHSW: pushflg++; continue; case NPUSHSW: pushflg = 0; continue; case ALIASW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); if (aliasflg < 0) alias (AliasFile);/* load default aka's */ aliasflg = 1; if ((state = alias(cp)) != AK_OK) adios (NULL, "aliasing error in file %s - %s", cp, akerror(state) ); continue; case NALIASW: aliasflg = 0; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); outputlinelen = atoi (cp); if (outputlinelen <= 10) outputlinelen = 72; continue; case LIBSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); /* create a minimal context */ if (context_foil (cp) == -1) done(1); continue; case ANNOSW: /* -idanno switch ignored */ if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; } } if (msg) adios (NULL, "only one message at a time!"); else msg = cp; } if (aliasflg < 0) alias (AliasFile); /* load default aka's */ if (!msg) adios (NULL, "usage: %s [switches] file", invo_name); if ((in = fopen (msg, "r")) == NULL) adios (msg, "unable to open"); start_headers (); if (debug) { verbose++; out = stdout; } else { if ((out = fdopen( mkstemp (tmpfil), "w" )) == NULL ) adios (tmpfil, "unable to create"); } hdrtab = (msgstate == normal) ? NHeaders : RHeaders; for (compnum = 1, state = FLD;;) { switch (state = m_getfld (state, name, buf, sizeof(buf), in)) { case FLD: compnum++; putfmt (name, buf, out); continue; case FLDPLUS: compnum++; cp = add (buf, cp); while (state == FLDPLUS) { state = m_getfld (state, name, buf, sizeof(buf), in); cp = add (buf, cp); } putfmt (name, cp, out); free (cp); continue; case BODY: finish_headers (out); fprintf (out, "\n%s", buf); if(whomflg == 0) while (state == BODY) { state = m_getfld (state, name, buf, sizeof(buf), in); fputs (buf, out); } break; case FILEEOF: finish_headers (out); break; case LENERR: case FMTERR: adios (NULL, "message format error in component #%d", compnum); default: adios (NULL, "getfld() returned %d", state); } break; } fclose (in); if (backflg && !whomflg) { strncpy (buf, m_backup (msg), sizeof(buf)); if (rename (msg, buf) == NOTOK) advise (buf, "unable to rename %s to", msg); } if (debug) { done (0); } else fclose (out); file (tmpfil); /* * re-open the temp file, unlink it and exec sendmail, giving it * the msg temp file as std in. */ if ( freopen( tmpfil, "r", stdin) == NULL) adios (tmpfil, "can't reopen for sendmail"); if (rmflg) unlink (tmpfil); argp = sargv; *argp++ = "send-mail"; *argp++ = "-m"; /* send to me too */ *argp++ = "-t"; /* read msg for recipients */ *argp++ = "-i"; /* don't stop on "." */ if (whomflg) *argp++ = "-bv"; if (watch || verbose) *argp++ = "-v"; *argp = NULL; if (pushflg && !(watch || verbose)) { /* fork to a child to run sendmail */ for (i=0; (pid = vfork()) == NOTOK && i < 5; i++) sleep(5); switch (pid) { case NOTOK: fprintf (verbose ? stdout : stderr, "%s: can't fork to %s\n", invo_name, sendmail); exit(-1); case OK: /* we're the child .. */ break; default: exit(0); } } execv ( sendmail, sargv); adios ( sendmail, "can't exec"); return 0; /* dead code to satisfy the compiler */ } /* DRAFT GENERATION */ static void putfmt (char *name, char *str, FILE *out) { int i; char *cp, *pp; struct headers *hdr; while (*str == ' ' || *str == '\t') str++; if ((i = get_header (name, hdrtab)) == NOTOK) { fprintf (out, "%s: %s", name, str); return; } hdr = &hdrtab[i]; if (hdr->flags & HIGN) return; if (hdr->flags & HBAD) { advise (NULL, "illegal header line -- %s:", name); badmsg++; return; } msgflags |= hdr->set; if (hdr->flags & HSUB) subject = subject ? add (str, add ("\t", subject)) : getcpy (str); if (hdr->flags & HFCC) { if ((cp = strrchr(str, '\n'))) *cp = 0; for (cp = pp = str; (cp = strchr(pp, ',')); pp = cp) { *cp++ = 0; insert_fcc (hdr, pp); } insert_fcc (hdr, pp); return; } #ifdef notdef if (hdr->flags & HBCC) { insert_bcc(str); return; } #endif /* notdef */ if (*str != '\n' && *str != '\0') { if (aliasflg && hdr->flags & HTRY) { /* this header contains address(es) that we have to do * alias expansion on. Because of the saved state in * getname we have to put all the addresses into a list. * We then let putadr munch on that list, possibly * expanding aliases. */ register struct mailname *f = 0; register struct mailname *mp = 0; while ((cp = getname(str))) { mp = getm( cp, NULL, 0, AD_HOST, NULL); if (f == 0) { f = mp; mp->m_next = mp; } else { mp->m_next = f->m_next; f->m_next = mp; f = mp; } } f = mp->m_next; mp->m_next = 0; putadr( name, f ); } else { /* The author(s) of spost decided that alias substitution wasn't necessary for the non-HTRY headers. Unfortunately, one of those headers is "From:", and having alias substitution work on that is extremely useful for someone with a lot of POP3 email accounts or aliases. post supports aliasing of "From:"... Since "From:"-processing is incompletely implemented in this unsupported and undocumented spost backend, I'm not going to take the time to implement my new draft-From:-based email address masquerading. If I do ever implement it here, I'd almost certainly want to implement "From:" line alias processing as well. -- Dan Harkless */ fprintf (out, "%s: %s", name, str ); } } } static void start_headers (void) { char *cp; char sigbuf[BUFSIZ]; strncpy(from, getusername(), sizeof(from)); if ((cp = getfullname ()) && *cp) { strncpy (sigbuf, cp, sizeof(sigbuf)); snprintf (signature, sizeof(signature), "%s <%s>", sigbuf, from); } else snprintf (signature, sizeof(signature), "%s", from); } static void finish_headers (FILE *out) { switch (msgstate) { case normal: if (!(msgflags & MDAT)) fprintf (out, "Date: %s\n", dtimenow (0)); if (!(msgflags & MFRM)) fprintf (out, "From: %s\n", signature); #ifdef notdef if (!(msgflags & MVIS)) fprintf (out, "Bcc: Blind Distribution List: ;\n"); #endif /* notdef */ break; case resent: if (!(msgflags & MRDT)) fprintf (out, "Resent-Date: %s\n", dtimenow(0)); if (!(msgflags & MRFM)) /* Construct a Resent-From: header. */ fprintf (out, "Resent-From: %s\n", signature); #ifdef notdef if (!(msgflags & MVIS)) fprintf (out, "Resent-Bcc: Blind Re-Distribution List: ;\n"); #endif /* notdef */ break; } if (badmsg) adios (NULL, "re-format message and try again"); } static int get_header (char *header, struct headers *table) { struct headers *h; for (h = table; h->value; h++) if (!mh_strcasecmp (header, h->value)) return (h - table); return NOTOK; } /* * output the address list for header "name". The address list * is a linked list of mailname structs. "nl" points to the head * of the list. Alias substitution should be done on nl. */ static void putadr (char *name, struct mailname *nl) { register struct mailname *mp, *mp2; register int linepos; register char *cp; int namelen; fprintf (out, "%s: ", name); namelen = strlen(name) + 2; linepos = namelen; for (mp = nl; mp; ) { if (linepos > MAX_SM_FIELD) { fprintf (out, "\n%s: ", name); linepos = namelen; } if (mp->m_nohost) { /* a local name - see if it's an alias */ cp = akvalue(mp->m_mbox); if (cp == mp->m_mbox) /* wasn't an alias - use what the user typed */ linepos = putone( mp->m_text, linepos, namelen ); else /* an alias - expand it */ while ((cp = getname(cp))) { if (linepos > MAX_SM_FIELD) { fprintf (out, "\n%s: ", name); linepos = namelen; } mp2 = getm( cp, NULL, 0, AD_HOST, NULL); if (akvisible()) { mp2->m_pers = getcpy(mp->m_mbox); linepos = putone( adrformat(mp2), linepos, namelen ); } else { linepos = putone( mp2->m_text, linepos, namelen ); } mnfree( mp2 ); } } else { /* not a local name - use what the user typed */ linepos = putone( mp->m_text, linepos, namelen ); } mp2 = mp; mp = mp->m_next; mnfree( mp2 ); } putc( '\n', out ); } static int putone (char *adr, int pos, int indent) { register int len; static int linepos; len = strlen( adr ); if (pos == indent) linepos = pos; else if ( linepos+len > outputlinelen ) { fprintf ( out, ",\n%*s", indent, ""); linepos = indent; pos += indent + 2; } else { fputs( ", ", out ); linepos += 2; pos += 2; } fputs( adr, out ); linepos += len; return (pos+len); } static void insert_fcc (struct headers *hdr, unsigned char *pp) { unsigned char *cp; for (cp = pp; isspace (*cp); cp++) continue; for (pp += strlen (pp) - 1; pp > cp && isspace (*pp); pp--) continue; if (pp >= cp) *++pp = 0; if (*cp == 0) return; if (fccind >= FCCS) adios (NULL, "too many %ss", hdr->value); fccfold[fccind++] = getcpy (cp); } #if 0 /* BCC GENERATION */ static void make_bcc_file (void) { pid_t child_id; int fd, i, status; char *vec[6]; FILE * in, *out; fd = mkstemp(bccfil); if (fd == -1 || (out = fdopen(fd, "w")) == NULL) adios (bccfil, "unable to create"); chmod (bccfil, 0600); fprintf (out, "Date: %s\n", dtimenow (0)); if (!(msgflags & MFRM)) /* Construct a From: header. */ fprintf (out, "From: %s\n", signature); if (subject) fprintf (out, "Subject: %s", subject); fprintf (out, "BCC:\n\n------- Blind-Carbon-Copy\n\n"); fflush (out); if (filter == NULL) { if ((fd = open (tmpfil, O_RDONLY)) == NOTOK) adios (NULL, "unable to re-open"); cpydgst (fd, fileno (out), tmpfil, bccfil); close (fd); } else { vec[0] = r1bindex (mhlproc, '/'); for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: adios ("vfork", "unable to"); case OK: dup2 (fileno (out), 1); i = 1; vec[i++] = "-forward"; vec[i++] = "-form"; vec[i++] = filter; vec[i++] = tmpfil; vec[i] = NULL; execvp (mhlproc, vec); adios (mhlproc, "unable to exec"); default: if (status = pidwait(child_id, OK)) admonish (NULL, "%s lost (status=0%o)", vec[0], status); break; } } fseek (out, 0L, SEEK_END); fprintf (out, "\n------- End of Blind-Carbon-Copy\n"); fclose (out); } #endif /* if 0 */ /* FCC INTERACTION */ static void file (char *path) { int i; if (fccind == 0) return; for (i = 0; i < fccind; i++) if (whomflg) printf ("Fcc: %s\n", fccfold[i]); else fcc (path, fccfold[i]); } static void fcc (char *file, char *folder) { pid_t child_id; int i, status; char fold[BUFSIZ]; if (verbose) printf ("%sFcc: %s\n", msgstate == resent ? "Resent-" : "", folder); fflush (stdout); for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: if (!verbose) fprintf (stderr, " %sFcc %s: ", msgstate == resent ? "Resent-" : "", folder); fprintf (verbose ? stdout : stderr, "no forks, so not ok\n"); break; case OK: snprintf (fold, sizeof(fold), "%s%s", *folder == '+' || *folder == '@' ? "" : "+", folder); execlp (fileproc, r1bindex (fileproc, '/'), "-link", "-file", file, fold, NULL); _exit (-1); default: if ((status = pidwait(child_id, OK))) { if (!verbose) fprintf (stderr, " %sFcc %s: ", msgstate == resent ? "Resent-" : "", folder); fprintf (verbose ? stdout : stderr, " errored (0%o)\n", status); } } fflush (stdout); } #if 0 /* * TERMINATION */ static void die (char *what, char *fmt, ...) { va_list ap; va_start(ap, fmt); advertise (what, NULL, fmt, ap); va_end(ap); done (1); } #endif nmh-1.5/uip/termsbr.c000644 007761 000765 00000006314 11762736347 014535 0ustar00kenhkenh000000 000000 /* * termsbr.c -- termcap support * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* It might be better to tie this to the termcap_curses_order in configure.ac. It would be fine to check for ncurses/termcap.h first on Linux, it's a symlink to termcap.h. */ #ifdef HAVE_TERMCAP_H # include #elif defined (HAVE_NCURSES_TERMCAP_H) # include #endif /* is need anyway for ioctl() #ifdef GWINSZ_IN_SYS_IOCTL */ # include /* #endif */ #ifdef WINSIZE_IN_PTEM # include # include #endif #if BUFSIZ<2048 # define TXTSIZ 2048 #else # define TXTSIZ BUFSIZ #endif static long speedcode; static int initLI = 0; static int initCO = 0; static int HC = 0; /* are we on a hardcopy terminal? */ static int LI = 40; /* number of lines */ static int CO = 80; /* number of colums */ static char *CL = NULL; /* termcap string to clear screen */ static char *SE = NULL; /* termcap string to end standout mode */ static char *SO = NULL; /* termcap string to begin standout mode */ static char termcap[TXTSIZ]; static void read_termcap(void) { char *cp; char *term; #ifndef TGETENT_ACCEPTS_NULL char termbuf[TXTSIZ]; #endif struct termios tio; static int inited = 0; if (inited++) return; if (!(term = getenv ("TERM"))) return; /* * If possible, we let tgetent allocate its own termcap buffer */ #ifdef TGETENT_ACCEPTS_NULL if (tgetent (NULL, term) != TGETENT_SUCCESS) return; #else if (tgetent (termbuf, term) != TGETENT_SUCCESS) return; #endif speedcode = cfgetospeed(&tio); HC = tgetflag ("hc"); if (!initCO && (CO = tgetnum ("co")) <= 0) CO = 80; if (!initLI && (LI = tgetnum ("li")) <= 0) LI = 24; cp = termcap; CL = tgetstr ("cl", &cp); if (tgetnum ("sg") <= 0) { SE = tgetstr ("se", &cp); SO = tgetstr ("so", &cp); } } int sc_width (void) { #ifdef TIOCGWINSZ struct winsize win; int width; if (ioctl (fileno (stderr), TIOCGWINSZ, &win) != NOTOK && (width = win.ws_col) > 0) { CO = width; initCO++; } else #endif /* TIOCGWINSZ */ read_termcap(); return CO; } int sc_length (void) { #ifdef TIOCGWINSZ struct winsize win; if (ioctl (fileno (stderr), TIOCGWINSZ, &win) != NOTOK && (LI = win.ws_row) > 0) initLI++; else #endif /* TIOCGWINSZ */ read_termcap(); return LI; } static int outc (int c) { return putchar(c); } void clear_screen (void) { read_termcap (); if (CL && speedcode) tputs (CL, LI, outc); else { printf ("\f"); if (speedcode) printf ("\200"); } fflush (stdout); } /* * print in standout mode */ int SOprintf (char *fmt, ...) { va_list ap; read_termcap (); if (!(SO && SE)) return NOTOK; tputs (SO, 1, outc); va_start(ap, fmt); vprintf (fmt, ap); va_end(ap); tputs (SE, 1, outc); return OK; } /* * Is this a hardcopy terminal? */ int sc_hardcopy(void) { read_termcap(); return HC; } nmh-1.5/uip/viamail.c000644 007761 000765 00000012513 11765267273 014477 0ustar00kenhkenh000000 000000 /* * viamail.c -- send multiple files in a MIME message * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include static struct swit switches[] = { #define TOSW 0 { "to mailpath", 0 }, #define FROMSW 1 { "from mailpath", 0 }, #define SUBJECTSW 2 { "subject subject", 0 }, #define PARAMSW 3 { "parameters arguments", 0 }, #define DESCRIPTSW 4 { "description text", 0 }, #define COMMENTSW 5 { "comment text", 0 }, #define DELAYSW 6 { "delay seconds", 0 }, #define VERBSW 7 { "verbose", 0 }, #define NVERBSW 8 { "noverbose", 0 }, #define VERSIONSW 9 { "version", 0 }, #define HELPSW 10 { "help", 0 }, #define DEBUGSW 11 { "debug", -5 }, { NULL, 0 } }; extern int debugsw; extern int splitsw; extern int verbsw; int ebcdicsw = 0; /* hack for linking purposes */ /* * static prototypes */ static int via_mail (char *, char *, char *, char *, char *, int, char *); int main (int argc, char **argv) { int delay = 0; char *f1 = NULL, *f2 = NULL, *f3 = NULL; char *f4 = NULL, *f5 = NULL, *f7 = NULL; char *cp, buf[BUFSIZ]; char **argp, **arguments; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* foil search of user profile/context */ if (context_foil (NULL) == -1) done (1); arguments = getarguments (invo_name, argc, argv, 0); argp = arguments; while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case TOSW: if (!(f1 = *argp++)) adios (NULL, "missing argument to %s", argp[-2]); continue; case SUBJECTSW: if (!(f2 = *argp++)) adios (NULL, "missing argument to %s", argp[-2]); continue; case PARAMSW: if (!(f3 = *argp++)) adios (NULL, "missing argument to %s", argp[-2]); continue; case DESCRIPTSW: if (!(f4 = *argp++)) adios (NULL, "missing argument to %s", argp[-2]); continue; case COMMENTSW: if (!(f5 = *argp++)) adios (NULL, "missing argument to %s", argp[-2]); continue; case DELAYSW: if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); /* * If there is an error, just reset the delay parameter * to -1. We will set a default delay later. */ if (sscanf (cp, "%d", &delay) != 1) delay = -1; continue; case FROMSW: if (!(f7 = *argp++)) adios (NULL, "missing argument to %s", argp[-2]); continue; case VERBSW: verbsw = 1; continue; case NVERBSW: verbsw = 0; continue; case DEBUGSW: debugsw = 1; continue; } } } set_endian (); if (!f1) adios (NULL, "missing -viamail \"mailpath\" switch"); via_mail (f1, f2, f3, f4, f5, delay, f7); return 0; /* dead code to satisfy the compiler */ } /* * VIAMAIL */ static int via_mail (char *mailsw, char *subjsw, char *parmsw, char *descsw, char *cmntsw, int delay, char *fromsw) { int status, vecp = 1; char tmpfil[BUFSIZ]; char *vec[MAXARGS]; struct stat st; FILE *fp; char *tfile = NULL; umask (~m_gmprot ()); tfile = m_mktemp2(NULL, invo_name, NULL, &fp); if (tfile == NULL) adios("viamail", "unable to create temporary file"); chmod(tfile, 0600); strncpy (tmpfil, tfile, sizeof(tmpfil)); if (!strchr(mailsw, '@')) mailsw = concat (mailsw, "@", LocalName (0), NULL); fprintf (fp, "To: %s\n", mailsw); if (subjsw) fprintf (fp, "Subject: %s\n", subjsw); if (fromsw) { if (!strchr(fromsw, '@')) fromsw = concat (fromsw, "@", LocalName (0), NULL); fprintf (fp, "From: %s\n", fromsw); } fprintf (fp, "%s: %s\n", VRSN_FIELD, VRSN_VALUE); fprintf (fp, "%s: application/octet-stream", TYPE_FIELD); if (parmsw) fprintf (fp, "; %s", parmsw); if (cmntsw) fprintf (fp, "\n\t(%s)", cmntsw); if (descsw) fprintf (fp, "\n%s: %s", DESCR_FIELD, descsw); fprintf (fp, "\n%s: %s\n\n", ENCODING_FIELD, "base64"); if (fflush (fp)) adios (tmpfil, "error writing to"); writeBase64aux (stdin, fp); if (fflush (fp)) adios (tmpfil, "error writing to"); if (fstat (fileno (fp), &st) == NOTOK) adios ("failed", "fstat of %s", tmpfil); if (delay < 0) splitsw = 10; else splitsw = delay; status = 0; vec[0] = r1bindex (postproc, '/'); if (verbsw) vec[vecp++] = "-verbose"; switch (sendsbr (vec, vecp, tmpfil, &st, 0, (char *)0, 0)) { case DONE: case NOTOK: status++; break; case OK: break; } fclose (fp); if (unlink (tmpfil) == -1) advise (NULL, "unable to remove temp file %s", tmpfil); done (status); return 1; } nmh-1.5/uip/vmhsbr.c000644 007761 000765 00000010330 11713401274 014331 0ustar00kenhkenh000000 000000 /* * vmhsbr.c -- routines to help vmh along * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ /* * TODO (for vrsn 2): * INI: include width of windows */ #include #include #include #include static char *types[] = { "OK", "INI", "ACK", "ERR", "CMD", "QRY", "TTY", "WIN", "DATA", "EOF", "FIN", "XXX", NULL }; static FILE *fp = NULL; static int PEERrfd = NOTOK; static int PEERwfd = NOTOK; /* * static prototypes */ static int rclose (struct record *, char *, ...); int rcinit (int rfd, int wfd) { char *cp, buffer[BUFSIZ]; PEERrfd = rfd; PEERwfd = wfd; if ((cp = getenv ("MHVDEBUG")) && *cp) { snprintf (buffer, sizeof(buffer), "%s.out", invo_name); if ((fp = fopen (buffer, "w"))) { fseek (fp, 0L, SEEK_END); fprintf (fp, "%d: rcinit (%d, %d)\n", (int) getpid(), rfd, wfd); fflush (fp); } } return OK; } int rcdone (void) { if (PEERrfd != NOTOK) close (PEERrfd); if (PEERwfd != NOTOK) close (PEERwfd); if (fp) { fclose (fp); fp = NULL; } return OK; } int rc2rc (char code, int len, char *data, struct record *rc) { if (rc2peer (code, len, data) == NOTOK) return NOTOK; return peer2rc (rc); } int str2rc (char code, char *str, struct record *rc) { return rc2rc (code, str ? strlen (str) : 0, str, rc); } int peer2rc (struct record *rc) { if (rc->rc_data) free (rc->rc_data); if (read (PEERrfd, (char *) rc_head (rc), RHSIZE (rc)) != RHSIZE (rc)) return rclose (rc, "read from peer lost(1)"); if (rc->rc_len) { rc->rc_data = mh_xmalloc ((unsigned) rc->rc_len + 1); if (read (PEERrfd, rc->rc_data, rc->rc_len) != rc->rc_len) return rclose (rc, "read from peer lost(2)"); rc->rc_data[rc->rc_len] = 0; } else rc->rc_data = NULL; if (fp) { fseek (fp, 0L, SEEK_END); fprintf (fp, "%d: <--- %s %d: \"%*.*s\"\n", (int) getpid(), types[(unsigned char)rc->rc_type], rc->rc_len, rc->rc_len, rc->rc_len, rc->rc_data); fflush (fp); } return rc->rc_type; } int rc2peer (char code, int len, char *data) { struct record rcs; register struct record *rc = &rcs; rc->rc_type = code; rc->rc_len = len; if (fp) { fseek (fp, 0L, SEEK_END); fprintf (fp, "%d: ---> %s %d: \"%*.*s\"\n", (int) getpid(), types[(unsigned char)rc->rc_type], rc->rc_len, rc->rc_len, rc->rc_len, data); fflush (fp); } if (write (PEERwfd, (char *) rc_head (rc), RHSIZE (rc)) != RHSIZE (rc)) return rclose (rc, "write to peer lost(1)"); if (rc->rc_len) if (write (PEERwfd, data, rc->rc_len) != rc->rc_len) return rclose (rc, "write to peer lost(2)"); return OK; } int str2peer (char code, char *str) { return rc2peer (code, str ? strlen (str) : 0, str); } int fmt2peer (char code, char *fmt, ...) { va_list ap; va_start(ap, fmt); return verr2peer (code, NULL, fmt, ap); va_end(ap); } int err2peer (char code, char *what, char *fmt, ...) { int return_value; va_list ap; va_start(ap, fmt); return_value = verr2peer(code, what, fmt, ap); va_end(ap); return return_value; /* This routine returned garbage before 1999-07-15. */ } int verr2peer (char code, char *what, char *fmt, va_list ap) { int eindex = errno; int len, buflen; char *bp, *s, buffer[BUFSIZ * 2]; /* Get buffer ready to go */ bp = buffer; buflen = sizeof(buffer); vsnprintf (bp, buflen, fmt, ap); len = strlen (bp); bp += len; buflen -= len; if (what) { if (*what) { snprintf (bp, buflen, " %s: ", what); len = strlen (bp); bp += len; buflen -= len; } if ((s = strerror (eindex))) strncpy (bp, s, buflen); else snprintf (bp, buflen, "unknown error %d", eindex); len = strlen (bp); bp += len; buflen -= len; } return rc2peer (code, bp - buffer, buffer); } static int rclose (struct record *rc, char *fmt, ...) { va_list ap; static char buffer[BUFSIZ * 2]; va_start(ap, fmt); vsnprintf (buffer, sizeof(buffer), fmt, ap); va_end(ap); rc->rc_len = strlen (rc->rc_data = getcpy (buffer)); return (rc->rc_type = RC_XXX); } nmh-1.5/uip/whatnow.c000644 007761 000765 00000000551 11762736347 014543 0ustar00kenhkenh000000 000000 /* * whatnow.c -- the nmh `WhatNow' shell * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int main (int argc, char **argv) { #ifdef LOCALE setlocale(LC_ALL, ""); #endif return WhatNow (argc, argv); } nmh-1.5/uip/whatnowproc.c000644 007761 000765 00000006034 11762736347 015431 0ustar00kenhkenh000000 000000 /* * whatnowproc.c -- exec the "whatnowproc" * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * This routine is used by comp, repl, forw, and dist to exec * the "whatnowproc". It first sets up all the environment * variables that the "whatnowproc" will need to check, and * then execs the command. As an optimization, if the * "whatnowproc" is the nmh command "whatnow" (typical case), * it will call this routine directly without exec'ing it. */ int what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist, struct msgs *mp, char *text, int inplace, char *cwd, int atfile) { int found, k, msgnum, vecp; int len, buflen; register char *bp; char buffer[BUFSIZ], *vec[MAXARGS]; vecp = 0; vec[vecp++] = r1bindex (whatnowproc, '/'); vec[vecp] = NULL; m_putenv ("mhdraft", file); if (mp) m_putenv ("mhfolder", mp->foldpath); else unputenv ("mhfolder"); if (altmsg) { if (mp == NULL || *altmsg == '/' || cwd == NULL) m_putenv ("mhaltmsg", altmsg); else { snprintf (buffer, sizeof(buffer), "%s/%s", mp->foldpath, altmsg); m_putenv ("mhaltmsg", buffer); } } else { unputenv ("mhaltmsg"); } if ((bp = getenv ("mhaltmsg")))/* XXX */ m_putenv ("editalt", bp); snprintf (buffer, sizeof(buffer), "%d", dist); m_putenv ("mhdist", buffer); if (nedit) { unputenv ("mheditor"); } else { m_putenv ("mheditor", ed ? ed : (ed = context_find ("editor")) ? ed : defaulteditor); } snprintf (buffer, sizeof(buffer), "%d", use); m_putenv ("mhuse", buffer); snprintf (buffer, sizeof(buffer), "%d", atfile); m_putenv ("mhatfile", buffer); unputenv ("mhmessages"); unputenv ("mhannotate"); unputenv ("mhinplace"); if (text && mp && !is_readonly(mp)) { found = 0; bp = buffer; buflen = sizeof(buffer); for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) { if (is_selected(mp, msgnum)) { snprintf (bp, buflen, "%s%s", found ? " " : "", m_name (msgnum)); len = strlen (bp); bp += len; buflen -= len; for (k = msgnum + 1; k <= mp->hghmsg && is_selected(mp, k); k++) continue; if (--k > msgnum) { snprintf (bp, buflen, "-%s", m_name (k)); len = strlen (bp); bp += len; buflen -= len; } msgnum = k + 1; found++; } } if (found) { m_putenv ("mhmessages", buffer); m_putenv ("mhannotate", text); snprintf (buffer, sizeof(buffer), "%d", inplace); m_putenv ("mhinplace", buffer); } } context_save (); /* save the context file */ fflush (stdout); if (cwd) chdir (cwd); /* * If the "whatnowproc" is the nmh command "whatnow", * we run it internally, rather than exec'ing it. */ if (strcmp (vec[0], "whatnow") == 0) { WhatNow (vecp, vec); done (0); } execvp (whatnowproc, vec); fprintf (stderr, "unable to exec "); perror (whatnowproc); return 0; } nmh-1.5/uip/whatnowsbr.c000644 007761 000765 00000101772 11765267273 015261 0ustar00kenhkenh000000 000000 /* * whatnowsbr.c -- the WhatNow shell * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. * * Several options have been added to ease the inclusion of attachments * using the header field name mechanism added to anno and send. The * -attach option is used to specify the header field name for attachments. * * Several commands have been added at the whatnow prompt: * * cd [ directory ] This option works just like the shell's * cd command and lets the user change the * directory from which attachments are * taken so that long path names are not * needed with every file. * * ls [ ls-options ] This option works just like the normal * ls command and exists to allow the user * to verify file names in the directory. * * pwd This option works just like the normal * pwd command and exists to allow the user * to verify the directory. * * attach files This option attaches the named files to * the draft. * * alist [-ln] This option lists the attachments on the * draft. -l gets long listings, -n gets * numbered listings. * * detach files This option removes attachments from the * detach -n numbers draft. This can be done by file name or * by attachment number. */ #include #include #include #include #include static struct swit whatnowswitches[] = { #define DFOLDSW 0 { "draftfolder +folder", 0 }, #define DMSGSW 1 { "draftmessage msg", 0 }, #define NDFLDSW 2 { "nodraftfolder", 0 }, #define EDITRSW 3 { "editor editor", 0 }, #define NEDITSW 4 { "noedit", 0 }, #define PRMPTSW 5 { "prompt string", 4 }, #define VERSIONSW 6 { "version", 0 }, #define HELPSW 7 { "help", 0 }, #define ATTACHSW 8 { "attach header-field-name", 0 }, #define NOATTACHSW 9 { "noattach", 0 }, { NULL, 0 } }; /* * Options at the "whatnow" prompt */ static struct swit aleqs[] = { #define EDITSW 0 { "edit [ ]", 0 }, #define REFILEOPT 1 { "refile [] +folder", 0 }, #define BUILDMIMESW 2 { "mime []", 0 }, #define DISPSW 3 { "display []", 0 }, #define LISTSW 4 { "list []", 0 }, #define SENDSW 5 { "send []", 0 }, #define PUSHSW 6 { "push []", 0 }, #define WHOMSW 7 { "whom []", 0 }, #define QUITSW 8 { "quit [-delete]", 0 }, #define DELETESW 9 { "delete", 0 }, #define CDCMDSW 10 { "cd [directory]", 0 }, #define PWDCMDSW 11 { "pwd", 0 }, #define LSCMDSW 12 { "ls", 0 }, #define ATTACHCMDSW 13 { "attach", 0 }, #define DETACHCMDSW 14 { "detach [-n]", 2 }, #define ALISTCMDSW 15 { "alist [-ln] ", 2 }, { NULL, 0 } }; static char *myprompt = "\nWhat now? "; /* * static prototypes */ static int editfile (char **, char **, char *, int, struct msgs *, char *, char *, int, int); static int sendfile (char **, char *, int); static void sendit (char *, char **, char *, int); static int buildfile (char **, char *); static int check_draft (char *); static int whomfile (char **, char *); static int removefile (char *); static void writelscmd(char *, int, char **); static void writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp); static FILE* popen_in_dir(const char *dir, const char *cmd, const char *type); static int system_in_dir(const char *dir, const char *cmd); #ifdef HAVE_LSTAT static int copyf (char *, char *); #endif int WhatNow (int argc, char **argv) { int isdf = 0, nedit = 0, use = 0, atfile = 1; char *cp, *dfolder = NULL, *dmsg = NULL; char *ed = NULL, *drft = NULL, *msgnam = NULL; char buf[BUFSIZ], prompt[BUFSIZ]; char **argp, **arguments; struct stat st; char *attach = NMH_ATTACH_HEADER;/* attachment header field name */ char cwd[MAXPATHLEN + 1]; /* current working directory */ char file[MAXPATHLEN + 1]; /* file name buffer */ char shell[MAXPATHLEN + 1]; /* shell response buffer */ FILE *f; /* read pointer for bgnd proc */ char *l; /* set on -l to alist command */ int n; /* set on -n to alist command */ invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; /* * Get the initial current working directory. */ if (getcwd(cwd, sizeof (cwd)) == (char *)0) { adios("getcwd", "could not get working directory"); } while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, whatnowswitches)) { case AMBIGSW: ambigsw (cp, whatnowswitches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name); print_help (buf, whatnowswitches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case DFOLDSW: if (dfolder) adios (NULL, "only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) adios (NULL, "only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; isdf = NOTOK; continue; case EDITRSW: if (!(ed = *argp++) || *ed == '-') adios (NULL, "missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: nedit++; continue; case PRMPTSW: if (!(myprompt = *argp++) || *myprompt == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case ATTACHSW: if (!(attach = *argp++) || *attach == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NOATTACHSW: attach = NULL; continue; } } if (drft) adios (NULL, "only one draft at a time!"); else drft = cp; } if ((drft == NULL && (drft = getenv ("mhdraft")) == NULL) || *drft == 0) drft = getcpy (m_draft (dfolder, dmsg, 1, &isdf)); msgnam = (cp = getenv ("mhaltmsg")) && *cp ? getcpy (cp) : NULL; if ((cp = getenv ("mhatfile")) && *cp) atfile = atoi(cp); if ((cp = getenv ("mhuse")) && *cp) use = atoi (cp); if (ed == NULL && ((ed = getenv ("mheditor")) == NULL || *ed == 0)) { ed = NULL; nedit++; } /* start editing the draft, unless -noedit was given */ if (!nedit && editfile (&ed, NULL, drft, use, NULL, msgnam, NULL, 1, atfile) < 0) done (1); snprintf (prompt, sizeof(prompt), myprompt, invo_name); for (;;) { #ifdef READLINE_SUPPORT if (!(argp = getans_via_readline (prompt, aleqs))) { #else /* ! READLINE_SUPPORT */ if (!(argp = getans (prompt, aleqs))) { #endif /* READLINE_SUPPORT */ unlink (LINK); done (1); } switch (smatch (*argp, aleqs)) { case DISPSW: /* display the message being replied to, or distributed */ if (msgnam) showfile (++argp, msgnam); else advise (NULL, "no alternate message to display"); break; case BUILDMIMESW: /* Translate MIME composition file */ buildfile (++argp, drft); break; case EDITSW: /* Call an editor on the draft file */ if (*++argp) ed = *argp++; if (editfile (&ed, argp, drft, NOUSE, NULL, msgnam, NULL, 1, atfile) == NOTOK) done (1); break; case LISTSW: /* display the draft file */ showfile (++argp, drft); break; case WHOMSW: /* Check to whom the draft would be sent */ whomfile (++argp, drft); break; case QUITSW: /* Quit, and possibly delete the draft */ if (*++argp && (*argp[0] == 'd' || ((*argp)[0] == '-' && (*argp)[1] == 'd'))) { removefile (drft); } else { if (stat (drft, &st) != NOTOK) advise (NULL, "draft left on %s", drft); } done (1); case DELETESW: /* Delete draft and exit */ removefile (drft); done (1); case PUSHSW: /* Send draft in background */ if (sendfile (++argp, drft, 1)) done (1); break; case SENDSW: /* Send draft */ sendfile (++argp, drft, 0); break; case REFILEOPT: /* Refile the draft */ if (refile (++argp, drft) == 0) done (0); break; case CDCMDSW: /* Change the working directory for attachments * * Run the directory through the user's shell so that * we can take advantage of any syntax that the user * is accustomed to. Read back the absolute path. */ if (*(argp+1) == (char *)0) { (void)sprintf(buf, "$SHELL -c \"cd;pwd\""); } else { writesomecmd(buf, BUFSIZ, "cd", "pwd", argp); } if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) { fgets(cwd, sizeof (cwd), f); if (strchr(cwd, '\n') != (char *)0) *strchr(cwd, '\n') = '\0'; pclose(f); } else { advise("popen", "could not get directory"); } break; case PWDCMDSW: /* Print the working directory for attachments */ printf("%s\n", cwd); break; case LSCMDSW: /* List files in the current attachment working directory * * Use the user's shell so that we can take advantage of any * syntax that the user is accustomed to. */ writelscmd(buf, sizeof(buf), argp); (void)system_in_dir(cwd, buf); break; case ALISTCMDSW: /* * List attachments on current draft. Options are: * * -l long listing (full path names) * -n numbers listing */ if (attach == (char *)0) { advise((char *)0, "can't list because no header field name was given."); break; } l = (char *)0; n = 0; while (*++argp != (char *)0) { if (strcmp(*argp, "-l") == 0) l = "/"; else if (strcmp(*argp, "-n") == 0) n = 1; else if (strcmp(*argp, "-ln") == 0 || strcmp(*argp, "-nl") == 0) { l = "/"; n = 1; } else { n = -1; break; } } if (n == -1) advise((char *)0, "usage is alist [-ln]."); else annolist(drft, attach, l, n); break; case ATTACHCMDSW: /* * Attach files to current draft. */ if (attach == (char *)0) { advise((char *)0, "can't attach because no header field name was given."); break; } if (*(argp+1) == (char *)0) { advise((char *)0, "attach command requires file argument(s)."); break; } /* * Build a command line that causes the user's shell to list the file name * arguments. This handles and wildcard expansion, tilde expansion, etc. */ writelscmd(buf, sizeof(buf), argp); /* * Read back the response from the shell, which contains a number of lines * with one file name per line. Remove off the newline. Determine whether * we have an absolute or relative path name. Prepend the current working * directory to relative path names. Add the attachment annotation to the * draft. */ if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) { while (fgets(shell, sizeof (shell), f) != (char *)0) { *(strchr(shell, '\n')) = '\0'; if (*shell == '/') (void)annotate(drft, attach, shell, 1, 0, -2, 1); else { (void)sprintf(file, "%s/%s", cwd, shell); (void)annotate(drft, attach, file, 1, 0, -2, 1); } } pclose(f); } else { advise("popen", "could not get file from shell"); } break; case DETACHCMDSW: /* * Detach files from current draft. */ if (attach == (char *)0) { advise((char *)0, "can't detach because no header field name was given."); break; } /* * Scan the arguments for a -n. Mixed file names and numbers aren't allowed, * so this catches a -n anywhere in the argument list. */ for (n = 0, arguments = argp + 1; *arguments != (char *)0; arguments++) { if (strcmp(*arguments, "-n") == 0) { n = 1; break; } } /* * A -n was found so interpret the arguments as attachment numbers. * Decrement any remaining argument number that is greater than the one * just processed after processing each one so that the numbering stays * correct. */ if (n == 1) { for (arguments = argp + 1; *arguments != (char *)0; arguments++) { if (strcmp(*arguments, "-n") == 0) continue; if (**arguments != '\0') { n = atoi(*arguments); (void)annotate(drft, attach, (char *)0, 1, 0, n, 1); for (argp = arguments + 1; *argp != (char *)0; argp++) { if (atoi(*argp) > n) { if (atoi(*argp) == 1) *argp = ""; else (void)sprintf(*argp, "%d", atoi(*argp) - 1); } } } } } /* * The arguments are interpreted as file names. Run them through the * user's shell for wildcard expansion and other goodies. Do this from * the current working directory if the argument is not an absolute path * name (does not begin with a /). * * We feed all the file names to the shell at once, otherwise you can't * provide a file name with a space in it. */ writelscmd(buf, sizeof(buf), argp); if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) { while (fgets(shell, sizeof (shell), f) != (char *)0) { *(strchr(shell, '\n')) = '\0'; (void)annotate(drft, attach, shell, 1, 0, 0, 1); } pclose(f); } else { advise("popen", "could not get file from shell"); } break; default: /* Unknown command */ advise (NULL, "say what?"); break; } } /*NOTREACHED*/ } /* Build a command line of the form $SHELL -c "cd 'cwd'; cmd argp ... ; trailcmd". */ static void writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp) { char *cp; /* Note that we do not quote -- the argp from the user * is assumed to be quoted as they desire. (We can't treat * it as pure literal as that would prevent them using ~, * wildcards, etc.) The buffer produced by this function * should be given to popen_in_dir() or system_in_dir() so * that the current working directory is set correctly. */ int ln = snprintf(buf, bufsz, "$SHELL -c \"%s", cmd); /* NB that some snprintf() return -1 on overflow rather than the * new C99 mandated 'number of chars that would have been written' */ /* length checks here and inside the loop allow for the * trailing ';', trailcmd, '"' and NUL */ int trailln = strlen(trailcmd) + 3; if (ln < 0 || ln + trailln > bufsz) adios((char *)0, "arguments too long"); cp = buf + ln; while (*++argp != (char *)0) { ln = strlen(*argp); /* +1 for leading space */ if (ln + trailln + 1 > bufsz - (cp-buf)) adios((char *)0, "arguments too long"); *cp++ = ' '; memcpy(cp, *argp, ln+1); cp += ln; } if (*trailcmd) { *cp++ = ';'; strcpy(cp, trailcmd); cp += trailln - 3; } *cp++ = '"'; *cp = 0; } /* * Build a command line that causes the user's shell to list the file name * arguments. This handles and wildcard expansion, tilde expansion, etc. */ static void writelscmd(char *buf, int bufsz, char **argp) { writesomecmd(buf, bufsz, "ls", "", argp); } /* Like system(), but run the command in directory dir. * This assumes the program is single-threaded! */ static int system_in_dir(const char *dir, const char *cmd) { char olddir[BUFSIZ]; int r; if (getcwd(olddir, sizeof(olddir)) == 0) adios("getcwd", "could not get working directory"); if (chdir(dir) != 0) adios("chdir", "could not change working directory"); r = system(cmd); if (chdir(olddir) != 0) adios("chdir", "could not change working directory"); return r; } /* ditto for popen() */ static FILE* popen_in_dir(const char *dir, const char *cmd, const char *type) { char olddir[BUFSIZ]; FILE *f; if (getcwd(olddir, sizeof(olddir)) == 0) adios("getcwd", "could not get working directory"); if (chdir(dir) != 0) adios("chdir", "could not change working directory"); f = popen(cmd, type); if (chdir(olddir) != 0) adios("chdir", "could not change working directory"); return f; } /* * EDIT */ static int reedit = 0; /* have we been here before? */ static char *edsave = NULL; /* the editor we used previously */ static int editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, char *altmsg, char *cwd, int save_editor, int atfile) { int pid, status, vecp; char altpath[BUFSIZ], linkpath[BUFSIZ]; char *cp, *vec[MAXARGS]; struct stat st; #ifdef HAVE_LSTAT int slinked = 0; #endif /* HAVE_LSTAT */ /* Was there a previous edit session? */ if (reedit) { if (!*ed) { /* no explicit editor */ *ed = edsave; /* so use the previous one */ if ((cp = r1bindex (*ed, '/')) == NULL) cp = *ed; /* unless we've specified it via "editor-next" */ cp = concat (cp, "-next", NULL); if ((cp = context_find (cp)) != NULL) *ed = cp; } } else { /* set initial editor */ if (*ed == NULL && (*ed = context_find ("editor")) == NULL) *ed = defaulteditor; } if (altmsg && atfile) { if (mp == NULL || *altmsg == '/' || cwd == NULL) strncpy (altpath, altmsg, sizeof(altpath)); else snprintf (altpath, sizeof(altpath), "%s/%s", mp->foldpath, altmsg); if (cwd == NULL) strncpy (linkpath, LINK, sizeof(linkpath)); else snprintf (linkpath, sizeof(linkpath), "%s/%s", cwd, LINK); unlink (linkpath); #ifdef HAVE_LSTAT if (link (altpath, linkpath) == NOTOK) { symlink (altpath, linkpath); slinked = 1; } else { slinked = 0; } #else /* not HAVE_LSTAT */ link (altpath, linkpath); #endif /* not HAVE_LSTAT */ } context_save (); /* save the context file */ fflush (stdout); switch (pid = vfork()) { case NOTOK: advise ("fork", "unable to"); status = NOTOK; break; case OK: if (cwd) chdir (cwd); if (altmsg) { if (mp) m_putenv ("mhfolder", mp->foldpath); m_putenv ("editalt", altpath); } vecp = 0; vec[vecp++] = r1bindex (*ed, '/'); if (arg) while (*arg) vec[vecp++] = *arg++; vec[vecp++] = file; vec[vecp] = NULL; execvp (*ed, vec); fprintf (stderr, "unable to exec "); perror (*ed); _exit (-1); default: if ((status = pidwait (pid, NOTOK))) { if (((status & 0xff00) != 0xff00) && (!reedit || (status & 0x00ff))) { if (!use && (status & 0xff00) && (rename (file, cp = m_backup (file)) != NOTOK)) { advise (NULL, "problems with edit--draft left in %s", cp); } else { advise (NULL, "problems with edit--%s preserved", file); } } status = -2; /* maybe "reedit ? -2 : -1"? */ break; } reedit++; #ifdef HAVE_LSTAT if (altmsg && mp && !is_readonly(mp) && (slinked ? lstat (linkpath, &st) != NOTOK && S_ISREG(st.st_mode) && copyf (linkpath, altpath) == NOTOK : stat (linkpath, &st) != NOTOK && st.st_nlink == 1 && (unlink (altpath) == NOTOK || link (linkpath, altpath) == NOTOK))) advise (linkpath, "unable to update %s from", altmsg); #else /* HAVE_LSTAT */ if (altmsg && mp && !is_readonly(mp) && stat (linkpath, &st) != NOTOK && st.st_nlink == 1 && (unlink (altpath) == NOTOK || link (linkpath, altpath) == NOTOK)) advise (linkpath, "unable to update %s from", altmsg); #endif /* HAVE_LSTAT */ } /* normally, we remember which editor we used */ if (save_editor) edsave = getcpy (*ed); *ed = NULL; if (altmsg && atfile) unlink (linkpath); return status; } #ifdef HAVE_LSTAT static int copyf (char *ifile, char *ofile) { int i, in, out; char buffer[BUFSIZ]; if ((in = open (ifile, O_RDONLY)) == NOTOK) return NOTOK; if ((out = open (ofile, O_WRONLY | O_TRUNC)) == NOTOK) { admonish (ofile, "unable to open and truncate"); close (in); return NOTOK; } while ((i = read (in, buffer, sizeof(buffer))) > OK) if (write (out, buffer, i) != i) { advise (ofile, "may have damaged"); i = NOTOK; break; } close (in); close (out); return i; } #endif /* HAVE_LSTAT */ /* * SEND */ static int sendfile (char **arg, char *file, int pushsw) { pid_t child_id; int i, vecp; char *cp, *sp, *vec[MAXARGS]; /* Translate MIME composition file, if necessary */ if ((cp = context_find ("automimeproc")) && (!strcmp (cp, "1")) && !getenv ("NOMHNPROC") && check_draft (file) && (buildfile (NULL, file) == NOTOK)) return 0; /* For backwards compatibility */ if ((cp = context_find ("automhnproc")) && !getenv ("NOMHNPROC") && check_draft (file) && (i = editfile (&cp, NULL, file, NOUSE, NULL, NULL, NULL, 0, 0))) return 0; /* * If the sendproc is the nmh command `send', then we call * those routines directly rather than exec'ing the command. */ if (strcmp (sp = r1bindex (sendproc, '/'), "send") == 0) { cp = invo_name; sendit (invo_name = sp, arg, file, pushsw); invo_name = cp; return 1; } context_save (); /* save the context file */ fflush (stdout); for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: advise (NULL, "unable to fork, so sending directly..."); case OK: vecp = 0; vec[vecp++] = invo_name; if (pushsw) vec[vecp++] = "-push"; if (arg) while (*arg) vec[vecp++] = *arg++; vec[vecp++] = file; vec[vecp] = NULL; execvp (sendproc, vec); fprintf (stderr, "unable to exec "); perror (sendproc); _exit (-1); default: if (pidwait(child_id, OK) == 0) done (0); return 1; } } /* * Translate MIME composition file (call buildmimeproc) */ static int buildfile (char **argp, char *file) { int i; char **args, *ed; ed = buildmimeproc; /* allocate space for arguments */ i = 0; if (argp) { while (argp[i]) i++; } args = (char **) mh_xmalloc((i + 2) * sizeof(char *)); /* * For backward compatibility, we need to add -build * if we are using mhn as buildmimeproc */ i = 0; if (strcmp (r1bindex (ed, '/'), "mhn") == 0) args[i++] = "-build"; /* copy any other arguments */ while (argp && *argp) args[i++] = *argp++; args[i] = NULL; i = editfile (&ed, args, file, NOUSE, NULL, NULL, NULL, 0, 0); free (args); return (i ? NOTOK : OK); } /* * Check if draft is a mhbuild composition file */ static int check_draft (char *msgnam) { int state; char buf[BUFSIZ], name[NAMESZ]; FILE *fp; if ((fp = fopen (msgnam, "r")) == NULL) return 0; for (state = FLD;;) switch (state = m_getfld (state, name, buf, sizeof(buf), fp)) { case FLD: case FLDPLUS: case FLDEOF: /* * If draft already contains any of the * Content-XXX fields, then assume it already * been converted. */ if (uprf (name, XXX_FIELD_PRF)) { fclose (fp); return 0; } while (state == FLDPLUS) state = m_getfld (state, name, buf, sizeof(buf), fp); break; case BODY: do { char *bp; for (bp = buf; *bp; bp++) if (*bp != ' ' && *bp != '\t' && *bp != '\n') { fclose (fp); return 1; } state = m_getfld (state, name, buf, sizeof(buf), fp); } while (state == BODY); /* and fall... */ default: fclose (fp); return 0; } } #ifndef CYRUS_SASL # define SASLminc(a) (a) #else /* CYRUS_SASL */ # define SASLminc(a) 0 #endif /* CYRUS_SASL */ #ifndef TLS_SUPPORT # define TLSminc(a) (a) #else /* TLS_SUPPORT */ # define TLSminc(a) 0 #endif /* TLS_SUPPORT */ static struct swit sendswitches[] = { #define ALIASW 0 { "alias aliasfile", 0 }, #define DEBUGSW 1 { "debug", -5 }, #define FILTSW 2 { "filter filterfile", 0 }, #define NFILTSW 3 { "nofilter", 0 }, #define FRMTSW 4 { "format", 0 }, #define NFRMTSW 5 { "noformat", 0 }, #define FORWSW 6 { "forward", 0 }, #define NFORWSW 7 { "noforward", 0 }, #define MIMESW 8 { "mime", 0 }, #define NMIMESW 9 { "nomime", 0 }, #define MSGDSW 10 { "msgid", 0 }, #define NMSGDSW 11 { "nomsgid", 0 }, #define SPSHSW 12 { "push", 0 }, #define NSPSHSW 13 { "nopush", 0 }, #define SPLITSW 14 { "split seconds", 0 }, #define UNIQSW 15 { "unique", -6 }, #define NUNIQSW 16 { "nounique", -8 }, #define VERBSW 17 { "verbose", 0 }, #define NVERBSW 18 { "noverbose", 0 }, #define WATCSW 19 { "watch", 0 }, #define NWATCSW 20 { "nowatch", 0 }, #define WIDTHSW 21 { "width columns", 0 }, #define SVERSIONSW 22 { "version", 0 }, #define SHELPSW 23 { "help", 0 }, #define BITSTUFFSW 24 { "dashstuffing", -12 }, #define NBITSTUFFSW 25 { "nodashstuffing", -14 }, #define MAILSW 26 { "mail", -4 }, #define SAMLSW 27 { "saml", -4 }, #define SSNDSW 28 { "send", -4 }, #define SOMLSW 29 { "soml", -4 }, #define CLIESW 30 { "client host", -6 }, #define SERVSW 31 { "server host", 6 }, #define SNOOPSW 32 { "snoop", -5 }, #define SDRFSW 33 { "draftfolder +folder", -6 }, #define SDRMSW 34 { "draftmessage msg", -6 }, #define SNDRFSW 35 { "nodraftfolder", -3 }, #define SASLSW 36 { "sasl", SASLminc(-4) }, #define NOSASLSW 37 { "nosasl", SASLminc(-6) }, #define SASLMXSSFSW 38 { "saslmaxssf", SASLminc(-10) }, #define SASLMECHSW 39 { "saslmech", SASLminc(-5) }, #define USERSW 40 { "user", SASLminc(-4) }, #define SNDATTACHSW 41 { "attach file", 6 }, #define SNDNOATTACHSW 42 { "noattach", 0 }, #define SNDATTACHFORMAT 43 { "attachformat", 7 }, #define PORTSW 44 { "port server-port-name/number", 4 }, #define TLSSW 45 { "tls", TLSminc(-3) }, #define NTLSSW 46 { "notls", TLSminc(-5) }, { NULL, 0 } }; extern int debugsw; /* from sendsbr.c */ extern int forwsw; extern int inplace; extern int pushsw; extern int splitsw; extern int unique; extern int verbsw; extern char *altmsg; /* .. */ extern char *annotext; extern char *distfile; static void sendit (char *sp, char **arg, char *file, int pushed) { int vecp, n = 1; char *cp, buf[BUFSIZ], **argp; char **arguments, *vec[MAXARGS]; struct stat st; char *attach = NMH_ATTACH_HEADER;/* attachment header field name */ int attachformat = 1; /* mhbuild format specifier for attachments */ #ifndef lint int distsw = 0; #endif /* * Make sure these are defined. In particular, we need * vec[1] to be NULL, in case "arg" is NULL below. It * doesn't matter what is the value of vec[0], but we * set it to NULL, to help catch "off-by-one" errors. */ vec[0] = NULL; vec[1] = NULL; /* * Temporarily copy arg to vec, since the brkstring() call in * getarguments() will wipe it out before it is merged in. * Also, we skip the first element of vec, since getarguments() * skips it. Then we count the number of arguments * copied. The value of "n" will be one greater than * this in order to simulate the standard argc/argv. */ if (arg) { char **bp; copyip (arg, vec+1, MAXARGS-1); bp = vec+1; while (*bp++) n++; } /* * Merge any arguments from command line (now in vec) * and arguments from profile. */ arguments = getarguments (sp, n, vec, 1); argp = arguments; debugsw = 0; forwsw = 1; inplace = 1; unique = 0; altmsg = NULL; annotext = NULL; distfile = NULL; vecp = 1; /* we'll get the zero'th element later */ vec[vecp++] = "-library"; vec[vecp++] = getcpy (m_maildir ("")); if ((cp = context_find ("fileproc"))) { vec[vecp++] = "-fileproc"; vec[vecp++] = cp; } if ((cp = context_find ("mhlproc"))) { vec[vecp++] = "-mhlproc"; vec[vecp++] = cp; } while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, sendswitches)) { case AMBIGSW: ambigsw (cp, sendswitches); return; case UNKWNSW: advise (NULL, "-%s unknown\n", cp); return; case SHELPSW: snprintf (buf, sizeof(buf), "%s [switches]", sp); print_help (buf, sendswitches, 1); return; case SVERSIONSW: print_version (invo_name); return; case SPSHSW: pushed++; continue; case NSPSHSW: pushed = 0; continue; case SPLITSW: if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1) { advise (NULL, "missing argument to %s", argp[-2]); return; } continue; case UNIQSW: unique++; continue; case NUNIQSW: unique = 0; continue; case FORWSW: forwsw++; continue; case NFORWSW: forwsw = 0; continue; case VERBSW: verbsw++; vec[vecp++] = --cp; continue; case NVERBSW: verbsw = 0; vec[vecp++] = --cp; continue; case DEBUGSW: debugsw++; /* fall */ case NFILTSW: case FRMTSW: case NFRMTSW: case BITSTUFFSW: case NBITSTUFFSW: case MIMESW: case NMIMESW: case MSGDSW: case NMSGDSW: case WATCSW: case NWATCSW: case MAILSW: case SAMLSW: case SSNDSW: case SOMLSW: case SNOOPSW: case SASLSW: case NOSASLSW: case TLSSW: case NTLSSW: vec[vecp++] = --cp; continue; case ALIASW: case FILTSW: case WIDTHSW: case CLIESW: case SERVSW: case SASLMXSSFSW: case SASLMECHSW: case USERSW: case PORTSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') { advise (NULL, "missing argument to %s", argp[-2]); return; } vec[vecp++] = cp; continue; case SDRFSW: case SDRMSW: if (!(cp = *argp++) || *cp == '-') { advise (NULL, "missing argument to %s", argp[-2]); return; } case SNDRFSW: continue; case SNDATTACHSW: if (!(attach = *argp++) || *attach == '-') { advise (NULL, "missing argument to %s", argp[-2]); return; } continue; case SNDNOATTACHSW: attach = NULL; continue; case SNDATTACHFORMAT: if (! *argp || **argp == '-') adios (NULL, "missing argument to %s", argp[-1]); else { attachformat = atoi (*argp); if (attachformat < 0 || attachformat > ATTACHFORMATS - 1) { advise (NULL, "unsupported attachformat %d", attachformat); continue; } } ++argp; continue; } } advise (NULL, "usage: %s [switches]", sp); return; } /* allow Aliasfile: profile entry */ if ((cp = context_find ("Aliasfile"))) { char **ap, *dp; dp = getcpy (cp); for (ap = brkstring (dp, " ", "\n"); ap && *ap; ap++) { vec[vecp++] = "-alias"; vec[vecp++] = *ap; } } if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0) if ((cp = context_find ("signature")) && *cp) m_putenv ("SIGNATURE", cp); if ((annotext = getenv ("mhannotate")) == NULL || *annotext == 0) annotext = NULL; if ((altmsg = getenv ("mhaltmsg")) == NULL || *altmsg == 0) altmsg = NULL; if (annotext && ((cp = getenv ("mhinplace")) != NULL && *cp != 0)) inplace = atoi (cp); if ((cp = getenv ("mhdist")) && *cp #ifndef lint && (distsw = atoi (cp)) #endif /* not lint */ && altmsg) { vec[vecp++] = "-dist"; distfile = getcpy (m_mktemp2(altmsg, invo_name, NULL, NULL)); unlink(distfile); if (link (altmsg, distfile) == NOTOK) adios (distfile, "unable to link %s to", altmsg); } else { distfile = NULL; } if (altmsg == NULL || stat (altmsg, &st) == NOTOK) { st.st_mtime = 0; st.st_dev = 0; st.st_ino = 0; } if ((pushsw = pushed)) push (); vec[0] = r1bindex (postproc, '/'); closefds (3); if (sendsbr (vec, vecp, file, &st, 1, attach, attachformat) == OK) done (0); } /* * WHOM */ static int whomfile (char **arg, char *file) { pid_t pid; int vecp; char *vec[MAXARGS]; context_save (); /* save the context file */ fflush (stdout); switch (pid = vfork()) { case NOTOK: advise ("fork", "unable to"); return 1; case OK: vecp = 0; vec[vecp++] = r1bindex (whomproc, '/'); vec[vecp++] = file; if (arg) while (*arg) vec[vecp++] = *arg++; vec[vecp] = NULL; execvp (whomproc, vec); fprintf (stderr, "unable to exec "); perror (whomproc); _exit (-1); /* NOTREACHED */ default: return (pidwait (pid, NOTOK) & 0377 ? 1 : 0); } } /* * Remove the draft file */ static int removefile (char *drft) { if (unlink (drft) == NOTOK) adios (drft, "unable to unlink"); return OK; } nmh-1.5/uip/whom.c000644 007761 000765 00000012306 11765267273 014027 0ustar00kenhkenh000000 000000 /* * whom.c -- report to whom a message would be sent * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #ifndef CYRUS_SASL # define SASLminc(a) (a) #else /* CYRUS_SASL */ # define SASLminc(a) 0 #endif /* CYRUS_SASL */ #ifndef TLS_SUPPORT # define TLSminc(a) (a) #else /* TLS_SUPPORT */ # define TLSminc(a) 0 #endif /* TLS_SUPPORT */ static struct swit switches[] = { #define ALIASW 0 { "alias aliasfile", 0 }, #define CHKSW 1 { "check", 0 }, #define NOCHKSW 2 { "nocheck", 0 }, #define DRAFTSW 3 { "draft", 0 }, #define DFOLDSW 4 { "draftfolder +folder", 6 }, #define DMSGSW 5 { "draftmessage msg", 6 }, #define NDFLDSW 6 { "nodraftfolder", 0 }, #define VERSIONSW 7 { "version", 0 }, #define HELPSW 8 { "help", 0 }, #define CLIESW 9 { "client host", -6 }, #define SERVSW 10 { "server host", -6 }, #define SNOOPSW 11 { "snoop", -5 }, #define SASLSW 12 { "sasl", SASLminc(4) }, #define SASLMECHSW 13 { "saslmech mechanism", SASLminc(-5) }, #define USERSW 14 { "user username", SASLminc(-4) }, #define PORTSW 15 { "port server port name/number", 4 }, #define TLSSW 16 { "tls", TLSminc(-3) }, #define NTLSSW 17 { "notls", TLSminc(-5) }, { NULL, 0 } }; int main (int argc, char **argv) { pid_t child_id; int i, status, isdf = 0; int distsw = 0, vecp = 0; char *cp, *dfolder = NULL, *dmsg = NULL; char *msg = NULL, **ap, **argp, backup[BUFSIZ]; char buf[BUFSIZ], **arguments, *vec[MAXARGS]; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ context_read(); arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; vec[vecp++] = invo_name; vec[vecp++] = "-whom"; vec[vecp++] = "-library"; vec[vecp++] = getcpy (m_maildir ("")); /* Don't need to feed fileproc or mhlproc to post because it doesn't use them when used for whom. */ while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULL, "-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name); print_help (buf, switches, 1); done (1); case VERSIONSW: print_version(invo_name); done (1); case CHKSW: case NOCHKSW: case SNOOPSW: case SASLSW: case TLSSW: case NTLSSW: vec[vecp++] = --cp; continue; case DRAFTSW: msg = draft; continue; case DFOLDSW: if (dfolder) adios (NULL, "only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) adios (NULL, "only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; isdf = NOTOK; continue; case ALIASW: case CLIESW: case SERVSW: case USERSW: case PORTSW: case SASLMECHSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); vec[vecp++] = cp; continue; } } if (msg) adios (NULL, "only one draft at a time!"); else vec[vecp++] = msg = cp; } /* allow Aliasfile: profile entry */ if ((cp = context_find ("Aliasfile"))) { char *dp = NULL; for (ap = brkstring(dp = getcpy(cp), " ", "\n"); ap && *ap; ap++) { vec[vecp++] = "-alias"; vec[vecp++] = *ap; } } if (msg == NULL) { #ifdef WHATNOW if (dfolder || (cp = getenv ("mhdraft")) == NULL || *cp == '\0') #endif /* WHATNOW */ cp = getcpy (m_draft (dfolder, dmsg, 1, &isdf)); msg = vec[vecp++] = cp; } if ((cp = getenv ("mhdist")) && *cp && (distsw = atoi (cp)) && (cp = getenv ("mhaltmsg")) && *cp) { if (distout (msg, cp, backup) == NOTOK) done (1); vec[vecp++] = "-dist"; distsw++; } vec[vecp] = NULL; closefds (3); if (distsw) { for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); } switch (distsw ? child_id : OK) { case NOTOK: advise (NULL, "unable to fork, so checking directly..."); case OK: execvp (postproc, vec); fprintf (stderr, "unable to exec "); perror (postproc); _exit (-1); default: SIGNAL (SIGHUP, SIG_IGN); SIGNAL (SIGINT, SIG_IGN); SIGNAL (SIGQUIT, SIG_IGN); SIGNAL (SIGTERM, SIG_IGN); status = pidwait(child_id, OK); unlink (msg); if (rename (backup, msg) == NOTOK) adios (msg, "unable to rename %s to", backup); done (status); } return 0; /* dead code to satisfy the compiler */ } nmh-1.5/test/bad-input/000777 007761 000765 00000000000 11765271327 014753 5ustar00kenhkenh000000 000000 nmh-1.5/test/burst/000777 007761 000765 00000000000 11765271327 014227 5ustar00kenhkenh000000 000000 nmh-1.5/test/cleanup000755 007761 000765 00000000620 11762736346 014443 0ustar00kenhkenh000000 000000 #!/bin/sh # # This exists so "make check" will always clean up the "inst" directory # after a run, even if tests fail. That way if you fix a problem and do # another "make check", you will get new binaries to test against. # if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" rm -rf ${MH_INST_DIR} nmh-1.5/test/common.sh.in000644 007761 000765 00000012626 11765267273 015331 0ustar00kenhkenh000000 000000 # Common helper routines for test shell scripts -- intended to be sourced by them # @configure_input@ #### The following exported variables are set by "make check". Ensure #### that they are set here so that individual tests can be run #### outside of make. Requires that MH_OBJ_DIR be set on entry. test -z "$MH_TEST_DIR" && MH_TEST_DIR="$MH_OBJ_DIR/test/testdir" test -z "$prefix" && prefix=@prefix@ test -z "$datarootdir" && datarootdir=@datarootdir@ test -z "$exec_prefix" && exec_prefix=@exec_prefix@ test -z "$auxexecdir" && auxexecdir="@libdir@" test -z "$bindir" && bindir="@bindir@" test -z "$mandir" && mandir="@mandir@" test -z "$sysconfdir" && sysconfdir="@sysconfdir@" test -z "$pagerpath" && pagerpath="@pagerpath@" export MH_TEST_DIR auxexecdir bindir mandir sysconfdir pagerpath test -z "$MH_INST_DIR" && MH_INST_DIR=${MH_TEST_DIR}/inst export MH_INST_DIR unset MHBUILD MHCONTEXT MHMTSUSERCONF MHN MHSHOW MHSTORE MHTMPDIR unset MHLDEBUG MHPDEBUG MHWDEBUG output_md5() { #### Output just the checksum. If the filename needs to appear on #### the same line, the caller needs to add it. This avoids #### differences due to a leading '*' binary file indicator, for #### text files, on some platforms (Cygwin). @MD5SUM@ $* | @MD5FMT@ | cut -d ' ' -f 1 } #### Use built-in $((...)) in test suite if shell supports it. #### Borrowed from configure's as_fn_arith. The result is placed #### in global arith_val. #### Detected at run-time instead of by configure to allow testing #### with different shells. if (eval "test \$(( 1 + 1 )) = 2" 2>/dev/null); then eval 'arith_eval () { arith_val=$(( $* )); }' else arith_eval () { arith_val=`expr "$@" || test $? -eq 1`; } fi test_skip () { WHY="$1" echo "$Test $0 SKIP ($WHY)" exit 77 } # portable implementation of 'which' utility findprog() { FOUND= PROG="$1" IFS_SAVE="$IFS" IFS=: for D in $PATH; do if [ -z "$D" ]; then D=. fi if [ -f "$D/$PROG" ] && [ -x "$D/$PROG" ]; then printf '%s\n' "$D/$PROG" break fi done IFS="$IFS_SAVE" } require_prog () { if [ -z "`findprog $1`" ]; then test_skip "missing $1" fi } # Some stuff for doing silly progress indicators progress_update () { THIS="$1" FIRST="$2" LAST="$3" arith_eval $LAST - $FIRST; RANGE=$arith_val arith_eval $THIS - $FIRST; PROG=$arith_val # this automatically rounds to nearest integer arith_eval 100 \* $PROG / $RANGE; PERC=$arith_val # note \r so next update will overwrite printf "%3d%%\r" $PERC } progress_done () { printf "100%%\n" } #### check() requires two arguments, each the name of a file to be #### diff'ed. #### If the same, the second file is removed. And the first file is #### removed unless the optional third argument has a value of #### 'keep first'. #### If different, global variable "failed" is incremented. check() { #### POSIX diff should support -c. if diff -c "$1" "$2"; then test $# -lt 3 -o "$3" != 'keep first' && rm -f "$1" rm -f "$2" else echo "$0: test failed, outputs are in $1 and $2." failed=`expr ${failed:-0} + 1` fi } #### run_test() requires two arguments, the first is a program and #### arguments, the second is its expected one-line output string. #### If the actual output does not match that string: #### an error message is printed and global variable "failed" is incremented; #### if there is an optional third argument, it is used in the error message. run_test() { set +e actual_output=`$1 2>&1` set -e if test x"$actual_output" != x"$2"; then echo "$0: ${3:-\"$1\"} expected:" 1>&2 echo " '$2'" 1>&2 echo "but instead got:" 1>&2 echo " '$actual_output'" 1>&2 failed=`expr ${failed:-0} + 1` fi } setup_test () { MH=${MH_TEST_DIR}/Mail/.mh_profile MHMTSCONF=${MH_INST_DIR}${sysconfdir}/mts.conf PATH=${MH_INST_DIR}${bindir}:${PATH} MH_LIB_DIR=${MH_INST_DIR}${auxexecdir} export MH MHMTSCONF MH_LIB_DIR PATH # # Only install once # if [ -d ${MH_INST_DIR}${bindir} ]; then : else (cd ${MH_OBJ_DIR} && make DESTDIR=${MH_INST_DIR} SETGID_MAIL= install) || exit 1 #### Don't test with sendmail because it would really send the #### mail. If configured to use sendmail, change to smtp instead #### so that we use fakesmtp. sed -e 's/mts: *sendmail/mts: smtp/' ${MHMTSCONF} >${MHMTSCONF}.new mv -f ${MHMTSCONF}.new ${MHMTSCONF} fi # clean old test data trap "rm -rf $MH_TEST_DIR/Mail" 0 # setup test data mkdir $MH_TEST_DIR/Mail || exit 1 cat > $MH < /dev/null # create 10 basic messages for i in 1 2 3 4 5 6 7 8 9 10; do cat > $MH_TEST_DIR/Mail/inbox/$i < To: Some User Date: Fri, 29 Sep 2006 00:00:00 Subject: Testing message $i This is message number $i EOF done } nmh-1.5/test/comp/000777 007761 000765 00000000000 11765271327 014026 5ustar00kenhkenh000000 000000 nmh-1.5/test/fakesmtp.c000644 007761 000765 00000013336 11762736346 015054 0ustar00kenhkenh000000 000000 /* * fakesmtp - A fake SMTP server used by the nmh test suite * * This code is Copyright (c) 2012, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #include #include #include #include #define PIDFILE "/tmp/fakesmtp.pid" #define LINESIZE 1024 static void killpidfile(void); static void handleterm(int); static void putsmtp(int, char *); static int getsmtp(int, char *); int main(int argc, char *argv[]) { struct addrinfo hints, *res; int rc, l, conn, on, datamode; FILE *f, *pid; fd_set readfd; struct stat st; struct timeval tv; if (argc != 3) { fprintf(stderr, "Usage: %s output-filename port\n", argv[0]); exit(1); } if (!(f = fopen(argv[1], "w"))) { fprintf(stderr, "Unable to open output file \"%s\": %s\n", argv[1], strerror(errno)); exit(1); } /* * If there is a pid file already around, kill the previously running * fakesmtp process. Hopefully this will reduce the race conditions * that crop up when running the test suite. */ if (stat(PIDFILE, &st) == 0) { long oldpid; if (!(pid = fopen(PIDFILE, "r"))) { fprintf(stderr, "Cannot open " PIDFILE " (%s), continuing ...\n", strerror(errno)); } else { rc = fscanf(pid, "%ld", &oldpid); fclose(pid); if (rc != 1) { fprintf(stderr, "Unable to parse pid in " PIDFILE ", continuing ...\n"); } else { kill((pid_t) oldpid, SIGTERM); } } unlink(PIDFILE); } memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; hints.ai_flags = AI_PASSIVE; rc = getaddrinfo("127.0.0.1", argv[2], &hints, &res); if (rc) { fprintf(stderr, "Unable to resolve localhost/%s: %s\n", argv[2], gai_strerror(rc)); exit(1); } l = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (l == -1) { fprintf(stderr, "Unable to create listening socket: %s\n", strerror(errno)); exit(1); } on = 1; if (setsockopt(l, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) { fprintf(stderr, "Unable to set SO_REUSEADDR: %s\n", strerror(errno)); exit(1); } if (bind(l, res->ai_addr, res->ai_addrlen) == -1) { fprintf(stderr, "Unable to bind socket: %s\n", strerror(errno)); exit(1); } if (listen(l, 1) == -1) { fprintf(stderr, "Unable to listen on socket: %s\n", strerror(errno)); exit(1); } /* * Now that our socket & files are set up, wait 30 seconds for * a connection. If there isn't one, then exit. */ if (!(pid = fopen(PIDFILE, "w"))) { fprintf(stderr, "Cannot open " PIDFILE ": %s\n", strerror(errno)); exit(1); } fprintf(pid, "%ld\n", (long) getpid()); fclose(pid); signal(SIGTERM, handleterm); atexit(killpidfile); FD_ZERO(&readfd); FD_SET(l, &readfd); tv.tv_sec = 30; tv.tv_usec = 0; rc = select(l + 1, &readfd, NULL, NULL, &tv); if (rc < 0) { fprintf(stderr, "select() failed: %s\n", strerror(errno)); exit(1); } /* * I think if we get a timeout, we should just exit quietly. */ if (rc == 0) { exit(1); } /* * Alright, got a connection! Accept it. */ if ((conn = accept(l, NULL, NULL)) == -1) { fprintf(stderr, "Unable to accept connection: %s\n", strerror(errno)); exit(1); } close(l); /* * Pretend to be an SMTP server. */ putsmtp(conn, "220 Not really an ESMTP server"); datamode = 0; for (;;) { char line[LINESIZE]; rc = getsmtp(conn, line); if (rc == -1) break; /* EOF */ fprintf(f, "%s\n", line); /* * If we're in DATA mode, then check to see if we've got * a "."; otherwise, continue */ if (datamode) { if (strcmp(line, ".") == 0) { datamode = 0; putsmtp(conn, "250 Thanks for the info!"); } continue; } /* * Most commands we ignore and send the same response to. */ if (strcmp(line, "QUIT") == 0) { putsmtp(conn, "221 Later alligator!"); close(conn); break; } else if (strcmp(line, "DATA") == 0) { putsmtp(conn, "354 Go ahead"); datamode = 1; } else { putsmtp(conn, "250 I'll buy that for a dollar!"); } } fclose(f); exit(0); } /* * Write a line to the SMTP client on the other end */ static void putsmtp(int socket, char *data) { struct iovec iov[2]; iov[0].iov_base = data; iov[0].iov_len = strlen(data); iov[1].iov_base = "\r\n"; iov[1].iov_len = 2; writev(socket, iov, 2); } /* * Read a line (up to the \r\n) */ static int getsmtp(int socket, char *data) { int cc; static unsigned int bytesinbuf = 0; static char buffer[LINESIZE * 2], *p; for (;;) { /* * Find our \r\n */ if (bytesinbuf > 0 && (p = strchr(buffer, '\r')) && *(p + 1) == '\n') { *p = '\0'; strncpy(data, buffer, LINESIZE); data[LINESIZE - 1] = '\0'; cc = strlen(buffer); /* * Shuffle leftover bytes back to the beginning */ bytesinbuf -= cc + 2; /* Don't forget \r\n */ if (bytesinbuf > 0) { memmove(buffer, buffer + cc + 2, bytesinbuf); } return cc; } if (bytesinbuf >= sizeof(buffer)) { fprintf(stderr, "Buffer overflow in getsmtp()!\n"); exit(1); } memset(buffer + bytesinbuf, 0, sizeof(buffer) - bytesinbuf); cc = read(socket, buffer + bytesinbuf, sizeof(buffer) - bytesinbuf); if (cc < 0) { fprintf(stderr, "Read failed: %s\n", strerror(errno)); exit(1); } if (cc == 0) return -1; bytesinbuf += cc; } } /* * Handle a SIGTERM */ static void handleterm(int signal) { (void) signal; killpidfile(); fflush(NULL); _exit(1); } /* * Get rid of our pid file */ static void killpidfile(void) { unlink(PIDFILE); } nmh-1.5/test/folder/000777 007761 000765 00000000000 11765271327 014343 5ustar00kenhkenh000000 000000 nmh-1.5/test/format/000777 007761 000765 00000000000 11765271327 014360 5ustar00kenhkenh000000 000000 nmh-1.5/test/forw/000777 007761 000765 00000000000 11765271327 014045 5ustar00kenhkenh000000 000000 nmh-1.5/test/getfqdn.c000644 007761 000765 00000002423 11762736346 014665 0ustar00kenhkenh000000 000000 /* * getfqdn.c - Print the FQDN of a host, default to localhost. * * This code is Copyright (c) 2012, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* for getaddrinfo */ #include #include #include /* for gethostname */ #include /* for _POSIX_HOST_NAME_MAX */ #include /* for memset */ #include int main(int argc, char *argv[]) { char buf[_POSIX_HOST_NAME_MAX + 1]; const char *hostname = buf; struct addrinfo hints, *res; int status = 0; /* Borrowed the important code below from LocalName() in sbr/mts.c. */ if (argc < 2) { /* First get our local name. */ status = gethostname(buf, sizeof buf); } else if (argc == 2) { hostname = argv[1]; } else if (argc > 2) { fprintf (stderr, "usage: %s [hostname]\n", argv[0]); return 1; } if (status == 0) { /* Now fully qualify the hostname. */ memset(&hints, 0, sizeof hints); hints.ai_flags = AI_CANONNAME; hints.ai_family = AF_UNSPEC; if ((status = getaddrinfo(hostname, NULL, &hints, &res)) == 0) { printf ("%s\n", res->ai_canonname); freeaddrinfo(res); } } return status; } nmh-1.5/test/getfullname.c000644 007761 000765 00000002311 11762736346 015534 0ustar00kenhkenh000000 000000 /* * getfullname.c - Extract a user's name out of the GECOS field in * the password file. * * This code is Copyright (c) 2012, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include extern void escape_display_name (char *, size_t); int main(int argc, char *argv[]) { struct passwd *pwd; char buf[BUFSIZ], *p; if (argc < 2) { pwd = getpwuid(getuid()); if (! pwd) { fprintf(stderr, "Unable to retrieve user info for " "userid %ld\n", (long) getuid()); exit(1); } strncpy(buf, pwd->pw_gecos, sizeof(buf)); buf[sizeof(buf) - 1] = '\0'; } else if (argc == 2) { strncpy(buf, argv[1], sizeof(buf)); } else if (argc > 2) { fprintf (stderr, "usage: %s [name]\n", argv[0]); return 1; } /* * Perform the same processing that getuserinfo() does. */ /* * Stop at the first comma. */ if ((p = strchr(buf, ','))) *p = '\0'; /* * Quote the entire string if it has a special character in it. */ escape_display_name (buf, sizeof(buf)); printf("%s\n", buf); exit(0); } nmh-1.5/test/inc/000777 007761 000765 00000000000 11765271327 013641 5ustar00kenhkenh000000 000000 nmh-1.5/test/install-mh/000777 007761 000765 00000000000 11765271327 015140 5ustar00kenhkenh000000 000000 nmh-1.5/test/manpages/000777 007761 000765 00000000000 11765271327 014663 5ustar00kenhkenh000000 000000 nmh-1.5/test/mhbuild/000777 007761 000765 00000000000 11765271327 014514 5ustar00kenhkenh000000 000000 nmh-1.5/test/mhlist/000777 007761 000765 00000000000 11765271327 014370 5ustar00kenhkenh000000 000000 nmh-1.5/test/mhparam/000777 007761 000765 00000000000 11765271327 014515 5ustar00kenhkenh000000 000000 nmh-1.5/test/mhpath/000777 007761 000765 00000000000 11765271327 014351 5ustar00kenhkenh000000 000000 nmh-1.5/test/mhshow/000777 007761 000765 00000000000 11765271327 014375 5ustar00kenhkenh000000 000000 nmh-1.5/test/mhstore/000777 007761 000765 00000000000 11765271327 014551 5ustar00kenhkenh000000 000000 nmh-1.5/test/new/000777 007761 000765 00000000000 11765271327 013661 5ustar00kenhkenh000000 000000 nmh-1.5/test/pick/000777 007761 000765 00000000000 11765271327 014016 5ustar00kenhkenh000000 000000 nmh-1.5/test/post/000777 007761 000765 00000000000 11765271327 014055 5ustar00kenhkenh000000 000000 nmh-1.5/test/README000644 007761 000765 00000005451 11762736346 013755 0ustar00kenhkenh000000 000000 nmh unit test suite. The purpose of these tests is to verify the functionality of the nmh commands. The goal of the suite is to create an environment where testing nmh commands is easy and useful. Each test is a shell script, and is launched via the 'sh' command. The script should run the test and report the result by one of: * for a test pass: exit with status 0 * where a test has been skipped (perhaps because it depends on an external program which can't be found): print "Test $0 SKIP (reason)" and exit with status 77 * for a test fail: exit with some status other than 0 or 120 The Suite is a re-worked version of the original test suite; it now is designed to work with Automake. To run these tests you can do "make check" via the top-level Makefile. This is also done automatically via "make distcheck". WARNING: The test suite installs nmh and runs the tests on that test installation. If you run tests individually, they will not remove that test installation or check to see if it remains up to date with your nmh workspace. You can run test/clean after a test to remove the test installation. "make check" will do that, so it is best to use it. If you wish to write a new test script, here are the steps: - Make sure your test script sources $MH_OBJ_DIR/test/common.sh and calls the setup_test shell function (the other scripts have examples of this). - Your path will be set up to find the locations of the test nmh binaries. - Add your script to the TESTS variable in the toplevel Makefile.am. By convention, test script names start with "test-", though that is not a requirement. - If you need additional files for your tests, be sure to add them to the EXTRA_DIST variable in Makefile.am. Note that you should insure that you access these files relative to the $srcdir environment variable. - Verify that the test works with both "make check" and "make distcheck". Please use only Bourne shell and bare-bones POSIX program constructs in the test scripts. In particular: - Use `` instead of $(). - Wrap shell variables with "" if they could possibly contain whitespace or special characters that would affect syntax. - Use the arith_eval() function in common.sh instead of $(()) or expr. It detects at run time if $(()) is available. - Use grep >/dev/null instead of grep -q. - Don't use egrep, grep -E, fgrep, grep -F, or other non-portable grep functionality. The built-in case statement supports alternation (|). - Don't use ! to negate conditions. Instead, use something like: || or if ; then :; else fi - Separate variable assignment from export (don't assign in export statements). - Use sed >tmpfile and mv instead of sed -i. - Avoid depending on the exact format of output from system (non-nmh) programs. nmh-1.5/test/refile/000777 007761 000765 00000000000 11765271327 014336 5ustar00kenhkenh000000 000000 nmh-1.5/test/repl/000777 007761 000765 00000000000 11765271327 014032 5ustar00kenhkenh000000 000000 nmh-1.5/test/scan/000777 007761 000765 00000000000 11765271327 014014 5ustar00kenhkenh000000 000000 nmh-1.5/test/sequences/000777 007761 000765 00000000000 11765271327 015063 5ustar00kenhkenh000000 000000 nmh-1.5/test/whatnow/000777 007761 000765 00000000000 11765271327 014557 5ustar00kenhkenh000000 000000 nmh-1.5/test/whom/000777 007761 000765 00000000000 11765271327 014042 5ustar00kenhkenh000000 000000 nmh-1.5/test/whom/test-whom000755 007761 000765 00000004477 11762736346 015733 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test whom # ###################################################### # Not tested: # -check, -client, -server, -port, -user, -sasl, -saslmech, -snoop, -tls, -notls set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual cd $MH_TEST_DIR cat >$MH_TEST_DIR/Mail/draft <<'EOF' From: Test1 To: Some User Subject: Testing message 1 -------- This is a draft message. EOF # check with no options run_test 'whom' ' -- Network Recipients -- user at example.com' # check -nocheck run_test 'whom -check -nocheck' ' -- Network Recipients -- user at example.com' # check with file specified run_test "whom $MH_TEST_DIR/Mail/draft" ' -- Network Recipients -- user at example.com' # check -draftmessage run_test "whom -draftm draft" ' -- Network Recipients -- user at example.com' # check -draftfolder with -draftmessage folder +drafts -create >/dev/null folder +inbox -fast >/dev/null cp $MH_TEST_DIR/Mail/draft $MH_TEST_DIR/Mail/drafts/1 run_test "whom -draftfolder +drafts -draftm 1" \ ' -- Network Recipients -- user at example.com' # check -draftfolder with current draftmessage folder +drafts 1 >/dev/null run_test "whom -draftfolder +drafts" \ ' -- Network Recipients -- user at example.com' # check -nodraftfolder run_test 'whom -draftfolder +nonexistent -nodraftfolder' \ ' -- Network Recipients -- user at example.com' # check -draft, though I'm not sure that it's useful. Note that it # must appear after the file argument when run standalone. run_test "whom $MH_TEST_DIR/Mail/drafts/1 -draft" \ ' -- Network Recipients -- user at example.com' # check -alias rm -f $MH_TEST_DIR/Mail/draft cat >$MH_TEST_DIR/Mail/draft <<'EOF' From: Test1 To: u Subject: Testing message 1 -------- This is a draft message. EOF cat >$MH_TEST_DIR/Mail/nmhaliases <<'EOF' u: user1@example.com EOF run_test 'whom -alias nmhaliases' ' -- Network Recipients -- user1 at example.com' # check -alias with nonexistent aliasfile run_test 'whom -alias nonexistent' \ "whom: aliasing error in nonexistent - unable to read 'nonexistent'" exit $failed nmh-1.5/test/whatnow/test-attach-detach000755 007761 000765 00000003572 11762736346 020163 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test that whatnow's "ls" copes with directory names # which have spaces in them (see bug #23319) # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test cd "$MH_TEST_DIR" testname="baz's boz" testname_quoted="baz\'s\ boz" touch "$testname" # whatnow's attach stuff needs a draft to work on cp "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/draft" expectederr=$MH_TEST_DIR/$$.expectederr actualerr=$MH_TEST_DIR/$$.actualerr expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual rm -f $expected $expectederr $actual $actualerr touch $expected $expectederr $actual $actualerr # # Sigh. Different readline versions change echoing behavior, so we need # to deal. # set +e whatnowtest=`echo cd | TERM=dumb whatnow -prompt ''` set -e case "${whatnowtest}" in cd) cat > "$expected" < "$expected" <> $actualerr >> $actual echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \ 2>> $actualerr >> $actual echo "detach $testname_quoted" | \ TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \ 2>> $actualerr >> $actual set -e check "$expectederr" "$actualerr" check "$expected" "$actual" test ${failed:-0} -eq 0 && rm "$testname" exit $failed nmh-1.5/test/whatnow/test-cd000755 007761 000765 00000002660 11762736346 016054 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test that whatnow's "cd" copes with directory names # which have spaces and quotes in them (see bug #23319) # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test SPDIR="$MH_TEST_DIR/foo's bar" rm -rf "$SPDIR" mkdir "$SPDIR" (cd "$SPDIR" && touch baz boz) expectederr=$MH_TEST_DIR/$$.expectederr actualerr=$MH_TEST_DIR/$$.actualerr expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # # Handle different output depending on readline version # set +e whatnowtest=`echo cd | TERM=dumb whatnow -prompt ''` set -e case "${whatnowtest}" in cd) cat > "$expected" < "$expected" < $expectederr < "$actualerr" > "$actual" || true check "$expectederr" "$actualerr" check "$expected" "$actual" test ${failed:-0} -eq 0 && rm -r "$SPDIR" exit $failed nmh-1.5/test/whatnow/test-ls000755 007761 000765 00000002602 11762736346 016100 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test that whatnow's "ls" copes with directory names # which have spaces and quotes in them (see bug #23319) # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test SPDIR="$MH_TEST_DIR/foo's bar" rm -rf "$SPDIR" mkdir "$SPDIR" cd "$SPDIR" touch baz boz expectederr=$MH_TEST_DIR/$$.expectederr actualerr=$MH_TEST_DIR/$$.actualerr expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # # Handle different output depending on readline version # set +e whatnowtest=`echo cd | TERM=dumb whatnow -prompt ''` set -e case "${whatnowtest}" in cd) cat > "$expected" < "$expected" < $expectederr < "$actualerr" | \ sort > "$actual" check "$expectederr" "$actualerr" check "$expected" "$actual" # On some platforms, need to be out of $SPDIR in order to remove it. cd "$MH_TEST_DIR" test ${failed:-0} -eq 0 && rm -r "$SPDIR" exit $failed nmh-1.5/test/sequences/test-flist000755 007761 000765 00000004542 11762736346 017114 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test flist # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test run_test 'mark 1 3 5 7 9 +inbox -sequence odd' '' run_test 'mark -s odd -list' 'odd: 1 3 5 7 9' run_test 'mark +inbox -sequence unseen all' '' run_test 'mark +inbox -sequence unseen -list' 'unseen: 1-10' folder -create +other > /dev/null for i in 2 5 7 12; do cp -p "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/other/$i" done run_test 'mark +other -sequence unseen all' '' run_test 'mark +other -sequence unseen -list' 'unseen: 2 5 7 12' # Make sure that inbox is current folder. folder -f +inbox > /dev/null # Test flists. run_test 'flists -seq odd' 'inbox+ has 5 in sequence odd; out of 10 other has 0 in sequence odd; out of 4' run_test 'flists -seq unseen' \ 'inbox+ has 10 in sequence unseen; out of 10 other has 4 in sequence unseen; out of 4' # Test flist on individual folders, starting with the current folder. run_test 'flist -sequence unseen' \ 'inbox+ has 10 in sequence unseen; out of 10' run_test 'flist +other -sequence unseen' \ 'other+ has 4 in sequence unseen; out of 4' # Test multiple folders and sequences. run_test 'flist +inbox +other -seq unseen -seq odd' \ 'inbox has 10 in sequence unseen; out of 10 inbox has 5 in sequence odd ; out of 10 other+ has 4 in sequence unseen; out of 4 other+ has 0 in sequence odd ; out of 4' # Test Flist-Order with -noalpha. echo 'Flist-Order: o* i*' >> $MH_TEST_DIR/Mail/.mh_profile run_test 'flists -seq unseen -seq odd -noalpha' \ 'other+ has 4 in sequence unseen; out of 4 other+ has 0 in sequence odd ; out of 4 inbox has 10 in sequence unseen; out of 10 inbox has 5 in sequence odd ; out of 10' # Test nonexistent folder. run_test 'flist +nonexistent -seq unseen' '' # Test nonexistent sequence. run_test 'flist +inbox -seq nonexistent' \ 'inbox+ has 0 in sequence nonexistent; out of 10' # Test -fast. folder -f +inbox > /dev/null run_test 'flist -sequence unseen -fast' 'inbox' run_test 'flist +other -sequence unseen -fast' 'other' # Test -fast and -alpha. run_test 'flists -seq unseen -fast -alpha' 'inbox other' exit $failed nmh-1.5/test/sequences/test-mark000755 007761 000765 00000004243 11762736346 016723 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test mark # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test # Test sequence creation. run_test 'mark 1 3 5 7 +inbox -sequence odd' '' run_test 'mark 2 4 6 8 10 +inbox -sequence even' '' run_test 'mark +inbox -seq odd -seq even -list' \ 'odd: 1 3 5 7 even: 2 4 6 8 10' # Test add. run_test 'mark 9 -sequence odd -add -nozero' '' run_test 'mark -seq odd -list' 'odd: 1 3 5 7 9' # Test delete. run_test 'mark 9 -sequence odd -delete' '' run_test 'mark -seq odd -list' 'odd: 1 3 5 7' # Test that -nozero is default run_test 'mark 9 -sequence odd -add' '' run_test 'mark -seq odd -list' 'odd: 1 3 5 7 9' # Test -zero run_test 'mark 10 -s even -add -zero' '' run_test 'mark -s even -list' 'even: 10' # Test add prior to last message; run_test 'mark 8 -s even -add' '' run_test 'mark -s even -list' 'even: 8 10' # Test list. run_test 'mark -s odd -list' 'odd: 1 3 5 7 9' # Try to mark message that doesn't exist. run_test 'mark 12' "mark: message 12 doesn't exist" # Try to mark nonexistent folder. run_test 'mark +nonexistent' \ "mark: unable to change directory to `mhpath +`/nonexistent: \ No such file or directory" # Test private sequence creation. # Set current message for following tests. folder +inbox 1 > /dev/null run_test 'mark 1 -sequence privateseq -add -nopublic' '' run_test 'mark -list' 'cur: 1 odd: 1 3 5 7 9 even: 8 10 privateseq (private): 1' # Test add to private sequence. run_test 'mark 2 -sequence privateseq -add -nopublic' '' run_test 'mark -list' 'cur: 1 odd: 1 3 5 7 9 even: 8 10 privateseq (private): 1-2' # Test private sequence list. run_test 'mark -sequence privateseq -list' 'privateseq (private): 1-2' # Test private sequence list with -public, which is apparently ignored. run_test 'mark -sequence privateseq -list -public' 'privateseq (private): 1-2' # Test mark on empty folder. folder -create +other > /dev/null run_test 'mark +other -sequence unseen all' 'mark: no messages in other' exit $failed nmh-1.5/test/scan/test-scan000755 007761 000765 00000002373 11762736346 015650 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test a simple scan. # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual cat > $expected <> 2 09/29 Test2 Testing message 2<> 3 09/29 Test3 Testing message 3<> 4 09/29 Test4 Testing message 4<> 5 09/29 Test5 Testing message 5<> 6 09/29 Test6 Testing message 6<> 7 09/29 Test7 Testing message 7<> 8 09/29 Test8 Testing message 8<> 9 09/29 Test9 Testing message 9<> 10 09/29 Test10 Testing message 10<> EOF scan -width 80 +inbox > $actual || exit 1 check "$expected" "$actual" exit $failed nmh-1.5/test/repl/test-if-str000755 007761 000765 00000002211 11762736346 016135 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test that an '%<(function)...' if-construct correctly # tests whether 'str' is empty if the function returns # a string, and tests 'value' if the function returns # an integer. # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test # create test replgroupcomps form=$MH_TEST_DIR/$$.replgroupcomps cat > $form <\n\ X-NUMBER: %(num)%(lit)%<(num 3) yes%| no%>\n\ X-NOSTRING: %(num 3)%(lit x)%<(lit) found%| missing%>\n\ X-NONUMBER: %(num 3)%(lit x)%<(num) yes%| no%>\n\ -------- EOF expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/Mail/draft cat > $expected < This is message number 1 EOF repl -editor true -format -form $form -group -nocc me -nowhatnowproc 1 || exit 1 check "$expected" "$actual" test ${failed:-0} -eq 0 && rm "$form" exit $failed nmh-1.5/test/repl/test-multicomp000755 007761 000765 00000002713 11762736346 016751 0ustar00kenhkenh000000 000000 #!/bin/sh # # See if we handle multiple components of the same name correctly. # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test # create test replcomps form="$MH_TEST_DIR/$$.replcomps" cat > "$form" < %(lit)%(formataddr %<{reply-to}%?{from}%>)\ %<(nonnull)%(void(width))%(putaddr To: )\n%>\ %(lit)%(formataddr{cc})\ %<(nonnull)%(void(width))%(putaddr cc: )\n%>\ %<{subject}Subject: Re: %{subject}\n%>\ -------- EOF cat > "${MH_TEST_DIR}/Mail/inbox/11" < To: Nowhere User cc: Mister User One Subject: This is a subject cc: Mister User Two Subject: that got continued on another line Date: 28 Sep 2006 03:04:05 -0400 This is a new test message EOF expected="$MH_TEST_DIR/$$.expected" actual="$MH_TEST_DIR/Mail/draft" cat > "$expected" < To: Test1 cc: Mister User One , Mister User Two Subject: Re: This is a subject that got continued on another line -------- Test1 writes: > This is a new test message EOF repl -editor true -cc cc -format -form $form -width 72 -nowhatnowproc 11 \ || exit 1 check "$expected" "$actual" test ${failed:-0} -eq 0 && rm "$form" exit $failed nmh-1.5/test/repl/test-trailing-newline000755 007761 000765 00000001665 11762736346 020215 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test to make sure repl doesn't put trailing spaces at the end of components # (like subject) # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test # create test replcomps form="$MH_TEST_DIR/$$.replcomps" cat > "$form" < %(lit)%(formataddr %<{reply-to}%?{from}%>)\ %<(nonnull)%(void(width))%(putaddr To: )\n%>\ %<{subject}Subject: Re: %{subject}\n%>\ -------- EOF expected="$MH_TEST_DIR/$$.expected" actual="$MH_TEST_DIR/Mail/draft" cat > "$expected" < To: Test1 Subject: Re: Testing message 1 -------- Test1 writes: > This is message number 1 EOF repl -editor true -format -form $form -nowhatnowproc 1 || exit 1 check "$expected" "$actual" test ${failed:-0} -eq 0 && rm "$form" exit $failed nmh-1.5/test/refile/test-refile000755 007761 000765 00000013106 11765267273 016511 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test refile # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual cd $MH_TEST_DIR folder -create +other -fast >/dev/null folder -create +another -fast >/dev/null # check with no options and no current message run_test 'refile' 'refile: no folder specified' # check with current message folder +inbox 4 >/dev/null run_test 'refile +other' '' run_test 'folders -noheader' \ 'another has no messages. inbox+ has 9 messages (1-10); cur=4. other has 1 message (1- 1). TOTAL = 10 messages in 3 folders.' # check with specified message folder +inbox 5 >/dev/null run_test 'refile 5 +other' '' run_test 'folders -noheader' \ 'another has no messages. inbox+ has 8 messages (1-10); cur=5. other has 2 messages (1- 2). TOTAL = 10 messages in 3 folders.' # check multiple messages run_test 'refile 6 7 +other' '' run_test 'folders -noheader' \ 'another has no messages. inbox+ has 6 messages (1-10); cur=7. other has 4 messages (1- 4). TOTAL = 10 messages in 3 folders.' # check multiple folders run_test 'refile 8 +other +another' '' run_test 'folders -noheader' \ 'another has 1 message (1- 1). inbox+ has 5 messages (1-10); cur=8. other has 5 messages (1- 5). TOTAL = 11 messages in 3 folders.' # check message number greater than highest run_test 'refile 11 +other' "refile: message 11 doesn't exist" folder -f +another >/dev/null # check -src run_test 'refile 9 -src +inbox +other' '' run_test 'folders -noheader' \ 'another has 1 message (1- 1). inbox+ has 4 messages (1-10); cur=9. other has 6 messages (1- 6). TOTAL = 11 messages in 3 folders.' # check -file run_test "refile -file $MH_TEST_DIR/Mail/inbox/10 +other" '' run_test 'folders -noheader' \ 'another has 1 message (1-1). inbox+ has 3 messages (1-3). other has 7 messages (1-7). TOTAL = 11 messages in 3 folders.' # check -file -, which isn't supported run_test "refile -file - +other <$MH_TEST_DIR/Mail/inbox/9" \ 'refile: missing argument to -file' run_test 'folders -noheader' \ 'another has 1 message (1-1). inbox+ has 3 messages (1-3). other has 7 messages (1-7). TOTAL = 11 messages in 3 folders.' run_test "refile -src +other all +inbox" run_test 'folders -noheader' \ 'another has 1 message (1- 1). inbox has 10 messages (1-10); cur=9. other+ has no messages. TOTAL = 11 messages in 3 folders.' # check -draft mv $MH_TEST_DIR/Mail/another/1 $MH_TEST_DIR/Mail/draft rmdir $MH_TEST_DIR/Mail/another run_test 'refile -draft +other' '' run_test 'folders -noheader' \ 'inbox has 10 messages (1-10); cur=9. other+ has 1 message (1- 1). TOTAL = 11 messages in 2 folders.' # check -link run_test 'refile 7 -src +inbox +other -link' '' run_test 'folders -noheader' \ 'inbox+ has 10 messages (1-10); cur=7. other has 2 messages (1- 2). TOTAL = 12 messages in 2 folders.' # inbox/7 and other/2 are linked. Modify one and verify # that the other changes as well. echo '' >>$MH_TEST_DIR/Mail/other/2 run_test "cmp $MH_TEST_DIR/Mail/inbox/7 $MH_TEST_DIR/Mail/other/2" '' # check -nolink run_test 'refile 7 +other -link -nolink' '' run_test 'folders -noheader' \ 'inbox+ has 9 messages (1-10); cur=7. other has 3 messages (1- 3). TOTAL = 12 messages in 2 folders.' # inbox/7 should no longer exist because it was moved, not linked. run_test 'scan +inbox 7' "scan: message 7 doesn't exist" # check -preserve run_test 'refile 10 +other -preserve' '' run_test 'folders -noheader' \ 'inbox+ has 8 messages (1- 9). other has 4 messages (1-10). TOTAL = 12 messages in 2 folders.' run_test 'scan +other last -format %(msg):%(decode{subject})' \ '10:Testing message 10' # check -nopreserve run_test 'refile 9 -src +inbox +other -preserve -nopreserve' '' run_test 'folders -noheader' \ 'inbox+ has 7 messages (1- 8). other has 5 messages (1-11). TOTAL = 12 messages in 2 folders.' run_test 'scan +other last -format %(msg):%(decode{subject})' \ '11:Testing message 9' # check -unlink run_test 'refile 3 -src +inbox +other -unlink' '' run_test 'folders -noheader' \ 'inbox+ has 6 messages (1- 8); cur=3. other has 6 messages (1-12). TOTAL = 12 messages in 2 folders.' if test -f $MH_TEST_DIR/Mail/inbox/,3; then echo "$0: refile -unlink failed" 1>&2 failed=`expr ${failed:-0} + 1` fi # check -nounlink run_test 'refile 2 +other -unlink -nounlink' '' run_test 'folders -noheader' \ 'inbox+ has 5 messages (1- 8); cur=2. other has 7 messages (1-13). TOTAL = 12 messages in 2 folders.' if test -f $MH_TEST_DIR/Mail/inbox/,2; then : else echo "$0: refile -nounlink failed" 1>&2 failed=`expr ${failed:-0} + 1` fi # test folder creation when stdin is not a tty refile first +newfolder "${MH_TEST_DIR}/Mail/draft" < To: Somebody Else Subject: Test This is a test . EOF cat > "${testname}.expected" < RCPT TO: DATA From: Mr Nobody To: Somebody Else Subject: Test Date: This is a test .. . QUIT EOF test_post "${testname}.actual" "${testname}.expected" # # Make sure a draft without a From: is rejected # cat > "${MH_TEST_DIR}/Mail/draft" < Subject: Blank Test This is a blank test EOF run_test "send -draft -server 127.0.0.1 -port $localport" \ "post: message has no From: header post: See default components files for examples post: re-format message and try again send: message not delivered to anyone" exit ${failed:-0} nmh-1.5/test/post/test-post-common.sh000755 007761 000765 00000001442 11762736346 017645 0ustar00kenhkenh000000 000000 #!/bin/sh # # Common routines for the post tests # set -e . "${MH_OBJ_DIR}/test/common.sh" setup_test localport=65412 testname="${MH_TEST_DIR}/$$" # # Set this for the EHLO command # echo "clientname: nosuchhost.example.com" >> ${MHMTSCONF} # # One "post" test run. Ok, yeah, we're using "send", but that's just # because it's easier. # test_post () { "${MH_OBJ_DIR}/test/fakesmtp" "$1" $localport & pid="$!" send -draft -server 127.0.0.1 -port $localport || exit 1 wait ${pid} # # It's hard to calculate the exact Date: header post is going to # use, so we'll just use sed to remove the actual date so we can easily # compare it against our "correct" output. # sed -e 's/^Date:.*/Date:/' "$1" > "$1".nodate rm -f "$1" check "$1".nodate "$2" } nmh-1.5/test/post/test-post-dcc000755 007761 000765 00000001732 11762736346 016477 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test the behavior of post with multiple recipients (& dcc) # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "${srcdir}/test/post/test-post-common.sh" # # Dcc test # cat > "${MH_TEST_DIR}/Mail/draft" < To: Somebody One , Somebody Two Subject: Test Dcc Dcc: Somebody Three This is test of Dcc recipients. EOF cat > "${testname}.expected" < RCPT TO: RCPT TO: RCPT TO: DATA From: Mr Nobody To: Somebody One , Somebody Two Subject: Test Dcc Date: This is test of Dcc recipients. . QUIT EOF test_post "${testname}.actual" "${testname}.expected" exit ${failed:-0} nmh-1.5/test/post/test-post-envelope000755 007761 000765 00000010131 11762736346 017554 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test the setting of the envelope-from address for SMTP # # Note here we use multiple From: addresses for some tests so we pick up # some cases skipped in other tests. # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "${srcdir}/test/post/test-post-common.sh" # # Sender # cat > "${MH_TEST_DIR}/Mail/draft" <, Mr Nobody Two Sender: Mr Nobody Three To: Somebody Else Subject: Sender test This is a test of the Sender header. EOF cat > "${testname}.0.expected" < RCPT TO: DATA From: Mr Nobody One , Mr Nobody Two Sender: Mr Nobody Three To: Somebody Else Subject: Sender test Date: This is a test of the Sender header. . QUIT EOF test_post "${testname}.0.actual" "${testname}.0.expected" # # Check to see if Envelope-From overrides Sender # cat > "${MH_TEST_DIR}/Mail/draft" <, Mr Nobody Two Sender: Mr Nobody Three Envelope-From: Mr Nobody Four To: Somebody Else Subject: Envelope-From test This is a test of the Envelope-From header. EOF cat > "${testname}.1.expected" < RCPT TO: DATA From: Mr Nobody One , Mr Nobody Two Sender: Mr Nobody Three To: Somebody Else Subject: Envelope-From test Date: This is a test of the Envelope-From header. . QUIT EOF test_post "${testname}.1.actual" "${testname}.1.expected" # # See if Envelope-From will generate a Sender: header with multiple From: # addresses # cat > "${MH_TEST_DIR}/Mail/draft" <, Mr Nobody Two Envelope-From: Mr Nobody Four To: Somebody Else Subject: Envelope-From and Sender test This is a test of the Envelope-From and Sender headers. EOF cat > "${testname}.2.expected" < RCPT TO: DATA From: Mr Nobody One , Mr Nobody Two To: Somebody Else Subject: Envelope-From and Sender test Date: Sender: nobody4@example.com This is a test of the Envelope-From and Sender headers. . QUIT EOF test_post "${testname}.2.actual" "${testname}.2.expected" # # And make sure we do NOT get a Sender with only one From: # cat > "${MH_TEST_DIR}/Mail/draft" < Envelope-From: Mr Nobody Five To: Somebody Else Subject: Solo Envelope-From test This is a solo test of the Envelope-From header. EOF cat > "${testname}.3.expected" < RCPT TO: DATA From: Mr Nobody One To: Somebody Else Subject: Solo Envelope-From test Date: This is a solo test of the Envelope-From header. . QUIT EOF test_post "${testname}.3.actual" "${testname}.3.expected" # # Make sure blank Envelope-From does what we expect it to # cat > "${MH_TEST_DIR}/Mail/draft" < Envelope-From: To: Somebody Else Subject: Blank Envelope-From test This is a blank test of the Envelope-From header. EOF cat > "${testname}.4.expected" < RCPT TO: DATA From: Mr Nobody One To: Somebody Else Subject: Blank Envelope-From test Date: This is a blank test of the Envelope-From header. . QUIT EOF test_post "${testname}.4.actual" "${testname}.4.expected" exit ${failed:-0} nmh-1.5/test/post/test-post-fcc000755 007761 000765 00000002211 11762736346 016472 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test the Fcc: feature of post # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "${srcdir}/test/post/test-post-common.sh" # # Basic test - Simple message, single user, single recipient. Note that # we test dot-stuffing here as well. # cat > "${MH_TEST_DIR}/Mail/draft" < To: Somebody Else Subject: Fcc test Fcc: +inbox This is a fcc test EOF cat > "${testname}.expected" < RCPT TO: DATA From: Mr Nobody To: Somebody Else Subject: Fcc test Date: This is a fcc test . QUIT EOF test_post "${testname}.actual" "${testname}.expected" cat > "${testname}.msg.expected" < To: Somebody Else Subject: Fcc test Date: This is a fcc test EOF msgname=`mhpath +inbox 11` sed -e 's/^Date:.*/Date:/' "${msgname}" > "${msgname}".nodate check "${testname}.msg.expected" "${msgname}".nodate exit ${failed:-0} nmh-1.5/test/post/test-post-group000755 007761 000765 00000001533 11762736346 017101 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test the behavior of post when using group addresses # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "${srcdir}/test/post/test-post-common.sh" # # Group test # cat > "${MH_TEST_DIR}/Mail/draft" < To: our-group: Somebody One Somebody Two ; Subject: Group test This is test of group recipients. EOF cat > "${testname}.expected" < RCPT TO: RCPT TO: DATA From: Mr Nobody To: our-group: ; Subject: Group test Date: This is test of group recipients. . QUIT EOF test_post "${testname}.actual" "${testname}.expected" exit ${failed:-0} nmh-1.5/test/post/test-post-multifrom000755 007761 000765 00000002442 11762736346 017763 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test the behavior of post with multiple from addresses # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "${srcdir}/test/post/test-post-common.sh" # # This SHOULD error # cat > "${MH_TEST_DIR}/Mail/draft" <, Mr Nobody Two To: Somebody Else Subject: Test multi-from This is a test of multi-from. EOF # # Since this should fail, don't run fakesmtp # run_test "send -draft -server 127.0.0.1 -port $localport" \ "post: A Sender: or Envelope-From: header is required with multiple From: addresses post: re-format message and try again send: message not delivered to anyone" # # This should also error # cat > "${MH_TEST_DIR}/Mail/draft" <, Mr Nobody Two To: Somebody Else Subject: Test multi-from Envelope-From: This is a test of multi-from with blank Envelope-From. EOF run_test "send -draft -server 127.0.0.1 -port $localport" \ "post: Envelope-From cannot be blank when there is multiple From: addresses and no Sender: header post: re-format message and try again send: message not delivered to anyone" exit ${failed:-0} nmh-1.5/test/post/test-post-multiple000755 007761 000765 00000001652 11762736346 017602 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test the behavior of post with multiple recipients # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "${srcdir}/test/post/test-post-common.sh" # # Multiple recipients test # cat > "${MH_TEST_DIR}/Mail/draft" < To: Somebody One , Somebody Two Subject: Test multiple This is test of multiple recipients. EOF cat > "${testname}.expected" < RCPT TO: RCPT TO: DATA From: Mr Nobody To: Somebody One , Somebody Two Subject: Test multiple Date: This is test of multiple recipients. . QUIT EOF test_post "${testname}.actual" "${testname}.expected" exit ${failed:-0} nmh-1.5/test/pick/test-pick000755 007761 000765 00000012553 11765131762 015647 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test pick # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Add an 11th message. sed \ -e 's/10/11/g' \ -e 's/^To:\(.*\)/To:\1\ Cc: /' \ -e 's/^\(Date:.*\)2006\( 00:00:\)00/\12008\200\ Delivery-Date: \12009\241/' \ $MH_TEST_DIR/Mail/inbox/10 >$MH_TEST_DIR/Mail/inbox/11 # Test message specification. run_test 'pick first last' '1 11' # Test -and. run_test 'pick -subject message.3 -and -from Test3' '3' run_test 'pick -subject message.3 -and -from Test4' \ 'pick: no messages match specification 0' # Test -or. run_test 'pick -subject message.3 -or -from Test3' '3' run_test 'pick -subject message.3 -or -from Test4' '3 4' # Test -not. run_test 'pick -not -subject message.8 last:5' '7 9 10 11' # Test -lbrace, -rbrace. run_test 'pick -subject message.12 -and -subject message.3 -or -from Test4' '4' run_test 'pick -subject message.12 -and -lbrace -subject message.3 -rbrace' \ 'pick: no messages match specification 0' # -and takes precedence over -or. run_test 'pick -subject message.12 -or -subject message.3 -and -from Test3' '3' run_test 'pick -subject message.12 -or -subject message.3 -and -from Test4' \ 'pick: no messages match specification 0' # -not takes precedence over -and. run_test 'pick -not -subject message.12 -and -subject message.3' '3' run_test 'pick -not -lbrace -subject NoMatch -and -subject message.3 -rbrace' \ '1 2 3 4 5 6 7 8 9 10 11' # Test MHPDEBUG. MHPDEBUG=1 pick -not -lbrace -subject NoMatch -and -subject message.3 -rbrace \ >/dev/null 2>$actual cat >$expected <$actual 2>/dev/null` >/dev/null cat >$expected </dev/tty; then # Produce no standard output if no messages match and standard # output is a tty. To test that even when run with stdout # detached, write directly to /dev/tty. Can't capture the # output so hopefully the user will notice it. pick -subject message.3 -and -from Test4 >/dev/tty 2>/dev/null else echo "$0: skip tty test because can't write to /dev/tty" fi # Also, check that the exit status is 1. pick -subject message.3 -and -from Test4 >/dev/null 2>&1 run_test "echo $?" '1' set -e # Test -cc. run_test 'pick -cc another' '11' # Test -date. run_test 'pick -date 29.Sep.2008' '11' # Test -from. run_test 'pick -from test7' '7' # Test -search. run_test 'pick -search This.is.message.number.[456]' '4 5 6' # Test -subject. run_test 'pick -subject message.2' '2' # Test -to. run_test 'pick -to some -nolist' '11 hits' run_test 'pick -to user@example.com -nolist' '11 hits' # Test -after. pick -after '28 Sep 2008 00:00:00' >$actual 2>&1 cat >$expected <$actual 2>/dev/null set -e cat >$expected <$actual 2>&1 cat >$expected <$actual 2>&1 cat >$expected <$actual 2>/dev/null set -e cat >$expected <$actual 2>/dev/null set -e cat >$expected <$actual 2>&1 cat >$expected < /dev/null run_test 'pick -date 29.Sep.2008 -sequence privateseq -nopublic' '1 hit' run_test 'mark -list' 'cur: 1 even: 2 4 6 8 10 privateseq (private): 11' # Test add to private sequence. run_test 'pick first -sequence privateseq -nozero -nopublic' '1 hit' run_test 'mark -list' 'cur: 1 even: 2 4 6 8 10 privateseq (private): 1 11' # Test sequence creation, with -list. run_test 'pick 5 7 -sequence odd -list' '5 7' run_test 'mark -s odd -list' 'odd: 5 7' # Test sequence creation, with default of -zero. run_test 'pick 1 3 -sequence odd' '2 hits' run_test 'mark -s odd -list' 'odd: 1 3' # Test sequence creation, with -nozero. run_test 'pick 5 7 9 -sequence odd -nozero' '3 hits' run_test 'mark -s odd -list' 'odd: 1 3 5 7 9' # Test sequence creation, with explicit folder, -public, and -zero. run_test 'pick +inbox 5 7 9 11 -public -sequence odd' '4 hits' run_test 'mark -s odd -list' 'odd: 5 7 9 11' # Test -nolist. run_test 'pick all -nolist' '11 hits' exit $failed nmh-1.5/test/pick/test-stderr000755 007761 000765 00000001430 11762736346 016222 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test that errors are not written to stdout. # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected_err=$MH_TEST_DIR/$$.expected_err expected_out=$MH_TEST_DIR/$$.expected_out actual_err=$MH_TEST_DIR/$$.actual_err actual_out=$MH_TEST_DIR/$$.actual_out # Error message should go to stderr. cat > $expected_err < $expected_out pick -a > $actual_out 2> $actual_err check "$expected_err" "$actual_err" check "$expected_out" "$actual_out" nmh-1.5/test/new/test-basic000755 007761 000765 00000011104 11762736346 015642 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test many basic nmh capabilities. # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test folders=$MH_TEST_DIR/Mail/.folders expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # make second folder cp -r $MH_TEST_DIR/Mail/inbox $MH_TEST_DIR/Mail/foo1 cp -r $MH_TEST_DIR/Mail/inbox $MH_TEST_DIR/Mail/foo2 # but only list inbox and foo2 in .folders, and sorted differently cat > $folders < $expected < $actual 2>&1 check $expected $actual # test with no desired messages cat > $expected < $actual 2>&1 check $expected $actual 'keep first' new -folders $folders aseq > $actual 2>&1 check $expected $actual # test fnext/fprev with no desired messages cat /dev/null > $expected fnext aseq > $actual 2>&1 check $expected $actual 'keep first' fprev aseq > $actual 2>&1 check $expected $actual # add 1 desired message in each folder echo 'aseq: 1' > $MH_TEST_DIR/Mail/inbox/.mh_sequences echo 'aseq: 1' > $MH_TEST_DIR/Mail/foo1/.mh_sequences echo 'aseq: 1' > $MH_TEST_DIR/Mail/foo2/.mh_sequences # test with all folders cat > $expected < $actual 2>&1 check $expected $actual # test with .folders cat > $expected < $actual 2>&1 check $expected $actual # add 2 desired messages to another sequence in each folder echo 'bseq: 3-4' >> $MH_TEST_DIR/Mail/inbox/.mh_sequences echo 'bseq: 3-4' >> $MH_TEST_DIR/Mail/foo1/.mh_sequences echo 'bseq: 3-4' >> $MH_TEST_DIR/Mail/foo2/.mh_sequences # test listing aseq and bseq cat > $expected < $actual 2>&1 check $expected $actual 'keep first' # set aseq bseq as unseen echo 'Unseen-Sequence: aseq bseq' >> $MH new > $actual 2>&1 check $expected $actual # test unseen cat > $expected <> 3 09/29 Test3 Testing message 3<> 4 09/29 Test4 Testing message 4<> 3 aseq bseq messages in foo2 1 09/29 Test1 Testing message 1<> 3 09/29 Test3 Testing message 3<> 4 09/29 Test4 Testing message 4<> 3 aseq bseq messages in inbox (*: current folder) 1 09/29 Test1 Testing message 1<> 3 09/29 Test3 Testing message 3<> 4 09/29 Test4 Testing message 4<> EOF unseen > $actual 2>&1 check $expected $actual # test fnext with the current folder not in the list echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context echo 'inbox 1 3-4' > $expected fnext -folders $folders > $actual 2>&1 check $expected $actual # test fprev with the current folder not in the list echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context echo 'inbox 1 3-4' > $expected fprev -folders $folders > $actual 2>&1 check $expected $actual # test fnext with current folder in the middle of the list echo 'Current-Folder: foo2' > $MH_TEST_DIR/Mail/context echo 'inbox 1 3-4' > $expected fnext > $actual 2>&1 check $expected $actual # test fprev with current folder in the middle of the list echo 'Current-Folder: foo2' > $MH_TEST_DIR/Mail/context echo 'foo1 1 3-4' > $expected fprev > $actual 2>&1 check $expected $actual # test fprev with current folder at the beginning of the list echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail/context echo 'inbox 1 3-4' > $expected fprev > $actual 2>&1 check $expected $actual # test fnext with current folder at the end of the list echo 'Current-Folder: inbox' > $MH_TEST_DIR/Mail/context echo 'foo1 1 3-4' > $expected fnext > $actual 2>&1 check $expected $actual # test fnext with no current folder rm $MH_TEST_DIR/Mail/context echo 'foo1 1 3-4' > $expected fnext > $actual 2>&1 check $expected $actual # test fnext with only one folder in the list cat > $folders < $expected fnext -folders $folders > $actual 2>&1 check $expected $actual exit $failed nmh-1.5/test/mhstore/test-mhstore000755 007761 000765 00000016563 11762736346 017150 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test mhstore # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual cd $MH_TEST_DIR # check with no options and no current message run_test 'mhstore' 'mhstore: no cur message' # check with no options and current message folder +inbox 5 > /dev/null cat > $expected <&1 | \ sed 's/.*as file //'` check $expected $stored_contents # check message number greater than highest run_test 'mhstore 11' "mhstore: message 11 doesn't exist" # check multiple messages run_test 'mhstore 4 6' 'storing message 4 as file 4.txt storing message 6 as file 6.txt' cat > $expected < $expected < $msgfile < $expected < $expected < $expected < $expected < $expected < $expected < $expected < $MH_TEST_DIR/$$.tmp mv -f $MH_TEST_DIR/$$.tmp $msgfile run_test 'mhstore last -part 2 -check' \ 'storing message 11 part 2 as file 11.2.txt mhstore: content integrity suspect (digest mismatch) -- continuing (content text/plain in message 11, part 2)' check $expected 11.2.txt 'keep first' # check -nocheck, the default run_test 'mhstore last -part 2 -check -nocheck' \ 'storing message 11 part 2 as file 11.2.txt' check $expected 11.2.txt # check reassembly of message/partial messages (RFC 1521, 7.3.2) msgfile=`mhpath new` cat > $msgfile < $msgfile < $msgfile < $expected <> $MH cat > $expected < $MH.new mv -f $MH.new $MH run_test 'mhstore 11 -part 4' \ "storing message 11 part 4 as file $storagedir/11.4.txt" check $expected "$absstoragedir/11.4.txt" 'keep first' # check with absolute nmh-storage profile component and -auto run_test 'mhstore 11 -part 4 -auto' \ "storing message 11 part 4 as file $storagedir/test4.txt" check $expected "$absstoragedir/test4.txt" rmdir "$absstoragedir" exit $failed nmh-1.5/test/mhshow/test-cte-binary000755 007761 000765 00000002227 11762736346 017340 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test Content-Transfer-Encoding: binary (Debian #136976). # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Write message with Content-Transfer-Encoding: binary text. msgfile=`mhpath new` msgnum=`basename $msgfile` cat > $msgfile < Date: Tue, 05 Mar 2002 18:20:35 +0000 This is a test; this is the body. EOF # check it cat > $expected < $actual 2>&1 check "$expected" "$actual" exit $failed nmh-1.5/test/mhshow/test-qp000755 007761 000765 00000002475 11762736346 015730 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test quoted-printable decoding. # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Write message with bogus quoted-printable data. msgfile=`mhpath new` msgnum=`basename $msgfile` cat > $msgfile < $expected < $actual 2>&1 check "$expected" "$actual" exit $failed nmh-1.5/test/mhshow/test-subpart000755 007761 000765 00000002417 11762736346 016764 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test show of one part, fixed by # 31cba404636730df219dd009ca5893ccc56d46af # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Write message with a text/plain subpart. msgfile=`mhpath new` msgnum=`basename $msgfile` cat > $msgfile < $expected < $actual 2>&1 check "$expected" "$actual" exit $failed nmh-1.5/test/mhpath/test-mhpath000755 007761 000765 00000006370 11765267273 016544 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test mhpath # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # check -help cat > $expected < $actual 2>&1 set -e check $expected $actual # check -version, which returns non-zero exit status set +e case `mhpath -v` in mhpath\ --*) ;; * ) echo "$0: mhpath -v generated unexpected output" 1>&2 failed=`expr ${failed:-0} + 1`;; esac set -e # check + run_test "mhpath +" "$MH_TEST_DIR/Mail" # check with no options folder -fast +inbox > /dev/null run_test "mhpath" "$MH_TEST_DIR/Mail/inbox" # check +inbox run_test "mhpath +inbox" "$MH_TEST_DIR/Mail/inbox" # check all cat > $expected < $actual 2>&1 check $expected $actual # check message number greater than highest run_test "mhpath 11" "mhpath: message 11 out of range 1-10" run_test "mhpath 10 11" "mhpath: message 11 out of range 1-10" # check range with message number greater than highest cat > $expected < $actual 2>&1 check $expected $actual # check new run_test "mhpath new" "$MH_TEST_DIR/Mail/inbox/11" # check multiple msgs, including new cat > $expected < $actual 2>&1 check $expected $actual # check invalid message list using names run_test "mhpath last-new" "mhpath: bad message list last-new" # check cur folder +inbox 5 > /dev/null run_test "mhpath cur" "$MH_TEST_DIR/Mail/inbox/5" # check prev run_test "mhpath prev" "$MH_TEST_DIR/Mail/inbox/4" # check next run_test "mhpath next" "$MH_TEST_DIR/Mail/inbox/6" # check invalid message list using numbers rmm 1-2 run_test "mhpath 1-2" "mhpath: no messages in range 1-2" # check ignoring of out-of-range message numbers in ranges run_test "mhpath 1-3" "$MH_TEST_DIR/Mail/inbox/3" run_test "mhpath first-3" "$MH_TEST_DIR/Mail/inbox/3" run_test "mhpath 10-11" "$MH_TEST_DIR/Mail/inbox/10" run_test "mhpath last-11" "$MH_TEST_DIR/Mail/inbox/10" # check reference to existing messages cat > $expected < $actual 2>&1 check $expected $actual # check reference to non-existant messages cat > $expected < $actual 2>&1 check $expected $actual exit $failed nmh-1.5/test/mhparam/test-mhparam000755 007761 000765 00000007653 11765267273 017061 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test mhparam # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected expected_err=$MH_TEST_DIR/$$.expected_err actual=$MH_TEST_DIR/$$.actual actual_err=$MH_TEST_DIR/$$.actual_err # check -help cat >$expected <$actual 2>&1 set -e check $expected $actual # check -version, which returns non-zero exit status set +e case `mhparam -v` in mhparam\ --*) ;; * ) echo "$0: mhparam -v generated unexpected output" 1>&2 failed=`expr ${failed:-0} + 1`;; esac set -e # check unknown option run_test 'mhparam -nonexistent' 'mhparam: -nonexistent unknown' # check -all cp $MH_TEST_DIR/Mail/.mh_profile $expected # -all adds current folder echo 'Current-Folder: '`folder -f` >>$expected mhparam -all >$actual check $expected $actual 'keep first' # check -all with a component echo 'mhparam: profile-components ignored with -all' >$expected_err mhparam -all path >$actual 2>$actual_err check $expected $actual 'keep first' check $expected_err $actual_err # check -all with -components echo 'mhparam: -components ignored with -all' >$expected_err mhparam -all -components >$actual 2>$actual_err check $expected $actual check $expected_err $actual_err # check one component run_test 'mhparam path' "$MH_TEST_DIR/Mail" # check more than one component, which enables -component echo 'AliasFile: aliases' >>"$MH_TEST_DIR/Mail/.mh_profile" run_test 'mhparam path AliasFile' "path: $MH_TEST_DIR/Mail AliasFile: aliases" # check each component in procs array in uip/mhparam.c # The tests don't override these, so they're default or configured values. # Note that cat is hardcoded here because the testsuite uses it for moreproc. cat >$expected <$actual 2>&1 check $expected $actual #### This exits with non-zero status, so let run_test squash that: run_test 'mhparam faceproc formatproc rmmproc' '' #### Test sbackup separately because it's only passed as a -D compile option. case `mhparam sbackup` in ,|\#) ;; * ) echo mhparam sbackup failed failed=`expr ${failed:-0} + 1` ;; esac # check -component run_test 'mhparam -component Path' "Path: $MH_TEST_DIR/Mail" # check -component, note that component name of argument is echoed exactly run_test 'mhparam -component path' "path: $MH_TEST_DIR/Mail" run_test 'mhparam -component PATH' "PATH: $MH_TEST_DIR/Mail" # check -nocomponent run_test 'mhparam -component -nocomponent path' "$MH_TEST_DIR/Mail" run_test 'mhparam -nocomponent path AliasFile' "$MH_TEST_DIR/Mail aliases" # check nonexistent component run_test 'mhparam nonexistent' '' # check that return status counts nonexistent components set +e mhparam path context nonexistent1 nonexistent2 nonexistent3 >/dev/null run_test "echo $?" 3 set -e # mhparam -debug (undocumented) # Some of its output depends on configure options, so don't bother to # check for correctness here. mhparam -debug >/dev/null exit $failed nmh-1.5/test/mhlist/test-mhlist000755 007761 000765 00000012710 11762736346 016574 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test mhlist # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # check with no options and no current message run_test 'mhlist' 'mhlist: no cur message' # check with no options and current message folder +inbox 5 > /dev/null cat > $expected < $actual 2>&1 check $expected $actual 'keep first' # check -noheaders run_test 'mhlist 5 -noheaders' ' 5 text/plain 25' # check -headers mhlist -noheaders -headers > $actual 2>&1 check $expected $actual 'keep first' # check with folder and current message mhlist +inbox > $actual 2>&1 check $expected $actual 'keep first' # check with specified message mhlist 5 > $actual 2>&1 check $expected $actual 'keep first' # check -file mhlist -file "$MH_TEST_DIR/Mail/inbox/5" > $actual 2>&1 check $expected $actual # check -file - cat > $expected < $actual 2>&1 check $expected $actual # check message number greater than highest run_test 'mhlist 11' "mhlist: message 11 doesn't exist" # check multiple messages cat > $expected < $actual 2>&1 check $expected $actual # Write message with a text/plain subpart. msgfile=`mhpath new` cat > $msgfile < $MH_TEST_DIR/$$.tmp mv -f $MH_TEST_DIR/$$.tmp $msgfile run_test 'mhlist last -part 2 -noheader -check' \ ' 11 multipart/mixed 936 1 multipart/related 180 2 text/plain 36 mhlist: content integrity suspect (digest mismatch) -- continuing (content text/plain in message 11, part 2)' # check -nocheck, the default run_test 'mhlist last -part 2 -noheader -check -nocheck' \ ' 11 multipart/mixed 936 1 multipart/related 180 2 text/plain 36' # check -verbose run_test 'mhlist 11 -verbose -noheader' \ ' 11 multipart/mixed 936 boundary="----- =_aaaaaaaaaa0" 1 multipart/related 180 type="multipart/alternative" boundary="subpart__1.1" 1.1 text/plain 49 charset="iso-8859-1" 2 text/plain 36 charset="iso-8859-1" 3 text/plain 35 charset="iso-8859-1" name="test3" 4 text/plain 36 charset="iso-8859-1"' exit $failed nmh-1.5/test/mhbuild/test-forw000755 007761 000765 00000004417 11762736346 016402 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test forwarding messages (including RFC-934 mode). # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test # Make a draft file forwarding two messages. mkdraft() { cat > $draft <][^>]*>/\1 /' $draft > $actual } draft="$MH_TEST_DIR/$$.draft" draftorig="$MH_TEST_DIR/,$$.draft.orig" expected="$MH_TEST_DIR/$$.expected" actual="$MH_TEST_DIR/$$.actual" # check mhbuild cat > $expected < Content-Description: forwarded messages ------- =_aaaaaaaaaa0 Content-Type: message/rfc822 From: Test1 To: Some User Date: Fri, 29 Sep 2006 00:00:00 Subject: Testing message 1 This is message number 1 ------- =_aaaaaaaaaa0 Content-Type: message/rfc822 From: Test2 To: Some User Date: Fri, 29 Sep 2006 00:00:00 Subject: Testing message 2 This is message number 2 ------- =_aaaaaaaaaa0-- EOF mkdraft mhbuild $draft mungedraft check $expected $actual test ${failed:-0} -eq 0 && rm "$draft" "$draftorig" # check mhbuild -rfc934 cat > $expected < Content-Description: forwarded messages ------- =_aaaaaaaaaa0 From: Test1 To: Some User Date: Fri, 29 Sep 2006 00:00:00 Subject: Testing message 1 This is message number 1 ------- =_aaaaaaaaaa0 From: Test2 To: Some User Date: Fri, 29 Sep 2006 00:00:00 Subject: Testing message 2 This is message number 2 ------- =_aaaaaaaaaa0-- EOF mkdraft mhbuild -rfc934 $draft mungedraft check $expected $actual test ${failed:-0} -eq 0 && rm "$draft" "$draftorig" exit $failed nmh-1.5/test/manpages/test-manpages000755 007761 000765 00000001663 11762736346 017367 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test that the manpages don't have any syntax errors # as detected by groff. # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test require_prog groff cd ${MH_INST_DIR}${mandir} || exit 1 # groff will still exit with status zero even if warnings # were emitted, so we have to jump through hoops to # find out if any were emitted. expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # There aren't any expected warnings at the moment but # this mechanism does let us add them if necessary later. rm -f "$expected" "$actual" touch "$expected" "$actual" for manpage in man?/*.?; do groff -Tutf8 -mandoc -ww "$manpage" > /dev/null 2>>"$actual" done check "$expected" "$actual" exit $failed nmh-1.5/test/install-mh/test-install-mh000755 007761 000765 00000003231 11762736346 020112 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test install-mh # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test # check with no options, with nmh already installed run_test "install-mh" \ 'install-mh: You already have an nmh profile, use an editor to modify it' # check -auto, with nmh already installed run_test "install-mh -auto" 'install-mh: invocation error' # check -check, with nmh already installed run_test "install-mh -check" '' # make sure exit status is 0 install-mh -check run_test "echo $?" '0' # Remove the nmh installation so that install-mh can install. rm -rf $MH_TEST_DIR/Mail # check -check, with nmh not installed run_test "install-mh -check" '' # make sure exit status is 1 set +e install-mh -check run_test "echo $?" '1' set -e # check with no options, with nmh not installed. Use canned # responses to install. installpath=`echo $MH_TEST_DIR/Mail | sed 's%^/%%'` echo "n n n $installpath y" | install-mh >/dev/null if [ -f $MH_TEST_DIR/Mail/context -a -f $MH_TEST_DIR/Mail/.mh_profile ]; then install-mh -check else failed=`expr ${failed:-0} + 1` fi # Remove the nmh installation so that install-mh -auto can install. # And set HOME to that it installs in the test directory: # install-mh -auto does a chdir($HOME). rm -rf $MH_TEST_DIR/Mail HOME=$MH_TEST_DIR install-mh -auto >/dev/null if [ -f $MH_TEST_DIR/Mail/context -a -f $MH_TEST_DIR/Mail/.mh_profile ]; then install-mh -check else failed=`expr ${failed:-0} + 1` fi exit $failed nmh-1.5/test/inc/deb359167.mbox000644 007761 000765 00000006374 11762736346 015773 0ustar00kenhkenh000000 000000 From KKKKKKK@KKKKKK.KKKKKKKK.KKK.KK KKK KKK 00 00:00:00 0000 KKKKKKKK: KKKK [000.00.000.000] ([000.00.000.000] KKKK=000.00.000.000) KK KKKKKK.KKKKKKKK.KKK.KK (KKKKKK KKKK 0.00 #0) KKKK KKKK (KKKKKK-KKKK KKKKKKK@KKKKK.KKK) KK 0KKK0K-0000KK-00 KKK KKKKKKKK@KKKKKKKKKKK.KKK.KK; KKK, 00 KKK 0000 00:00:00 +0000 K-KKKKK-KKKKKKK: (KKKKKK.KKKKKKKK.KKK.KK) KKKKKKK KKK: 000.00.000.000: KKKKK KKKKKK KKK KKK KKKKKK KKK 000.000.00.000.KK-KKKK.KKKK: KK KKKK KKKKKK K-KKKKK-KKKKKKK: (KKKKKK.KKKKKKKK.KKK.KK) KKKK KKKK KK KKKKKKKK-KKKKKKKKKKK (KKK-KKK.KKKKKKKK.KKK: KKKK://KKK.KKKKKKKK.KKK/KKKKK/KK?KK=000.00.000.000) K-KKKKK-KKKKKKK: (KKKKKK.KKKKKKKK.KKK.KK) KKKKKKK KKKK-KKKK: [00.00.0.00.] 000 KKKKK, KK KKKKKKK KKKK KK KKKK KKKK. (#0.0.0) KKKKKKKK: KKKK [000.00.000.000] ([000.00.000.000]) KK KKKKKK.KKKKKKKK.KKK.KK (KKKKK K0.0.0) KKKK KKKK KK KKKKK-00000-0000000-0; 00 KKK 0000 00:00:00 +0000 (KKK) KKKKKKK-KK: KKKK: KKKKKK K. KKKKKK KK: KKKKKKKK@KKKKKKKKKKK.KKK.KK KKKKKKK: KKK KKKKKKK - KKK KKKKK! KKKK: KKK, 00 KKK 0000 00:00:00 +0000 KKKK-KKKKKKK: 0.0 KKKKKKK-KKKK: KKKKKKKKK/KKKKKKKKKKK; KKKKKKKK="----=_KKKKKKKK_000_0000_0K0000KK.00K000K0" K-KKKKKKKK: 0 K-KKKKKK-KKKKKKKK: KKKKKK K-KKKKKK: KKKKKKKKK KKKKKKK KKKKKKK K0.00.0000.0000 K-KKKKKKK: KKKKKKKK KK KKKKKKKKK KKKKKKK K0.00.0000.0000 K-KKK-KKKKKKK: (KKK-KKK.KKKKKKKK.KKK) KKKK://KKK.KKKKKKKK.KKK/KKKKK/KK?KK=000.00.000.000 K-KKK-KKKKKKK: (KKK.KKKKKKK.KKK) KKKKKKK - KKK KKKK://KKK.KKKKKKK.KKK/KKKKKK.KKK?KK=000.00.000.000 KKKK KK K KKKKK-KKKK KKKKKKK KK KKKK KKKKKK. ------=_KKKKKKKK_000_0000_0K0000KK.00K000K0 KKKKKKK-KKKK: KKKK/KKKKK; KKKKKKK="KKK-0000-0" KKKKKKK-KKKKKKKK-KKKKKKKK: 0KKK KKKK KKKKKK KK KKKKK KKKKKKK - KKKKK KKKKKK KK K.K.K. KKKKKKK - KKKKKKK KK K KKKK KKK KKKK KKKKKKKKKK KKK KKKKKKK KKKKK, KKKKK KKKKKKKK, KKKKK KKKKKKK, KKKKKKK, KKKKKK KKKKKK .. KKK 00 KKKKK KKKK KKKKKK KKKKKKKKKKKKK. KKKK://000.KKK-KKK-KKKKKKK.KKK KKK KKKKKKK KKK KKK KKKK $000.00 - $000.00! ________________________________ KK KKKKKK KKKK KKKK KKKKKKKKKKK, KK KKKK ------=_KKKKKKKK_000_0000_0K0000KK.00K000K0 KKKKKKK-KKKK: KKKK/KKKK; KKKKKKK="KKK-0000-0" KKKKKKK-KKKKKKKK-KKKKKKKK: KKKKKK-KKKKKKKKK = KKKK KKKKKK KK KKKKK KKKKKKK - KKKKK KKKKKK KK K.K.K. KKKKKKK - KKKKKKK KK K KKKK KKK KKKK KKKKKKKKKK KKK KKKKKKK KKKKK, KKKKK KKKKKKKK, KKKKK KKKKKKK, KKKKKKK, KKKKKK KKKKKK .. KKK 00 KKKKK KKKK KKKKKK KKKKKKKKKKKKK. KKKK://000.KKK-KKK-KKKKKKK.KKK KKK KKKKKKK KKK KKK KKKK $000.00 - $000.00! ________________________________ KK KKKKKK KKKK KKKK KKKKKKKKKKK, KK KKKK ------=_KKKKKKKK_000_0000_0K0000KK.00K000K0-- nmh-1.5/test/inc/filler.txt000644 007761 000765 00000041411 11762736346 015660 0ustar00kenhkenh000000 000000 CHAPTER I. MR. SHERLOCK HOLMES. IN the year 1878 I took my degree of Doctor of Medicine of the University of London, and proceeded to Netley to go through the course prescribed for surgeons in the army. Having completed my studies there, I was duly attached to the Fifth Northumberland Fusiliers as Assistant Surgeon. The regiment was stationed in India at the time, and before I could join it, the second Afghan war had broken out. On landing at Bombay, I learned that my corps had advanced through the passes, and was already deep in the enemy's country. I followed, however, with many other officers who were in the same situation as myself, and succeeded in reaching Candahar in safety, where I found my regiment, and at once entered upon my new duties. The campaign brought honours and promotion to many, but for me it had nothing but misfortune and disaster. I was removed from my brigade and attached to the Berkshires, with whom I served at the fatal battle of Maiwand. There I was struck on the shoulder by a Jezail bullet, which shattered the bone and grazed the subclavian artery. I should have fallen into the hands of the murderous Ghazis had it not been for the devotion and courage shown by Murray, my orderly, who threw me across a pack-horse, and succeeded in bringing me safely to the British lines. Worn with pain, and weak from the prolonged hardships which I had undergone, I was removed, with a great train of wounded sufferers, to the base hospital at Peshawar. Here I rallied, and had already improved so far as to be able to walk about the wards, and even to bask a little upon the verandah, when I was struck down by enteric fever, that curse of our Indian possessions. For months my life was despaired of, and when at last I came to myself and became convalescent, I was so weak and emaciated that a medical board determined that not a day should be lost in sending me back to England. I was dispatched, accordingly, in the troopship "Orontes," and landed a month later on Portsmouth jetty, with my health irretrievably ruined, but with permission from a paternal government to spend the next nine months in attempting to improve it. I had neither kith nor kin in England, and was therefore as free as air--or as free as an income of eleven shillings and sixpence a day will permit a man to be. Under such circumstances, I naturally gravitated to London, that great cesspool into which all the loungers and idlers of the Empire are irresistibly drained. There I stayed for some time at a private hotel in the Strand, leading a comfortless, meaningless existence, and spending such money as I had, considerably more freely than I ought. So alarming did the state of my finances become, that I soon realized that I must either leave the metropolis and rusticate somewhere in the country, or that I must make a complete alteration in my style of living. Choosing the latter alternative, I began by making up my mind to leave the hotel, and to take up my quarters in some less pretentious and less expensive domicile. On the very day that I had come to this conclusion, I was standing at the Criterion Bar, when some one tapped me on the shoulder, and turning round I recognized young Stamford, who had been a dresser under me at Barts. The sight of a friendly face in the great wilderness of London is a pleasant thing indeed to a lonely man. In old days Stamford had never been a particular crony of mine, but now I hailed him with enthusiasm, and he, in his turn, appeared to be delighted to see me. In the exuberance of my joy, I asked him to lunch with me at the Holborn, and we started off together in a hansom. "Whatever have you been doing with yourself, Watson?" he asked in undisguised wonder, as we rattled through the crowded London streets. "You are as thin as a lath and as brown as a nut." I gave him a short sketch of my adventures, and had hardly concluded it by the time that we reached our destination. "Poor devil!" he said, commiseratingly, after he had listened to my misfortunes. "What are you up to now?" "Looking for lodgings." [3] I answered. "Trying to solve the problem as to whether it is possible to get comfortable rooms at a reasonable price." "That's a strange thing," remarked my companion; "you are the second man to-day that has used that expression to me." "And who was the first?" I asked. "A fellow who is working at the chemical laboratory up at the hospital. He was bemoaning himself this morning because he could not get someone to go halves with him in some nice rooms which he had found, and which were too much for his purse." "By Jove!" I cried, "if he really wants someone to share the rooms and the expense, I am the very man for him. I should prefer having a partner to being alone." Young Stamford looked rather strangely at me over his wine-glass. "You don't know Sherlock Holmes yet," he said; "perhaps you would not care for him as a constant companion." "Why, what is there against him?" "Oh, I didn't say there was anything against him. He is a little queer in his ideas--an enthusiast in some branches of science. As far as I know he is a decent fellow enough." "A medical student, I suppose?" said I. "No--I have no idea what he intends to go in for. I believe he is well up in anatomy, and he is a first-class chemist; but, as far as I know, he has never taken out any systematic medical classes. His studies are very desultory and eccentric, but he has amassed a lot of out-of-the way knowledge which would astonish his professors." "Did you never ask him what he was going in for?" I asked. "No; he is not a man that it is easy to draw out, though he can be communicative enough when the fancy seizes him." "I should like to meet him," I said. "If I am to lodge with anyone, I should prefer a man of studious and quiet habits. I am not strong enough yet to stand much noise or excitement. I had enough of both in Afghanistan to last me for the remainder of my natural existence. How could I meet this friend of yours?" "He is sure to be at the laboratory," returned my companion. "He either avoids the place for weeks, or else he works there from morning to night. If you like, we shall drive round together after luncheon." "Certainly," I answered, and the conversation drifted away into other channels. As we made our way to the hospital after leaving the Holborn, Stamford gave me a few more particulars about the gentleman whom I proposed to take as a fellow-lodger. "You mustn't blame me if you don't get on with him," he said; "I know nothing more of him than I have learned from meeting him occasionally in the laboratory. You proposed this arrangement, so you must not hold me responsible." "If we don't get on it will be easy to part company," I answered. "It seems to me, Stamford," I added, looking hard at my companion, "that you have some reason for washing your hands of the matter. Is this fellow's temper so formidable, or what is it? Don't be mealy-mouthed about it." "It is not easy to express the inexpressible," he answered with a laugh. "Holmes is a little too scientific for my tastes--it approaches to cold-bloodedness. I could imagine his giving a friend a little pinch of the latest vegetable alkaloid, not out of malevolence, you understand, but simply out of a spirit of inquiry in order to have an accurate idea of the effects. To do him justice, I think that he would take it himself with the same readiness. He appears to have a passion for definite and exact knowledge." "Very right too." "Yes, but it may be pushed to excess. When it comes to beating the subjects in the dissecting-rooms with a stick, it is certainly taking rather a bizarre shape." "Beating the subjects!" "Yes, to verify how far bruises may be produced after death. I saw him at it with my own eyes." "And yet you say he is not a medical student?" "No. Heaven knows what the objects of his studies are. But here we are, and you must form your own impressions about him." As he spoke, we turned down a narrow lane and passed through a small side-door, which opened into a wing of the great hospital. It was familiar ground to me, and I needed no guiding as we ascended the bleak stone staircase and made our way down the long corridor with its vista of whitewashed wall and dun-coloured doors. Near the further end a low arched passage branched away from it and led to the chemical laboratory. This was a lofty chamber, lined and littered with countless bottles. Broad, low tables were scattered about, which bristled with retorts, test-tubes, and little Bunsen lamps, with their blue flickering flames. There was only one student in the room, who was bending over a distant table absorbed in his work. At the sound of our steps he glanced round and sprang to his feet with a cry of pleasure. "I've found it! I've found it," he shouted to my companion, running towards us with a test-tube in his hand. "I have found a re-agent which is precipitated by hoemoglobin, [4] and by nothing else." Had he discovered a gold mine, greater delight could not have shone upon his features. "Dr. Watson, Mr. Sherlock Holmes," said Stamford, introducing us. "How are you?" he said cordially, gripping my hand with a strength for which I should hardly have given him credit. "You have been in Afghanistan, I perceive." "How on earth did you know that?" I asked in astonishment. "Never mind," said he, chuckling to himself. "The question now is about hoemoglobin. No doubt you see the significance of this discovery of mine?" "It is interesting, chemically, no doubt," I answered, "but practically----" "Why, man, it is the most practical medico-legal discovery for years. Don't you see that it gives us an infallible test for blood stains. Come over here now!" He seized me by the coat-sleeve in his eagerness, and drew me over to the table at which he had been working. "Let us have some fresh blood," he said, digging a long bodkin into his finger, and drawing off the resulting drop of blood in a chemical pipette. "Now, I add this small quantity of blood to a litre of water. You perceive that the resulting mixture has the appearance of pure water. The proportion of blood cannot be more than one in a million. I have no doubt, however, that we shall be able to obtain the characteristic reaction." As he spoke, he threw into the vessel a few white crystals, and then added some drops of a transparent fluid. In an instant the contents assumed a dull mahogany colour, and a brownish dust was precipitated to the bottom of the glass jar. "Ha! ha!" he cried, clapping his hands, and looking as delighted as a child with a new toy. "What do you think of that?" "It seems to be a very delicate test," I remarked. "Beautiful! beautiful! The old Guiacum test was very clumsy and uncertain. So is the microscopic examination for blood corpuscles. The latter is valueless if the stains are a few hours old. Now, this appears to act as well whether the blood is old or new. Had this test been invented, there are hundreds of men now walking the earth who would long ago have paid the penalty of their crimes." "Indeed!" I murmured. "Criminal cases are continually hinging upon that one point. A man is suspected of a crime months perhaps after it has been committed. His linen or clothes are examined, and brownish stains discovered upon them. Are they blood stains, or mud stains, or rust stains, or fruit stains, or what are they? That is a question which has puzzled many an expert, and why? Because there was no reliable test. Now we have the Sherlock Holmes' test, and there will no longer be any difficulty." His eyes fairly glittered as he spoke, and he put his hand over his heart and bowed as if to some applauding crowd conjured up by his imagination. "You are to be congratulated," I remarked, considerably surprised at his enthusiasm. "There was the case of Von Bischoff at Frankfort last year. He would certainly have been hung had this test been in existence. Then there was Mason of Bradford, and the notorious Muller, and Lefevre of Montpellier, and Samson of new Orleans. I could name a score of cases in which it would have been decisive." "You seem to be a walking calendar of crime," said Stamford with a laugh. "You might start a paper on those lines. Call it the 'Police News of the Past.'" "Very interesting reading it might be made, too," remarked Sherlock Holmes, sticking a small piece of plaster over the prick on his finger. "I have to be careful," he continued, turning to me with a smile, "for I dabble with poisons a good deal." He held out his hand as he spoke, and I noticed that it was all mottled over with similar pieces of plaster, and discoloured with strong acids. "We came here on business," said Stamford, sitting down on a high three-legged stool, and pushing another one in my direction with his foot. "My friend here wants to take diggings, and as you were complaining that you could get no one to go halves with you, I thought that I had better bring you together." Sherlock Holmes seemed delighted at the idea of sharing his rooms with me. "I have my eye on a suite in Baker Street," he said, "which would suit us down to the ground. You don't mind the smell of strong tobacco, I hope?" "I always smoke 'ship's' myself," I answered. "That's good enough. I generally have chemicals about, and occasionally do experiments. Would that annoy you?" "By no means." "Let me see--what are my other shortcomings. I get in the dumps at times, and don't open my mouth for days on end. You must not think I am sulky when I do that. Just let me alone, and I'll soon be right. What have you to confess now? It's just as well for two fellows to know the worst of one another before they begin to live together." I laughed at this cross-examination. "I keep a bull pup," I said, "and I object to rows because my nerves are shaken, and I get up at all sorts of ungodly hours, and I am extremely lazy. I have another set of vices when I'm well, but those are the principal ones at present." "Do you include violin-playing in your category of rows?" he asked, anxiously. "It depends on the player," I answered. "A well-played violin is a treat for the gods--a badly-played one----" "Oh, that's all right," he cried, with a merry laugh. "I think we may consider the thing as settled--that is, if the rooms are agreeable to you." "When shall we see them?" "Call for me here at noon to-morrow, and we'll go together and settle everything," he answered. "All right--noon exactly," said I, shaking his hand. We left him working among his chemicals, and we walked together towards my hotel. "By the way," I asked suddenly, stopping and turning upon Stamford, "how the deuce did he know that I had come from Afghanistan?" My companion smiled an enigmatical smile. "That's just his little peculiarity," he said. "A good many people have wanted to know how he finds things out." "Oh! a mystery is it?" I cried, rubbing my hands. "This is very piquant. I am much obliged to you for bringing us together. 'The proper study of mankind is man,' you know." "You must study him, then," Stamford said, as he bade me good-bye. "You'll find him a knotty problem, though. I'll wager he learns more about you than you about him. Good-bye." "Good-bye," I answered, and strolled on to my hotel, considerably interested in my new acquaintance. CHAPTER II. THE SCIENCE OF DEDUCTION. WE met next day as he had arranged, and inspected the rooms at No. 221B, Baker Street, of which he had spoken at our meeting. They consisted of a couple of comfortable bed-rooms and a single large airy sitting-room, cheerfully furnished, and illuminated by two broad windows. So desirable in every way were the apartments, and so moderate did the terms seem when divided between us, that the bargain was concluded upon the spot, and we at once entered into possession. That very evening I moved my things round from the hotel, and on the following morning Sherlock Holmes followed me with several boxes and portmanteaus. For a day or two we were busily employed in unpacking and laying out our property to the best advantage. That done, we gradually began to settle down and to accommodate ourselves to our new surroundings. Holmes was certainly not a difficult man to live with. He was quiet in his ways, and his habits were regular. It was rare for him to be up after ten at night, and he had invariably breakfasted and gone out before I rose in the morning. Sometimes he spent his day at the chemical laboratory, sometimes in the dissecting-rooms, and occasionally in long walks, which appeared to take him into the lowest portions of the City. Nothing could exceed his energy when the working fit was upon him; but now and again a reaction would seize him, and for days on end he would lie upon the sofa in the sitting-room, hardly uttering a word or moving a muscle from morning to night. On these occasions I have noticed such a dreamy, vacant expression in his eyes, that I might have suspected him of being addicted to the use of some narcotic, had not the temperance and cleanliness of his whole life forbidden such a notion. nmh-1.5/test/inc/fromline.txt000644 007761 000765 00000000063 11762736346 016214 0ustar00kenhkenh000000 000000 From pm215@archaic.org.uk Fri Dec 26 15:03:52 2008 nmh-1.5/test/inc/md5sums000644 007761 000765 00000000214 11762736346 015156 0ustar00kenhkenh000000 000000 4112b1460e11bd94d30944dd464a6662 filler.txt 023aad60eab43f06cf525869a833beb4 fromline.txt 4fda7f16b29d757413cb928d6ffc5aa5 msgheader.txt nmh-1.5/test/inc/msgheader.txt000644 007761 000765 00000000171 11762736346 016340 0ustar00kenhkenh000000 000000 From: Test To: Some User Date: Fri, 29 Sep 2006 00:00:00 Subject: Testing message nmh-1.5/test/inc/test-deb359167000755 007761 000765 00000001245 11762736346 015777 0ustar00kenhkenh000000 000000 #!/bin/sh # Test a variant of a mailbox which caused debian bug 359167. set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test require_prog valgrind THISDIR="$srcdir/test/inc" TESTMBOX="$THISDIR/deb359167.mbox" if [ "`output_md5 "$TESTMBOX"`" != "e6ac458b8cccba2b2fd866fb505aeb5e" ]; then echo "Test mailbox has been corrupted" exit 1 fi # # valgrind refuses to run on a setuid/setgid program, so chmod inc so it # isn't (just in case) # chmod 755 ${MH_INST_DIR}${bindir}/inc valgrind --error-exitcode=1 --quiet inc -silent -file "$TESTMBOX" nmh-1.5/test/inc/test-eom-align000755 007761 000765 00000010655 11762736346 016423 0ustar00kenhkenh000000 000000 #!/bin/sh # Test all combinations of alignment of the end-of-message delimiter # with the end of a stdio buffer set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test THISDIR="$srcdir/test/inc" if [ -z "$VALGRIND_ME" ]; then VALGRIND= else require_prog valgrind # Lack of quotes here is important VALGRIND="valgrind --quiet --error-exitcode=1" echo "Running tests under valgrind: takes ages!" fi # First check that all our various pieces of text are # intact. (Since we're dealing in exact byte alignment # minor corruptions such as line ending changes could # render the tests useless.) (cd "$THISDIR" && \ for i in *.txt; do echo `output_md5 $i`' '"$i" >> "$MH_TEST_DIR/inctest.md5sums" done) check "$THISDIR/md5sums" "$MH_TEST_DIR/inctest.md5sums" 'keep first' FILLER="$THISDIR/filler.txt" FROMLINE="$THISDIR/fromline.txt" HDR="$THISDIR/msgheader.txt" if grep From "$FILLER" >/dev/null; then echo "Somebody's messed with $FILLER -- it must not contain" echo "anything that might look like a message delimiter!" exit 1 fi # a sort of worst-case guess for the buffer size; # obviously a buffer boundary for this will be a boundary # for any smaller power of two size. # If you need to increase this you'll need to make filler.txt # bigger as well. STDIO_BUFSZ=16384 FROMLINESZ=`wc -c < "$FROMLINE"` HDRSZ=`wc -c < "$HDR"` # makembox_A mboxname sz # Assemble a mailbox into file mboxname, with two messages, such # that the first is exactly sz bytes long (including its header # and its initial 'From' line and the newline which terminates it # but not the newline which mbox format demands after each message) # We also leave the body of message one in mboxname.body # (the body of message two is always $FILLER in its entirety) makembox_A () { MBOX="$1" SZ=$2 arith_eval $SZ - $HDRSZ - $FROMLINESZ - 1; WANTSZ=$arith_val dd if="$FILLER" of="$MBOX.body" bs="$WANTSZ" count=1 2>/dev/null echo >> "$MBOX.body" cat "$FROMLINE" "$HDR" "$MBOX.body" > "$MBOX" echo >> "$MBOX" cat "$FROMLINE" "$HDR" "$FILLER" >> "$MBOX" echo >> "$MBOX" } # make_mbox_B mboxname sz # Test B makes a mailbox with one message of sz bytes long, # which ends in a partial mbox delimiter (ie part of the string # \n\nFrom '). To both do this and be a valid mbox this means # it has to end with two newlines (one of which is in the message # body and one of which is the mbox format mandated one) makembox_B () { MBOX="$1" SZ=$2 arith_eval $SZ - $HDRSZ - $FROMLINESZ - 1; WANTSZ=$arith_val dd if="$FILLER" of="$MBOX.body" bs="$WANTSZ" count=1 2>/dev/null echo >> "$MBOX.body" cat "$FROMLINE" "$HDR" "$MBOX.body" > "$MBOX" echo >> "$MBOX" } # do_one_test_A sz # Do a single test with message one's body of size sz. do_one_test_A () { SZ=$1 makembox_A "$MH_TEST_DIR/eom-align.mbox" $STDIO_BUFSZ $VALGRIND inc -silent -file "$MH_TEST_DIR/eom-align.mbox" # We know the messages should be 11 and 12 in inbox # Now get the bodies back out. body1="$MH_TEST_DIR/eom-align.inbox.body1" body2="$MH_TEST_DIR/eom-align.inbox.body2" sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/11" > "$body1" sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/12" > "$body2" check "$MH_TEST_DIR/eom-align.mbox.body" "$body1" 'keep first' check "$FILLER" "$body2" 'keep first' rmm 11 12 } # do_one_test_B sz # Do a test type B do_one_test_B () { SZ=$1 makembox_B "$MH_TEST_DIR/eom-align.mbox" $STDIO_BUFSZ $VALGRIND inc -silent -file "$MH_TEST_DIR/eom-align.mbox" # We know the message should be 11 in the inbox body1="$MH_TEST_DIR/eom-align.inbox.body1" sed -e '1,/^$/d' "$MH_TEST_DIR/Mail/inbox/11" > "$body1" check "$MH_TEST_DIR/eom-align.mbox.body" "$body1" 'keep first' rmm 11 } # Cover a decent range around the stdio buffer size to make sure we catch # any corner cases whether they relate to total message size equal to # buffer size or to body size equal to buffer size. arith_eval $STDIO_BUFSZ - 16; START=$arith_val arith_eval $STDIO_BUFSZ + $HDRSZ + $FROMLINESZ + 32; FINISH=$arith_val echo \ "Testing inc of files with various alignments of eom marker with buffer size..." i="$START" while test $i -le $FINISH; do progress_update $i $START $FINISH do_one_test_A $i do_one_test_B $i i=`expr $i + 1` done progress_done test ${failed:-0} -eq 0 && \ rm "$MH_TEST_DIR/eom-align.mbox" "$MH_TEST_DIR/eom-align.mbox.body" exit $failed nmh-1.5/test/inc/test-inc-scanout000755 007761 000765 00000023515 11762736346 016775 0ustar00kenhkenh000000 000000 #!/bin/sh # # Check to see if the scan output is correct if we have a message # right on the stdio buffer boundary # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test cat > "${MH_TEST_DIR}/test.mbox" < To: Another Nobody Date: Thu, 1 Mar 2012 01:02:03 -0500 Subject: Who is on first? Abbott: Every dollar of it. And why not, the man's entitled to it. Costello: Who is? Abbott: Yes. Costello: So who gets it? Abbott: Why shouldn't he? Sometimes his wife comes down and collects it. Costello: Who's wife? Abbott: Yes. After all, the man earns it. Costello: Who does? Abbott: Absolutely. Costello: Well, all I'm trying to find out is what's the guy's name on first base? Abbott: Oh, no, no. What is on second base. Costello: I'm not asking you who's on second. Abbott: Who's on first! EOF cat > "${MH_TEST_DIR}/test.mbox.2" < To: Another Nobody Date: Thu, 1 Mar 2012 01:02:03 -0500 Subject: Who is on first? Abbott: Every dollar of it. And why not, the man's entitled to it. Costello: Who is? Abbott: Yes. Costello: So who gets it? Abbott: Why shouldn't he? Sometimes his wife comes down and collects it. Costello: Who's wife? Abbott: Yes. After all, the man earns it. Costello: Who does? Abbott: Absolutely. Costello: Well, all I'm trying to find out is what's the guy's name on first base? Abbott: Oh, no, no. What is on second base. Costello: I'm not asking you who's on second. Abbott: Who's on first! EOF run_test "inc -file ${MH_TEST_DIR}/test.mbox -width 120 -truncate" \ "Incorporating new mail into inbox... 11+ 03/01 Mr Nobody Who is on first?< "$expected" <> "$expected" cat >> "$expected" <> "$expected" < "$expected" <> "$expected" cat >> "$expected" <> "$expected" < $form < -------- EOF expected="${MH_TEST_DIR}/$$.expected" actual="${MH_TEST_DIR}/Mail/draft" from="Mr Test User " to1="User One " to2="User Two " cc1="CC User One " cc2="CC User Two " cc3="CC User Three " cc4="CC User Four " fcc1="+nosuchmailbox" fcc2="+nosuchmailbox2" subject="Totally bogus subject" cat > "$expected" <> "$expected" cat >> "$expected" <> ${MH} # We can use "ap" to get the output of format commands testoutput=`${MH_LIB_DIR}/ap -format "%(localmbox)" ignore` if [ x"${testname}" != x"${testoutput}" ]; then echo "Expected ${testname}, got ${testoutput}" exit 1 fi exit 0 nmh-1.5/test/format/test-myhost000755 007761 000765 00000001304 11762736346 016604 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test that the %(myhost) function returns the local hostname and # the localname entry out of the mts configuration file. # if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test host=`${MH_OBJ_DIR}/test/getfqdn` run_test "${MH_LIB_DIR}/ap -format %(myhost) ignore" "$host" \ "local hostname test" cp ${MHMTSCONF} ${MH_TEST_DIR}/Mail/mts.conf || exit 1 MHMTSCONF="${MH_TEST_DIR}/Mail/mts.conf" echo "localname: some.random.name" >> ${MHMTSCONF} run_test "${MH_LIB_DIR}/ap -format %(myhost) ignore" "some.random.name" \ "mts.conf localname test" exit $failed nmh-1.5/test/format/test-mymbox000755 007761 000765 00000002641 11765131762 016573 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test that the %(mymbox) function correctly determines whether or not # a particular email address is "mine" or not # if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test #### Use ap to get the username. That will either be what's in the #### Local-Mailbox profile component, which we don't use in the test #### suite, or the user's login name. ap will escape (quote) it if #### needed. user=`${MH_LIB_DIR}/ap -format '%(me)' 0` host=`${MH_OBJ_DIR}/test/getfqdn` output=`${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}"` run_test "echo $output" 1 "Basic user test" output=`${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}@${host}"` run_test "echo $output" 1 "Basic user@host test" run_test "${MH_LIB_DIR}/ap -format %(mymbox{text}) nosuchuser@nosuchhost.blah" \ 0 "Basic non-matching test" myname="Random User " #### Remove existing Local-Mailbox: profile component, if any. Then #### add one. grep -v 'Local-Mailbox: ' ${MH} > ${MH}.new mv -f ${MH}.new ${MH} echo "Local-Mailbox: ${myname}" >> ${MH} run_test "echo `${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${myname}"`" \ 1 "Local-Mailbox test" output=`${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}@${host}"` run_test "echo $output" 0 "Local-mailbox overriding user@host test" exit $failed nmh-1.5/test/format/test-myname000755 007761 000765 00000004447 11762736346 016562 0ustar00kenhkenh000000 000000 #!/bin/sh # # Test that we can retrieve the local username via the passwd file, # the Signature profile entry, and via SIGNATURE environment variable. # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test unset SIGNATURE fullname=`${MH_OBJ_DIR}/test/getfullname` run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \ "$fullname" "GECOS field test" echo "Signature: Some Random Name 1" >> ${MH} run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \ "Some Random Name 1" "MH Profile Signature test" SIGNATURE="Some Random Name 2" export SIGNATURE run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \ "${SIGNATURE}" "SIGNATURE Environment test" #### Test escaping of display names. escape="${MH_OBJ_DIR}/test/getfullname" run_test "$escape "'user' 'user' 'no escape' run_test "$escape "'first.last' '"first.last"' 'escape' run_test "$escape "'"first.last"' '"first.last"' 'already escaped' run_test "$escape "'first.last"' '"first.last"' 'missing initial "' run_test "$escape "'"first.last' '"first.last"' 'missing final "' run_test "$escape "'embedded"quote' '"embedded\"quote"' 'embedded quote' run_test "$escape "'server\name,#' '"server\name"' 'Windows form' run_test "$escape "'"' '"\""' 'special "' run_test "$escape "'(' '"("' 'special (' run_test "$escape "')' '")"' 'special )' #### We stop at the first comma so this one gets eliminated: run_test "$escape "',' '' 'special ,' run_test "$escape "'.' '"."' 'special .' run_test "$escape "':' '":"' 'special :' run_test "$escape "';' '";"' 'special ;' run_test "$escape "'<' '"<"' 'special <' run_test "$escape "'>' '">"' 'special >' run_test "$escape "'@' '"@"' 'special @' run_test "$escape "'[' '"["' 'special [' run_test "$escape "'\\' '"\\"' 'special \\' run_test "$escape "']' '"]"' 'special ]' exit $failed nmh-1.5/test/folder/test-create000755 007761 000765 00000001056 11762736346 016513 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test the creation and removal of a folder. # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test folder -create +testfolder > /dev/null if [ -d "$MH_TEST_DIR/Mail/testfolder" ]; then : else exit 1 fi rmf +testfolder > /dev/null if [ -d "$MH_TEST_DIR/Mail/testfolder" ]; then # Test failed exit 1 fi nmh-1.5/test/folder/test-total000755 007761 000765 00000000654 11762736346 016376 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test the -total switch # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test output=`folder -total +inbox` if test x"$output" != x'TOTAL = 10 messages in 1 folder.' ; then exit 1 fi nmh-1.5/test/comp/test-comp-format000755 007761 000765 00000002755 11762736346 017166 0ustar00kenhkenh000000 000000 #!/bin/sh # # Tests to see if the -from, -to, -cc, -fcc, and -subject switches to # "comp" work correctly. # if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test # # Create a test template file (we create one here just in case the master # one changes) # form="${MH_TEST_DIR}/$$.components" cat > $form < $expected < "${MH_TEST_DIR}/Mail/inbox/11" < To: Test Recipient Date: Friday, 29 Sep 2006 00:00:00 Subject: Test digest ------- Message one From: Mister Burster To: Nobody 1 Date: Thursday, 28 Sep 2006 00:01:00 Subject: Message one This is message one ------- Message two From: Mister Burster To: Nobody 2 Date: Thursday, 28 Sep 2006 00:02:00 Subject: Message two This is message two For real. ------- End of all messages EOF burst 11 || exit run_test 'scan -width 80 11-last' \ " 11 09/29 Test Burst Messag Test digest<<------- Message one From: Mister Bu 12+ 09/28 Mister Burster Message one<> 13 09/28 Mister Burster Message two<>" # # Create another test message that stresses the boundary checker a bit # cat > "${MH_TEST_DIR}/Mail/inbox/14" < To: Test Recipient Date: Friday, 29 Sep 2006 00:00:00 Subject: Test digest This is a preamble ------- Message one From: Mister Burster To: Nobody 1 Date: Thursday, 28 Sep 2006 00:01:00 Subject: Message one - -This is message one ------- Message two From: Mister Burster To: Nobody 2 Date: Thursday, 28 Sep 2006 00:02:00 Subject: Message two This is message two - For real. ------- Message three From: Mister Burster To: Nobody 3 Date: Thursday, 28 Sep 2006 00:03:00 Subject: Message three Will this one work? ------ Message three End of all messages EOF burst 14 || exit run_test 'scan -width 80 14-last' \ " 14 09/29 Test Burst Messag Test digest<> 16 09/28 Mister Burster Message two<> 17 09/28 Mister Burster Message three<>" # # Check to see if each message is what we expect # run_test 'show -noheader -noshow 15' \ "From: Mister Burster To: Nobody 1 Date: Thursday, 28 Sep 2006 00:01:00 Subject: Message one -This is message one" run_test 'show -noheader -noshow 16' \ "From: Mister Burster To: Nobody 2 Date: Thursday, 28 Sep 2006 00:02:00 Subject: Message two This is message two For real." # # Backticks used by run_test can consume blank lines at the end of the # command output, so use check for this one. # expected="${MH_TEST_DIR}/$$.expected" cat > "${expected}" < To: Nobody 3 Date: Thursday, 28 Sep 2006 00:03:00 Subject: Message three Will this one work? EOF check "${expected}" `mhpath 17` exit $failed nmh-1.5/test/bad-input/test-header000755 007761 000765 00000002772 11762736346 017116 0ustar00kenhkenh000000 000000 #!/bin/sh ###################################################### # # Test bogus headers (no blank line before body). # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Write message with bogus header field (missing blank line, really). msgfile=`mhpath new` msgnum=`basename $msgfile` cat > $msgfile < $expected < $actual 2>&1 check $expected $actual # check show (mhl) cat > $expected < $actual 2>&1 check $expected $actual # check mhshow cat > $expected < $actual 2>&1 check $expected $actual exit $failed nmh-1.5/sbr/addrsbr.c000644 007761 000765 00000025463 11762736346 014476 0ustar00kenhkenh000000 000000 /* * addrsbr.c -- parse addresses 822-style * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include /* High level parsing of addresses: The routines in sbr/mf.c parse the syntactic representations of addresses. The routines in sbr/addrsbr.c associate semantics with those addresses. The comments below are left in for historical purposes; DUMB and REALLYDUMB are now the default in the code. If #ifdef DUMB is in effect, a full 822-style parser is called for syntax recongition. This breaks each address into its components. Note however that no semantics are assumed about the parts or their totality. This means that implicit hostnames aren't made explicit, and explicit hostnames aren't expanded to their "official" represenations. If DUMB is not in effect, then this module does some high-level thinking about what the addresses are. 1. for MMDF systems: string%@ -> string 2. for non-MMDF systems: string@host. -> host!string 3. for any system, an address interpreted relative to the local host: string@ -> string For cases (1) and (3) above, the leftmost host is extracted. If it's not present, the local host is used. If the tests above fail, the address is considered to be a real 822-style address. If an explicit host is not present, then MH checks for a bang to indicate an explicit UUCP-style address. If so, this is noted. If not, the host is defaulted, typically to the local host. The lack of an explict host is also noted. If an explicit 822-style host is present, then MH checks to see if it can expand this to the official name for the host. If the hostname is unknown, the address is so typed. To summarize, when we're all done, here's what MH knows about the address: DUMB - type: local, uucp, or network host: not locally defaulted, not explicitly expanded everything else other - type: local, uucp, network, unknown everything else */ static int ingrp = 0; static char *pers = NULL; static char *mbox = NULL; static char *host = NULL; static char *route = NULL; static char *grp = NULL; static char *note = NULL; static char err[BUFSIZ]; static char adr[BUFSIZ]; char * getname (char *addrs) { struct adrx *ap; pers = mbox = host = route = grp = note = NULL; err[0] = '\0'; if ((ap = getadrx (addrs ? addrs : "")) == NULL) return NULL; strncpy (adr, ap->text, sizeof(adr)); pers = ap->pers; mbox = ap->mbox; host = ap->host; route = ap->path; grp = ap->grp; ingrp = ap->ingrp; note = ap->note; if (ap->err && *ap->err) strncpy (err, ap->err, sizeof(err)); return adr; } struct mailname * getm (char *str, char *dfhost, int dftype, int wanthost, char *eresult) { char *pp; struct mailname *mp; if (err[0]) { if (eresult) strcpy (eresult, err); else if (wanthost == AD_HOST) admonish (NULL, "bad address '%s' - %s", str, err); return NULL; } if (pers == NULL && mbox == NULL && host == NULL && route == NULL && grp == NULL) { if (eresult) strcpy (eresult, "null address"); else if (wanthost == AD_HOST) admonish (NULL, "null address '%s'", str); return NULL; } if (mbox == NULL && grp == NULL) { if (eresult) strcpy (eresult, "no mailbox in address"); else if (wanthost == AD_HOST) admonish (NULL, "no mailbox in address '%s'", str); return NULL; } if (dfhost == NULL) { dfhost = LocalName (0); dftype = LOCALHOST; } mp = (struct mailname *) calloc ((size_t) 1, sizeof(*mp)); if (mp == NULL) { if (eresult) strcpy (eresult, "insufficient memory to represent address"); else if (wanthost == AD_HOST) adios (NULL, "insufficient memory to represent address"); return NULL; } mp->m_next = NULL; mp->m_text = getcpy (str); if (pers) mp->m_pers = getcpy (pers); if (mbox == NULL) { mp->m_type = BADHOST; mp->m_nohost = 1; mp->m_ingrp = ingrp; mp->m_gname = getcpy (grp); if (note) mp->m_note = getcpy (note); return mp; } if (host) { mp->m_mbox = getcpy (mbox); mp->m_host = getcpy (host); } else { if ((pp = strchr(mbox, '!'))) { *pp++ = '\0'; mp->m_mbox = getcpy (pp); mp->m_host = getcpy (mbox); mp->m_type = UUCPHOST; } else { mp->m_nohost = 1; mp->m_mbox = getcpy (mbox); if (route == NULL && dftype == LOCALHOST) { mp->m_host = NULL; mp->m_type = dftype; } else { mp->m_host = route ? NULL : getcpy (dfhost); mp->m_type = route ? NETHOST : dftype; } } goto got_host; } if (wanthost == AD_NHST) mp->m_type = !mh_strcasecmp (LocalName (0), mp->m_host) ? LOCALHOST : NETHOST; else mp->m_type = mh_strcasecmp (LocalName(0), mp->m_host) ? NETHOST : LOCALHOST; got_host: ; if (route) mp->m_path = getcpy (route); mp->m_ingrp = ingrp; if (grp) mp->m_gname = getcpy (grp); if (note) mp->m_note = getcpy (note); return mp; } void mnfree (struct mailname *mp) { if (!mp) return; if (mp->m_text) free (mp->m_text); if (mp->m_pers) free (mp->m_pers); if (mp->m_mbox) free (mp->m_mbox); if (mp->m_host) free (mp->m_host); if (mp->m_path) free (mp->m_path); if (mp->m_gname) free (mp->m_gname); if (mp->m_note) free (mp->m_note); free ((char *) mp); } #define empty(s) ((s) ? (s) : "") char * auxformat (struct mailname *mp, int extras) { static char addr[BUFSIZ]; static char buffer[BUFSIZ]; if (mp->m_nohost) strncpy (addr, mp->m_mbox ? mp->m_mbox : "", sizeof(addr)); else if (mp->m_type != UUCPHOST) snprintf (addr, sizeof(addr), mp->m_host ? "%s%s@%s" : "%s%s", empty(mp->m_path), empty(mp->m_mbox), mp->m_host); else snprintf (addr, sizeof(addr), "%s!%s", mp->m_host, mp->m_mbox); if (!extras) return addr; if (mp->m_pers || mp->m_path) { if (mp->m_note) snprintf (buffer, sizeof(buffer), "%s %s <%s>", legal_person (mp->m_pers ? mp->m_pers : mp->m_mbox), mp->m_note, addr); else snprintf (buffer, sizeof(buffer), "%s <%s>", legal_person (mp->m_pers ? mp->m_pers : mp->m_mbox), addr); } else if (mp->m_note) snprintf (buffer, sizeof(buffer), "%s %s", addr, mp->m_note); else strncpy (buffer, addr, sizeof(buffer)); return buffer; } /* * This used to be adrsprintf() (where it would format an address for you * given a username and a domain). But somewhere we got to the point where * the only caller was post, and it only called it with both arguments NULL. * So the function was renamed with a more sensible name. */ char * getlocaladdr(void) { char *username; username = getusername(); return username; } #define W_NIL 0x0000 #define W_MBEG 0x0001 #define W_MEND 0x0002 #define W_MBOX (W_MBEG | W_MEND) #define W_HBEG 0x0004 #define W_HEND 0x0008 #define W_HOST (W_HBEG | W_HEND) #define WBITS "\020\01MBEG\02MEND\03HBEG\04HEND" /* * Check if this is my address */ int ismymbox (struct mailname *np) { int oops; register int len, i; register char *cp; register char *pp; char buffer[BUFSIZ]; struct mailname *mp; static char *am = NULL; static struct mailname mq; static int localmailbox = 0; /* * If this is the first call, initialize * list of alternate mailboxes. */ if (am == NULL) { mq.m_next = NULL; mq.m_mbox = getusername (); if ((am = context_find ("local-mailbox"))) { localmailbox++; if ((cp = getname(am)) == NULL) { admonish (NULL, "Unable to find address in local-mailbox"); return 0; } if ((mq.m_next = getm (cp, NULL, 0, AD_NAME, NULL)) == NULL) { admonish (NULL, "invalid entry in local-mailbox: %s", cp); return 0; } /* * Sigh, it turns out that the address parser gets messed up * if you don't call getname() until it returns NULL. */ while ((cp = getname(am)) != NULL) ; } if ((am = context_find ("alternate-mailboxes")) == NULL) am = getusername(); else { mp = &mq; oops = 0; while ((cp = getname (am))) { if ((mp->m_next = getm (cp, NULL, 0, AD_NAME, NULL)) == NULL) { admonish (NULL, "illegal address: %s", cp); oops++; } else { mp = mp->m_next; mp->m_type = W_NIL; if (*mp->m_mbox == '*') { mp->m_type |= W_MBEG; mp->m_mbox++; } if (*(cp = mp->m_mbox + strlen (mp->m_mbox) - 1) == '*') { mp->m_type |= W_MEND; *cp = '\0'; } if (mp->m_host) { if (*mp->m_host == '*') { mp->m_type |= W_HBEG; mp->m_host++; } if (*(cp = mp->m_host + strlen (mp->m_host) - 1) == '*') { mp->m_type |= W_HEND; *cp = '\0'; } } if ((cp = getenv ("MHWDEBUG")) && *cp) fprintf (stderr, "mbox=\"%s\" host=\"%s\" %s\n", mp->m_mbox, mp->m_host, snprintb (buffer, sizeof(buffer), (unsigned) mp->m_type, WBITS)); } } if (oops) advise (NULL, "please fix the %s: entry in your %s file", "alternate-mailboxes", mh_profile); } } if (np == NULL) /* XXX */ return 0; /* * Don't perform this "local" test if we have a Local-Mailbox set */ if (! localmailbox) switch (np->m_type) { case NETHOST: len = strlen (cp = LocalName (0)); if (!uprf (np->m_host, cp) || np->m_host[len] != '.') break; goto local_test; case UUCPHOST: if (mh_strcasecmp (np->m_host, SystemName())) break; /* fall */ case LOCALHOST: local_test: ; if (!mh_strcasecmp (np->m_mbox, mq.m_mbox)) return 1; break; default: break; } /* * Now scan through list of alternate * mailboxes, and check for a match. */ for (mp = &mq; mp->m_next;) { mp = mp->m_next; if (!np->m_mbox) continue; if ((len = strlen (cp = np->m_mbox)) < (i = strlen (pp = mp->m_mbox))) continue; switch (mp->m_type & W_MBOX) { case W_NIL: if (mh_strcasecmp (cp, pp)) continue; break; case W_MBEG: if (mh_strcasecmp (cp + len - i, pp)) continue; break; case W_MEND: if (!uprf (cp, pp)) continue; break; case W_MBEG | W_MEND: if (stringdex (pp, cp) < 0) continue; break; } if (mp->m_nohost) return 1; if (np->m_host == NULL) continue; if ((len = strlen (cp = np->m_host)) < (i = strlen (pp = mp->m_host))) continue; switch (mp->m_type & W_HOST) { case W_NIL: if (mh_strcasecmp (cp, pp)) continue; break; case W_HBEG: if (mh_strcasecmp (cp + len - i, pp)) continue; break; case W_HEND: if (!uprf (cp, pp)) continue; break; case W_HBEG | W_HEND: if (stringdex (pp, cp) < 0) continue; break; } return 1; } return 0; } nmh-1.5/sbr/ambigsw.c000644 007761 000765 00000000601 11713401274 014452 0ustar00kenhkenh000000 000000 /* * ambigsw.c -- report an ambiguous switch * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void ambigsw (char *arg, struct swit *swp) { advise (NULL, "-%s ambiguous. It matches", arg); print_sw (arg, swp, "-", stderr); } nmh-1.5/sbr/atooi.c000644 007761 000765 00000000630 11713401274 014136 0ustar00kenhkenh000000 000000 /* * atooi.c -- octal version of atoi() * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int atooi(char *cp) { register int i, base; i = 0; base = 8; while (*cp >= '0' && *cp <= '7') { i *= base; i += *cp++ - '0'; } return i; } nmh-1.5/sbr/brkstring.c000644 007761 000765 00000003433 11713401274 015034 0ustar00kenhkenh000000 000000 /* * brkstring.c -- (destructively) split a string into * -- an array of substrings * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* allocate this number of pointers at a time */ #define NUMBROKEN 256 static char **broken = NULL; /* array of substring start addresses */ static int len = 0; /* current size of "broken" */ /* * static prototypes */ static int brkany (char, char *); char ** brkstring (char *str, char *brksep, char *brkterm) { int i; char c, *s; /* allocate initial space for pointers on first call */ if (!broken) { len = NUMBROKEN; broken = (char **) mh_xmalloc ((size_t) (len * sizeof(*broken))); } /* * scan string, replacing separators with zeroes * and enter start addresses in "broken". */ s = str; for (i = 0;; i++) { /* enlarge pointer array, if necessary */ if (i >= len) { len += NUMBROKEN; broken = mh_xrealloc (broken, (size_t) (len * sizeof(*broken))); } while (brkany (c = *s, brksep)) *s++ = '\0'; /* * we are either at the end of the string, or the * terminator found has been found, so finish up. */ if (!c || brkany (c, brkterm)) { *s = '\0'; broken[i] = NULL; return broken; } /* set next start addr */ broken[i] = s; while ((c = *++s) && !brkany (c, brksep) && !brkany (c, brkterm)) ; /* empty body */ } return broken; /* NOT REACHED */ } /* * If the character is in the string, * return 1, else return 0. */ static int brkany (char c, char *str) { char *s; if (str) { for (s = str; *s; s++) if (c == *s) return 1; } return 0; } nmh-1.5/sbr/check_charset.c000644 007761 000765 00000003641 11713401274 015616 0ustar00kenhkenh000000 000000 /* * check_charset.c -- routines for character sets * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #ifdef HAVE_LANGINFO_H # include #endif /* * Get the current character set */ char * get_charset () { char *charset = getenv ("MM_CHARSET"); #if defined(HAVE_NL_LANGINFO) && defined(CODESET) if (!charset) charset = norm_charmap(nl_langinfo (CODESET)); #endif return charset; } /* * Check if we can display a given character set natively. * We are passed the length of the initial part of the * string to check, since we want to allow the name of the * character set to be a substring of a larger string. */ int check_charset (char *str, int len) { static char *mm_charset = NULL; static char *alt_charset = NULL; static int mm_len; static int alt_len; /* Cache the name of our default character set */ if (!mm_charset) { if (!(mm_charset = get_charset ())) mm_charset = "US-ASCII"; mm_len = strlen (mm_charset); /* US-ASCII is a subset of the ISO-8859-X and UTF-8 character sets */ if (!strncasecmp("ISO-8859-", mm_charset, 9) || !mh_strcasecmp("UTF-8", mm_charset)) { alt_charset = "US-ASCII"; alt_len = strlen (alt_charset); } } /* Check if character set is OK */ if ((len == mm_len) && !strncasecmp(str, mm_charset, mm_len)) return 1; if (alt_charset && (len == alt_len) && !strncasecmp(str, alt_charset, alt_len)) return 1; return 0; } /* * Return the name of the character set we are * using for 8bit text. */ char * write_charset_8bit (void) { static char *mm_charset = NULL; /* * Cache the name of the character set to * use for 8bit text. */ if (!mm_charset && !(mm_charset = get_charset ())) mm_charset = "x-unknown"; return mm_charset; } nmh-1.5/sbr/client.c000644 007761 000765 00000007466 11762736346 014336 0ustar00kenhkenh000000 000000 /* * client.c -- connect to a server * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #include #include #include #define MAXARGS 1000 /* * static prototypes */ /* client's own static version of several nmh subroutines */ static char **client_brkstring (char *, char *, char *); static int client_brkany (char, char *); static char **client_copyip (char **, char **, int); static char *client_getcpy (char *); static void client_freelist(char **); int client (char *args, char *service, char *response, int len_response, int debug) { int sd, rc; char **ap, *arguments[MAXARGS]; struct addrinfo hints, *res, *ai; ap = arguments; if (args != NULL && *args != 0) { ap = client_copyip (client_brkstring (client_getcpy (args), " ", "\n"), ap, MAXARGS); } else { if (servers != NULL && *servers != 0) ap = client_copyip (client_brkstring (client_getcpy (servers), " ", "\n"), ap, MAXARGS); } if (ap == arguments) { *ap++ = client_getcpy ("localhost"); *ap = NULL; } memset(&hints, 0, sizeof(hints)); #ifdef AI_ADDRCONFIG hints.ai_flags = AI_ADDRCONFIG; #endif hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; for (ap = arguments; *ap; ap++) { if (debug) { fprintf(stderr, "Trying to connect to \"%s\" ...\n", *ap); } rc = getaddrinfo(*ap, service, &hints, &res); if (rc) { if (debug) { fprintf(stderr, "Lookup of \"%s\" failed: %s\n", *ap, gai_strerror(rc)); } continue; } for (ai = res; ai != NULL; ai = ai->ai_next) { if (debug) { char address[NI_MAXHOST]; rc = getnameinfo(ai->ai_addr, ai->ai_addrlen, address, sizeof(address), NULL, 0, NI_NUMERICHOST); fprintf(stderr, "Connecting to %s...\n", rc ? "unknown" : address); } sd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (sd < 0) { if (debug) fprintf(stderr, "socket() failed: %s\n", strerror(errno)); continue; } if (connect(sd, ai->ai_addr, ai->ai_addrlen) == 0) { freeaddrinfo(res); client_freelist(arguments); return sd; } if (debug) { fprintf(stderr, "Connection failed: %s\n", strerror(errno)); } close(sd); } freeaddrinfo(res); } client_freelist(arguments); strncpy (response, "no servers available", len_response); return NOTOK; } /* * Free a list of strings */ static void client_freelist(char **list) { free(*list); } /* * static copies of three nmh subroutines */ static char *broken[MAXARGS + 1]; static char ** client_brkstring (char *strg, char *brksep, char *brkterm) { register int bi; register char c, *sp; sp = strg; for (bi = 0; bi < MAXARGS; bi++) { while (client_brkany (c = *sp, brksep)) *sp++ = 0; if (!c || client_brkany (c, brkterm)) { *sp = 0; broken[bi] = 0; return broken; } broken[bi] = sp; while ((c = *++sp) && !client_brkany (c, brksep) && !client_brkany (c, brkterm)) continue; } broken[MAXARGS] = 0; return broken; } /* * returns 1 if chr in strg, 0 otherwise */ static int client_brkany (char chr, char *strg) { register char *sp; if (strg) for (sp = strg; *sp; sp++) if (chr == *sp) return 1; return 0; } /* * copy a string array and return pointer to end */ static char ** client_copyip (char **p, char **q, int len_q) { while (*p && --len_q > 0) *q++ = *p++; *q = NULL; return q; } static char * client_getcpy (char *str) { char *cp; size_t len; len = strlen(str) + 1; cp = mh_xmalloc(len); memcpy (cp, str, len); return cp; } nmh-1.5/sbr/closefds.c000644 007761 000765 00000000505 11713401274 014626 0ustar00kenhkenh000000 000000 /* * closefds.c -- close-up fd's * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void closefds(int i) { int nbits = OPEN_MAX; for (; i < nbits; i++) close (i); } nmh-1.5/sbr/concat.c000644 007761 000765 00000001331 11713401274 014271 0ustar00kenhkenh000000 000000 /* * concat.c -- concatenate a variable number (minimum of 1) * of strings in managed memory * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include char * concat (char *s1, ...) { char *cp, *dp, *sp; size_t len; va_list list; len = strlen (s1) + 1; va_start(list, s1); while ((cp = va_arg(list, char *))) len += strlen (cp); va_end(list); dp = sp = mh_xmalloc(len); sp = copy(s1, sp); va_start(list, s1); while ((cp = va_arg (list, char *))) sp = copy(cp, sp); va_end(list); return dp; } nmh-1.5/sbr/context_del.c000644 007761 000765 00000001546 11713401274 015342 0ustar00kenhkenh000000 000000 /* * context_del.c -- delete an entry from the context/profile list * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * Delete a key/value pair from the context/profile list. * Return 0 if key is found, else return 1. */ int context_del (char *key) { register struct node *np, *pp; for (np = m_defs, pp = NULL; np; pp = np, np = np->n_next) { if (!mh_strcasecmp (np->n_name, key)) { if (!np->n_context) admonish (NULL, "bug: context_del(key=\"%s\")", np->n_name); if (pp) pp->n_next = np->n_next; else m_defs = np->n_next; free (np->n_name); if (np->n_field) free (np->n_field); free ((char *) np); ctxflags |= CTXMOD; return 0; } } return 1; } nmh-1.5/sbr/context_find.c000644 007761 000765 00000000703 11713401274 015510 0ustar00kenhkenh000000 000000 /* * context_find.c -- find an entry in the context/profile list * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char * context_find (char *str) { struct node *np; for (np = m_defs; np; np = np->n_next) if (!mh_strcasecmp (np->n_name, str)) return (np->n_field); return NULL; } nmh-1.5/sbr/context_foil.c000644 007761 000765 00000003543 11713401274 015526 0ustar00kenhkenh000000 000000 /* * context_foil.c -- foil search of profile and context * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* * Foil search of users .mh_profile * If error, return -1, else return 0 */ int context_foil (char *path) { register struct node *np; /* In fact, nobody examines defpath in code paths where * it's been set by us -- the uses in the source tree are: * 1 sbr/context_read.c uses it only after setting it itself * 2 uip/install_mh.c uses it only after setting it itself * 3 uip/mshcmds.c and uip/mark.c print it if given the -debug switch * A worthwhile piece of code cleanup would be to make 1 and * 2 use a local variable and just delete 3. * * Similarly, context and ctxpath are not really used * outside the context_* routines. It might be worth combining * them into one file so the variables can be made static. */ /* We set context to NULL to indicate that no context file * is to be read. (Using /dev/null doesn't work because we * would try to lock it, which causes timeouts with some * locking methods.) */ defpath = context = NULL; /* * If path is given, create a minimal profile/context list */ if (path) { m_defs = (struct node *) mh_xmalloc (sizeof(*np)); np = m_defs; if (!(np->n_name = strdup ("Path"))) { advise (NULL, "strdup failed"); return -1; } if (!(np->n_field = strdup (path))) { advise (NULL, "strdup failed"); return -1; } np->n_context = 0; np->n_next = NULL; if (mypath == NULL && (mypath = getenv ("HOME")) != NULL) if (!(mypath = strdup (mypath))) { advise (NULL, "strdup failed"); return -1; } } return 0; } nmh-1.5/sbr/context_read.c000644 007761 000765 00000010675 11713401274 015514 0ustar00kenhkenh000000 000000 /* * context_read.c -- find and read profile and context files * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. * * This function must be called early on in any nmh utility, and * may only be called once. It does the following: * * o Sets the global variable "mypath" to the home directory path. * * o Sets the global variable "defpath" to the absolute path of * the profile file. * * o Reads in the profile file. Bails out if it can't. * * o Makes sure that the mail directory exists, prompting for * creation if it doesn't. * * o Reads the context file either as set by the MHCONTEXT * environment variable or by the profile. */ #include /* mh internals */ #include /* system call errors */ #include /* structure for getpwuid() results */ void context_read (void) { char buf[BUFSIZ]; /* path name buffer */ char *cp; /* miscellaneous pointer */ char *nd; /* nmh directory pointer */ struct stat st; /* stat() results */ register struct passwd *pw; /* getpwuid() results */ register FILE *ib; /* profile and context file pointer */ /* * If this routine _is_ called again (despite the wanings in the * comments above), return immediately. */ if ( m_defs != 0 ) return; /* * Find user's home directory. Try the HOME environment variable first, * the home directory field in the password file if that's not found. */ if ((mypath = getenv("HOME")) == (char *)0) { if ((pw = getpwuid(getuid())) == (struct passwd *)0 || *pw->pw_dir == '\0') adios(NULL, "cannot determine your home directory"); else mypath = pw->pw_dir; } /* * Find and read user's profile. Check for the existence of an MH environment * variable first with non-empty contents. Convert any relative path name * found there to an absolute one. Look for the profile in the user's home * directory if the MH environment variable isn't set. */ if ((cp = getenv("MH")) && *cp != '\0') { defpath = path(cp, TFILE); if (stat(defpath, &st) != -1 && (st.st_mode & S_IFREG) == 0) adios((char *)0, "`%s' specified by your MH environment variable is not a normal file", cp); if ((ib = fopen(defpath, "r")) == (FILE *)0) adios((char *)0, "unable to read the `%s' profile specified by your MH environment variable", defpath); } else { defpath = concat(mypath, "/", mh_profile, NULL); if ((ib = fopen(defpath, "r")) == (FILE *)0) adios((char *)0, "Doesn't look like nmh is installed. Run install-mh to do so."); cp = mh_profile; } readconfig (&m_defs, ib, cp, 0); fclose (ib); /* * Find the user's nmh directory, which is specified by the "path" profile component. * Convert a relative path name to an absolute one rooted in the home directory. */ if ((cp = context_find ("path")) == (char *)0) adios(NULL, "Your %s file does not contain a path entry.", defpath); if (*cp == '\0') adios(NULL, "Your `%s' profile file does not contain a valid path entry.", defpath); if (*cp != '/') (void)snprintf (nd = buf, sizeof(buf), "%s/%s", mypath, cp); else nd = cp; if (stat(nd, &st) == -1) { if (errno != ENOENT) adios (nd, "error opening"); cp = concat ("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL); if (!getanswer(cp)) adios (NULL, "unable to access MH-directory \"%s\"", nd); free (cp); if (!makedir (nd)) adios (NULL, "unable to create %s", nd); } else if ((st.st_mode & S_IFDIR) == 0) adios ((char *)0, "`%s' is not a directory", nd); /* * Open and read user's context file. The name of the context file comes from the * profile unless overridden by the MHCONTEXT environment variable. */ if ((cp = getenv ("MHCONTEXT")) == (char *)0 || *cp == '\0') cp = context; /* context is NULL if context_foil() was called to disable use of context * We also support users setting explicitly setting MHCONTEXT to /dev/null. * (if this wasn't specialcased then the locking would be liable to fail) */ if (!cp || (strcmp(cp,"/dev/null") == 0)) { ctxpath = NULL; return; } ctxpath = getcpy (m_maildir (cp)); if ((ib = lkfopen (ctxpath, "r"))) { readconfig ((struct node **) 0, ib, cp, 1); lkfclose (ib, ctxpath); } return; } nmh-1.5/sbr/context_replace.c000644 007761 000765 00000002656 11713401274 016214 0ustar00kenhkenh000000 000000 /* * context_replace.c -- add/replace an entry in the context/profile list * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include void context_replace (char *key, char *value) { register struct node *np; /* * If list is emtpy, allocate head of profile/context list. */ if (!m_defs) { m_defs = (struct node *) mh_xmalloc (sizeof(*np)); np = m_defs; np->n_name = getcpy (key); np->n_field = getcpy (value); np->n_context = 1; np->n_next = NULL; ctxflags |= CTXMOD; return; } /* * Search list of context/profile entries for * this key, and replace its value if found. */ for (np = m_defs;; np = np->n_next) { if (!mh_strcasecmp (np->n_name, key)) { if (strcmp (value, np->n_field)) { if (!np->n_context) admonish (NULL, "bug: context_replace(key=\"%s\",value=\"%s\")", key, value); if (np->n_field) free (np->n_field); np->n_field = getcpy (value); ctxflags |= CTXMOD; } return; } if (!np->n_next) break; } /* * Else add this new entry at the end */ np->n_next = (struct node *) mh_xmalloc (sizeof(*np)); np = np->n_next; np->n_name = getcpy (key); np->n_field = getcpy (value); np->n_context = 1; np->n_next = NULL; ctxflags |= CTXMOD; } nmh-1.5/sbr/context_save.c000644 007761 000765 00000004032 11762736346 015544 0ustar00kenhkenh000000 000000 /* * context_save.c -- write out the updated context file * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* * static prototypes */ static int m_chkids(void); void context_save (void) { int action; register struct node *np; FILE *out; sigset_t set, oset; /* No context in use -- silently ignore any changes! */ if (!ctxpath) return; if (!(ctxflags & CTXMOD)) return; ctxflags &= ~CTXMOD; if ((action = m_chkids ()) > 0) return; /* child did it for us */ /* block a few signals */ sigemptyset (&set); sigaddset (&set, SIGHUP); sigaddset (&set, SIGINT); sigaddset (&set, SIGQUIT); sigaddset (&set, SIGTERM); sigprocmask (SIG_BLOCK, &set, &oset); if (!(out = lkfopen (ctxpath, "w"))) adios (ctxpath, "unable to write"); for (np = m_defs; np; np = np->n_next) if (np->n_context) fprintf (out, "%s: %s\n", np->n_name, np->n_field); lkfclose (out, ctxpath); sigprocmask (SIG_SETMASK, &oset, &set); /* reset the signal mask */ if (action == 0) _exit (0); /* we are child, time to die */ } /* * This hack brought to you so we can handle set[ug]id MH programs. * If we return -1, then no fork is made, we update .mh_profile * normally, and return to the caller normally. If we return 0, * then the child is executing, .mh_profile is modified after * we set our [ug]ids to the norm. If we return > 0, then the * parent is executed and .mh_profile has already be modified. * We can just return to the caller immediately. */ static int m_chkids (void) { int i; pid_t pid; if (getuid () == geteuid ()) return (-1); for (i = 0; (pid = fork ()) == -1 && i < 5; i++) sleep (5); switch (pid) { case -1: break; case 0: setgid (getgid ()); setuid (getuid ()); break; default: pidwait (pid, -1); break; } return pid; } nmh-1.5/sbr/copy.c000644 007761 000765 00000000564 11713401274 014003 0ustar00kenhkenh000000 000000 /* * copy.c -- copy a string and return pointer to NULL terminator * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char * copy(char *from, char *to) { while ((*to = *from)) { to++; from++; } return (to); } nmh-1.5/sbr/copyip.c000644 007761 000765 00000000606 11713401274 014331 0ustar00kenhkenh000000 000000 /* * copyip.c -- copy a string array and return pointer to end * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char ** copyip (char **p, char **q, int len_q) { while (*p && --len_q > 0) *q++ = *p++; *q = NULL; return q; } nmh-1.5/sbr/cpydata.c000644 007761 000765 00000001027 11713401274 014451 0ustar00kenhkenh000000 000000 /* * cpydata.c -- copy all data from one fd to another * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void cpydata (int in, int out, char *ifile, char *ofile) { int i; char buffer[BUFSIZ]; while ((i = read(in, buffer, sizeof(buffer))) > 0) { if (write(out, buffer, i) != i) adios(ofile, "error writing"); } if (i == -1) adios(ifile, "error reading"); } nmh-1.5/sbr/cpydgst.c000644 007761 000765 00000002704 11713401274 014504 0ustar00kenhkenh000000 000000 /* * cpydgst.c -- copy from one fd to another in encapsulating mode * -- (do dashstuffing of input data). * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * We want to perform the substitution * * \n(-.*)\n --> \n- \1\n * * This is equivalent to the sed substitution * * sed -e 's%^-%- -%' < ifile > ofile * * but the routine below is faster than the pipe, fork, and exec. */ #define S1 0 #define S2 1 #define output(c) if (bp >= dp) {flush(); *bp++ = c;} else *bp++ = c #define flush() if ((j = bp - outbuf) && write (out, outbuf, j) != j) \ adios (ofile, "error writing"); \ else \ bp = outbuf void cpydgst (int in, int out, char *ifile, char *ofile) { register int i, j, state; register char *cp, *ep; register char *bp, *dp; char buffer[BUFSIZ], outbuf[BUFSIZ]; dp = (bp = outbuf) + sizeof outbuf; for (state = S1; (i = read (in, buffer, sizeof buffer)) > 0;) for (ep = (cp = buffer) + i; cp < ep; cp++) { if (*cp == '\0') continue; switch (state) { case S1: if (*cp == '-') { output ('-'); output (' '); } state = S2; /* fall */ case S2: output (*cp); if (*cp == '\n') state = S1; break; } } if (i == -1) adios (ifile, "error reading"); flush(); } nmh-1.5/sbr/crawl_folders.c000644 007761 000765 00000007126 11713401274 015660 0ustar00kenhkenh000000 000000 /* * crawl_folders.c -- crawl folder hierarchy * * This code is Copyright (c) 2008, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include struct crawl_context { int max; /* how many folders we currently can hold in * the array `folders', increased by * CRAWL_NUMFOLDERS at a time */ int total; /* how many `folders' actually has */ char **folders; /* the array of folders */ int start; int foldp; }; /* * Add the folder name into the * list in a sorted fashion. */ static void add_folder (char *fold, struct crawl_context *crawl) { register int i, j; /* if necessary, reallocate the space for folder names */ if (crawl->foldp >= crawl->max) { crawl->max += CRAWL_NUMFOLDERS; crawl->folders = mh_xrealloc (crawl->folders, crawl->max * sizeof(char *)); } for (i = crawl->start; i < crawl->foldp; i++) if (strcmp (fold, crawl->folders[i]) < 0) { for (j = crawl->foldp - 1; j >= i; j--) crawl->folders[j + 1] = crawl->folders[j]; crawl->foldp++; crawl->folders[i] = fold; return; } crawl->total++; crawl->folders[crawl->foldp++] = fold; } static void add_children (char *name, struct crawl_context *crawl) { char *prefix, *child; struct stat st; struct dirent *dp; DIR * dd; int child_is_folder; if (!(dd = opendir (name))) { admonish (name, "unable to read directory "); return; } if (strcmp (name, ".") == 0) { prefix = getcpy (""); } else { prefix = concat (name, "/", (void *)NULL); } while ((dp = readdir (dd))) { /* If the system supports it, try to skip processing of children we * know are not directories or symlinks. */ child_is_folder = -1; #if defined(HAVE_STRUCT_DIRENT_D_TYPE) if (dp->d_type == DT_DIR) { child_is_folder = 1; } else if (dp->d_type != DT_LNK && dp->d_type != DT_UNKNOWN) { continue; } #endif if (!strcmp (dp->d_name, ".") || !strcmp (dp->d_name, "..")) { continue; } child = concat (prefix, dp->d_name, (void *)NULL); /* If we have no d_type or d_type is DT_LNK or DT_UNKNOWN, stat the * child to see what it is. */ if (child_is_folder == -1) { child_is_folder = (stat (child, &st) != -1 && S_ISDIR(st.st_mode)); } if (child_is_folder) { /* add_folder saves child in the list, don't free it */ add_folder (child, crawl); } else { free (child); } } closedir (dd); free(prefix); } static void crawl_folders_body (struct crawl_context *crawl, char *dir, crawl_callback_t *callback, void *baton) { int i; int os = crawl->start; int of = crawl->foldp; crawl->start = crawl->foldp; add_children (dir, crawl); for (i = crawl->start; i < crawl->foldp; i++) { char *fold = crawl->folders[i]; int crawl_children = 1; if (callback != NULL) { crawl_children = callback (fold, baton); } if (crawl_children) { crawl_folders_body (crawl, fold, callback, baton); } } crawl->start = os; crawl->foldp = of; } void crawl_folders (char *dir, crawl_callback_t *callback, void *baton) { struct crawl_context *crawl = mh_xmalloc (sizeof(*crawl)); crawl->max = CRAWL_NUMFOLDERS; crawl->total = crawl->start = crawl->foldp = 0; crawl->folders = mh_xmalloc (crawl->max * sizeof(*crawl->folders)); crawl_folders_body (crawl, dir, callback, baton); /* Note that we "leak" the folder names, on the assumption that the caller * is using them. */ free (crawl->folders); free (crawl); } nmh-1.5/sbr/discard.c000644 007761 000765 00000001075 11762736346 014457 0ustar00kenhkenh000000 000000 /* * discard.c -- discard output on a file pointer * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include void discard (FILE *io) { if (io == NULL) return; tcflush (fileno(io), TCOFLUSH); #if defined(_FSTDIO) || defined(__DragonFly__) fpurge (io); #else # ifdef LINUX_STDIO io->_IO_write_ptr = io->_IO_write_base; # else if ((io->_ptr = io->_base)) io->_cnt = 0; # endif #endif } nmh-1.5/sbr/done.c000644 007761 000765 00000000421 11713401274 013746 0ustar00kenhkenh000000 000000 /* * done.c -- terminate the program * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void (*done) (int) NORETURN = exit; nmh-1.5/sbr/dtime.c000644 007761 000765 00000021500 11762736346 014143 0ustar00kenhkenh000000 000000 /* * dtime.c -- time/date routines * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* for snprintf() */ #include #include #include #if !defined(HAVE_STRUCT_TM_TM_GMTOFF) extern long timezone; #endif /* * The number of days in the year, accounting for leap years */ #define dysize(y) \ (((y) % 4) ? 365 : (((y) % 100) ? 366 : (((y) % 400) ? 365 : 366))) char *tw_moty[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL }; char *tw_dotw[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", NULL }; char *tw_ldotw[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", NULL }; struct zone { char *std; char *dst; int shift; }; static int dmsize[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; /* * Get current time (adjusted for local time * zone and daylight savings time) expressed * as nmh "broken-down" time structure. */ struct tws * dlocaltimenow (void) { time_t clock; time (&clock); return dlocaltime (&clock); } /* * Take clock value and return pointer to nmh time structure * containing "broken-down" time. The time is adjusted for * local time zone and daylight savings time. */ struct tws * dlocaltime (time_t *clock) { static struct tws tw; struct tm *tm; if (!clock) return NULL; tm = localtime (clock); tw.tw_sec = tm->tm_sec; tw.tw_min = tm->tm_min; tw.tw_hour = tm->tm_hour; tw.tw_mday = tm->tm_mday; tw.tw_mon = tm->tm_mon; /* * tm_year is always "year - 1900". * So we correct for this. */ tw.tw_year = tm->tm_year + 1900; tw.tw_wday = tm->tm_wday; tw.tw_yday = tm->tm_yday; tw.tw_flags = TW_NULL; if (tm->tm_isdst) tw.tw_flags |= TW_DST; #ifdef HAVE_STRUCT_TM_TM_GMTOFF tw.tw_zone = tm->tm_gmtoff / 60; if (tm->tm_isdst) /* if DST is in effect */ tw.tw_zone -= 60; /* reset to normal offset */ #else tzset(); tw.tw_zone = -(timezone / 60); #endif tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; tw.tw_flags &= ~TW_SZONE; tw.tw_flags |= TW_SZEXP; tw.tw_clock = *clock; return (&tw); } /* * Take clock value and return pointer to nmh time * structure containing "broken-down" time. Time is * expressed in UTC (Coordinated Universal Time). */ struct tws * dgmtime (time_t *clock) { static struct tws tw; struct tm *tm; if (!clock) return NULL; tm = gmtime (clock); tw.tw_sec = tm->tm_sec; tw.tw_min = tm->tm_min; tw.tw_hour = tm->tm_hour; tw.tw_mday = tm->tm_mday; tw.tw_mon = tm->tm_mon; /* * tm_year is always "year - 1900" * So we correct for this. */ tw.tw_year = tm->tm_year + 1900; tw.tw_wday = tm->tm_wday; tw.tw_yday = tm->tm_yday; tw.tw_flags = TW_NULL; if (tm->tm_isdst) tw.tw_flags |= TW_DST; tw.tw_zone = 0; tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; tw.tw_flags &= ~TW_SZONE; tw.tw_flags |= TW_SZEXP; tw.tw_clock = *clock; return (&tw); } /* * Using a nmh "broken-down" time structure, * produce a 26-byte date/time string, such as * * Tue Jan 14 17:49:03 1992\n\0 */ char * dctime (struct tws *tw) { static char buffer[26]; if (!tw) return NULL; snprintf (buffer, sizeof(buffer), "%.3s %.3s %02d %02d:%02d:%02d %.4d\n", tw_dotw[tw->tw_wday], tw_moty[tw->tw_mon], tw->tw_mday, tw->tw_hour, tw->tw_min, tw->tw_sec, tw->tw_year < 100 ? tw->tw_year + 1900 : tw->tw_year); return buffer; } /* * Produce a date/time string of the form * * Mon, 16 Jun 1992 15:30:48 -700 (or) * Mon, 16 Jun 1992 15:30:48 EDT * * for the current time, as specified by rfc822. * The first form is required by rfc1123. */ char * dtimenow (int alpha_timezone) { time_t clock; time (&clock); return dtime (&clock, alpha_timezone); } /* * Using a local calendar time value, produce * a date/time string of the form * * Mon, 16 Jun 1992 15:30:48 -700 (or) * Mon, 16 Jun 1992 15:30:48 EDT * * as specified by rfc822. The first form is required * by rfc1123 for outgoing messages. */ char * dtime (time_t *clock, int alpha_timezone) { if (alpha_timezone) /* use alpha-numeric timezones */ return dasctime (dlocaltime (clock), TW_NULL); else /* use numeric timezones */ return dasctime (dlocaltime (clock), TW_ZONE); } /* * Using a nmh "broken-down" time structure, produce * a date/time string of the form * * Mon, 16 Jun 1992 15:30:48 -0700 * * as specified by rfc822 and rfc1123. */ char * dasctime (struct tws *tw, int flags) { char buffer[80]; static char result[80]; if (!tw) return NULL; /* Display timezone if known */ if ((tw->tw_flags & TW_SZONE) == TW_SZNIL) result[0] = '\0'; else snprintf(result, sizeof(result), " %s", dtimezone(tw->tw_zone, tw->tw_flags | flags)); snprintf(buffer, sizeof(buffer), "%02d %s %0*d %02d:%02d:%02d%s", tw->tw_mday, tw_moty[tw->tw_mon], tw->tw_year < 100 ? 2 : 4, tw->tw_year, tw->tw_hour, tw->tw_min, tw->tw_sec, result); if ((tw->tw_flags & TW_SDAY) == TW_SEXP) snprintf (result, sizeof(result), "%s, %s", tw_dotw[tw->tw_wday], buffer); else if ((tw->tw_flags & TW_SDAY) == TW_SNIL) strncpy (result, buffer, sizeof(result)); else snprintf (result, sizeof(result), "%s (%s)", buffer, tw_dotw[tw->tw_wday]); return result; } /* * Get the timezone for given offset. * This used to return a three-letter abbreviation for some offset * values. But not many. Until there's a good way to do that, * return the string representation of the numeric offset. */ char * dtimezone (int offset, int flags) { int hours, mins; static char buffer[10]; if (offset < 0) { mins = -((-offset) % 60); hours = -((-offset) / 60); } else { mins = offset % 60; hours = offset / 60; } #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST if (flags & TW_DST) hours += 1; #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ snprintf (buffer, sizeof(buffer), "%s%02d%02d", offset < 0 ? "-" : "+", abs (hours), abs (mins)); return buffer; } /* * Convert nmh time structure for local "broken-down" * time to calendar time (clock value). This routine * is based on the gtime() routine written by Steven Shafer * at CMU. It was forwarded to MTR by Jay Lepreau at Utah-CS. */ time_t dmktime (struct tws *tw) { int i, sec, min, hour, mday, mon, year; time_t result; if (tw->tw_clock != 0) return tw->tw_clock; if ((sec = tw->tw_sec) < 0 || sec > 61 || (min = tw->tw_min) < 0 || min > 59 || (hour = tw->tw_hour) < 0 || hour > 23 || (mday = tw->tw_mday) < 1 || mday > 31 || (mon = tw->tw_mon + 1) < 1 || mon > 12) return (tw->tw_clock = (time_t) -1); year = tw->tw_year; result = 0; if (year < 1970) year += 1900; if (year < 1970) year += 100; for (i = 1970; i < year; i++) result += dysize (i); if (dysize (year) == 366 && mon >= 3) result++; while (--mon) result += dmsize[mon - 1]; result += mday - 1; result = 24 * result + hour; result = 60 * result + min; result = 60 * result + sec; result -= 60 * tw->tw_zone; if (tw->tw_flags & TW_DST) result -= 60 * 60; return (tw->tw_clock = result); } /* * Simple calculation of day of the week. Algorithm * used is Zeller's congruence. We assume that * if tw->tw_year < 100, then the century = 19. */ void set_dotw (struct tws *tw) { int month, day, year, century; month = tw->tw_mon - 1; day = tw->tw_mday; year = tw->tw_year % 100; century = tw->tw_year < 100 ? 19 : tw->tw_year / 100; if (month <= 0) { month += 12; if (--year < 0) { year += 100; century--; } } tw->tw_wday = ((26 * month - 2) / 10 + day + year + year / 4 - 3 * century / 4 + 1) % 7; if (tw->tw_wday < 0) tw->tw_wday += 7; tw->tw_flags &= ~TW_SDAY, tw->tw_flags |= TW_SIMP; } /* * Copy nmh time structure */ void twscopy (struct tws *tb, struct tws *tw) { *tb = *tw; /* struct copy */ #if 0 tb->tw_sec = tw->tw_sec; tb->tw_min = tw->tw_min; tb->tw_hour = tw->tw_hour; tb->tw_mday = tw->tw_mday; tb->tw_mon = tw->tw_mon; tb->tw_year = tw->tw_year; tb->tw_wday = tw->tw_wday; tb->tw_yday = tw->tw_yday; tb->tw_zone = tw->tw_zone; tb->tw_clock = tw->tw_clock; tb->tw_flags = tw->tw_flags; #endif } /* * Compare two nmh time structures */ int twsort (struct tws *tw1, struct tws *tw2) { time_t c1, c2; if (tw1->tw_clock == 0) dmktime (tw1); if (tw2->tw_clock == 0) dmktime (tw2); return ((c1 = tw1->tw_clock) > (c2 = tw2->tw_clock) ? 1 : c1 == c2 ? 0 : -1); } nmh-1.5/sbr/dtimep.c000644 007761 000765 00000232537 11765270265 014335 0ustar00kenhkenh000000 000000 #line 3 "sbr/dtimep.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 30 #define YY_END_OF_BUFFER 31 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[571] = { 0, 0, 0, 31, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 25, 19, 18, 17, 16, 15, 28, 27, 21, 20, 24, 23, 22, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 6, 6, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 6, 0, 2, 4, 1, 1, 0, 6, 0, 0, 0, 1, 0, 0, 1, 2, 4, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 4, 4, 1, 5, 6, 7, 1, 8, 9, 10, 9, 9, 9, 9, 9, 9, 9, 9, 11, 1, 1, 1, 1, 1, 1, 12, 1, 13, 14, 15, 16, 17, 18, 1, 19, 1, 1, 20, 21, 22, 23, 1, 1, 24, 25, 26, 1, 27, 1, 1, 1, 28, 1, 29, 1, 1, 1, 30, 31, 32, 33, 34, 16, 35, 36, 37, 19, 1, 38, 39, 40, 41, 42, 1, 43, 44, 45, 46, 47, 27, 1, 48, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[49] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int16_t yy_base[571] = { 0, 0, 0, 907, 908, 37, 52, 55, 78, 24, 872, 25, 44, 48, 864, 872, 61, 46, 869, 81, 70, 82, 84, 882, 85, 86, 877, 87, 875, 69, 70, 72, 860, 79, 82, 854, 84, 852, 109, 111, 127, 115, 125, 853, 860, 862, 862, 855, 851, 13, 87, 850, 842, 843, 842, 844, 845, 838, 849, 849, 851, 838, 854, 853, 852, 851, 850, 849, 848, 847, 846, 845, 844, 843, 842, 841, 908, 820, 819, 818, 817, 816, 815, 814, 813, 812, 811, 810, 809, 808, 807, 127, 135, 92, 817, 816, 51, 819, 807, 815, 812, 145, 138, 140, 129, 148, 156, 154, 157, 159, 162, 843, 163, 168, 170, 171, 174, 176, 177, 178, 186, 815, 814, 908, 908, 908, 908, 908, 908, 908, 908, 908, 908, 908, 908, 908, 908, 188, 194, 799, 806, 808, 808, 798, 147, 147, 790, 791, 793, 197, 205, 206, 796, 789, 793, 785, 225, 828, 799, 798, 825, 824, 789, 794, 784, 791, 778, 786, 789, 774, 784, 782, 787, 786, 908, 908, 199, 172, 197, 208, 179, 212, 219, 222, 811, 227, 221, 226, 223, 233, 266, 810, 766, 779, 779, 268, 206, 774, 773, 210, 776, 764, 772, 769, 754, 758, 798, 751, 767, 763, 763, 756, 746, 760, 762, 747, 770, 769, 271, 750, 743, 747, 739, 754, 781, 780, 745, 741, 748, 744, 277, 280, 282, 775, 257, 774, 741, 731, 291, 771, 729, 736, 738, 738, 728, 245, 251, 720, 721, 723, 294, 716, 295, 729, 719, 731, 729, 296, 729, 710, 724, 717, 716, 299, 307, 752, 708, 721, 721, 707, 747, 717, 713, 707, 316, 310, 327, 313, 318, 702, 696, 292, 709, 708, 258, 711, 699, 707, 704, 304, 228, 312, 331, 293, 338, 341, 340, 735, 342, 343, 345, 693, 733, 686, 699, 684, 346, 701, 701, 700, 347, 349, 726, 693, 683, 677, 690, 680, 691, 344, 719, 358, 360, 718, 717, 675, 682, 684, 684, 674, 323, 330, 666, 667, 669, 378, 672, 665, 669, 661, 676, 703, 702, 667, 663, 670, 666, 697, 375, 655, 377, 649, 908, 908, 383, 385, 387, 653, 647, 651, 691, 658, 680, 389, 398, 688, 392, 401, 369, 363, 348, 389, 402, 403, 406, 413, 687, 410, 411, 414, 418, 686, 642, 655, 655, 641, 681, 651, 647, 641, 677, 415, 420, 676, 675, 674, 673, 631, 424, 630, 631, 389, 221, 637, 444, 445, 632, 625, 629, 621, 636, 663, 662, 627, 623, 630, 626, 447, 657, 456, 656, 623, 613, 607, 620, 610, 621, 640, 429, 648, 638, 611, 607, 601, 605, 598, 609, 609, 451, 454, 639, 595, 608, 608, 594, 634, 604, 600, 594, 456, 459, 469, 589, 583, 587, 627, 594, 463, 465, 594, 593, 579, 591, 580, 578, 581, 474, 478, 618, 585, 575, 569, 582, 572, 583, 480, 483, 492, 486, 490, 611, 610, 609, 567, 598, 495, 578, 577, 563, 575, 560, 570, 568, 504, 498, 507, 558, 552, 556, 596, 563, 509, 594, 511, 513, 522, 524, 533, 593, 527, 908, 546, 545, 559, 543, 557, 559, 544, 535, 585, 584, 583, 525, 482, 538, 475, 527, 531, 908, 908, 485, 908, 482, 462, 464, 474, 541, 451, 430, 543, 552, 546, 908, 388, 378, 908, 220, 548, 550, 554, 556, 558, 908, 908, 190, 111, 64, 560, 562, 54, 908, 564, 566, 568, 570, 572, 574, 908, 908, 908, 908 } ; static yyconst flex_int16_t yy_def[571] = { 0, 570, 1, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 0 } ; static yyconst flex_int16_t yy_nxt[957] = { 0, 4, 5, 5, 5, 6, 4, 7, 4, 8, 8, 4, 9, 4, 10, 4, 11, 4, 4, 12, 13, 14, 15, 4, 16, 17, 4, 18, 19, 4, 9, 4, 4, 10, 4, 4, 4, 4, 4, 13, 14, 15, 4, 4, 16, 17, 4, 4, 4, 20, 21, 108, 22, 109, 23, 24, 540, 25, 26, 46, 27, 38, 38, 28, 39, 39, 43, 29, 47, 30, 44, 31, 32, 33, 48, 562, 34, 35, 50, 36, 40, 143, 57, 37, 62, 41, 41, 42, 42, 51, 49, 54, 58, 60, 63, 55, 64, 144, 66, 69, 71, 74, 77, 79, 61, 81, 65, 56, 67, 70, 72, 75, 84, 78, 80, 86, 82, 89, 91, 91, 92, 92, 561, 85, 101, 101, 87, 40, 90, 40, 110, 151, 41, 41, 139, 111, 137, 137, 140, 93, 151, 94, 151, 95, 138, 138, 96, 97, 98, 99, 151, 100, 149, 149, 150, 150, 151, 93, 156, 151, 94, 151, 157, 154, 151, 156, 97, 98, 99, 157, 151, 100, 151, 156, 218, 152, 151, 157, 156, 156, 156, 218, 157, 157, 157, 181, 153, 182, 156, 158, 183, 155, 157, 161, 162, 184, 163, 174, 174, 218, 159, 218, 164, 175, 175, 160, 188, 189, 151, 168, 218, 165, 149, 149, 218, 190, 190, 166, 220, 167, 169, 218, 170, 218, 218, 223, 171, 156, 218, 218, 335, 221, 230, 230, 195, 195, 219, 196, 560, 197, 244, 198, 231, 231, 199, 200, 201, 202, 240, 203, 554, 222, 241, 225, 226, 196, 245, 435, 197, 232, 224, 227, 228, 233, 200, 201, 202, 436, 232, 203, 238, 229, 233, 218, 337, 234, 234, 239, 239, 274, 263, 264, 274, 294, 232, 295, 275, 275, 329, 276, 276, 277, 278, 238, 296, 335, 156, 156, 156, 297, 157, 157, 157, 281, 330, 282, 335, 283, 310, 310, 284, 285, 286, 287, 335, 288, 311, 311, 274, 320, 320, 281, 321, 321, 282, 319, 319, 322, 322, 274, 285, 286, 287, 335, 325, 288, 320, 320, 326, 340, 335, 336, 335, 335, 335, 335, 338, 335, 156, 354, 405, 354, 157, 362, 362, 363, 355, 355, 356, 356, 364, 373, 364, 374, 365, 405, 365, 366, 366, 367, 367, 405, 343, 375, 339, 342, 344, 156, 376, 156, 335, 157, 408, 157, 345, 354, 341, 380, 380, 354, 346, 405, 392, 392, 393, 393, 393, 393, 398, 398, 364, 404, 404, 364, 405, 405, 406, 365, 405, 407, 404, 404, 405, 405, 399, 405, 405, 156, 400, 433, 417, 157, 401, 402, 418, 403, 553, 419, 419, 427, 427, 428, 409, 430, 430, 434, 552, 400, 457, 457, 412, 539, 401, 402, 414, 413, 364, 405, 410, 417, 365, 411, 415, 405, 438, 439, 449, 450, 417, 416, 466, 466, 418, 467, 467, 475, 475, 476, 477, 477, 476, 451, 484, 484, 485, 485, 493, 501, 478, 479, 493, 502, 501, 494, 494, 536, 502, 495, 495, 503, 503, 476, 504, 504, 501, 506, 506, 546, 502, 507, 507, 505, 505, 476, 510, 510, 493, 519, 519, 493, 545, 501, 544, 518, 518, 543, 519, 519, 524, 524, 525, 525, 526, 526, 501, 537, 501, 405, 502, 540, 502, 525, 525, 503, 503, 501, 527, 527, 541, 502, 542, 542, 505, 505, 535, 535, 536, 538, 538, 539, 547, 547, 548, 548, 540, 551, 551, 555, 555, 556, 556, 549, 550, 557, 557, 558, 558, 559, 559, 563, 563, 564, 564, 565, 565, 566, 566, 567, 567, 567, 567, 568, 568, 569, 569, 405, 405, 493, 534, 533, 532, 531, 530, 529, 528, 335, 501, 523, 405, 522, 521, 520, 517, 516, 515, 514, 513, 512, 511, 509, 508, 335, 335, 335, 500, 499, 498, 376, 497, 496, 405, 492, 491, 490, 489, 488, 487, 486, 483, 335, 482, 481, 480, 474, 473, 472, 405, 471, 470, 469, 468, 405, 465, 464, 463, 462, 461, 460, 459, 458, 218, 428, 456, 455, 454, 297, 453, 452, 335, 451, 448, 447, 446, 445, 405, 405, 444, 443, 442, 441, 440, 437, 432, 431, 429, 218, 218, 218, 354, 151, 426, 425, 424, 335, 423, 422, 421, 420, 335, 405, 364, 363, 397, 218, 396, 395, 394, 391, 390, 151, 389, 388, 387, 386, 335, 335, 385, 384, 383, 382, 381, 379, 378, 377, 372, 371, 370, 369, 368, 151, 151, 274, 361, 360, 359, 184, 358, 357, 218, 353, 352, 351, 350, 349, 348, 151, 347, 335, 334, 333, 332, 331, 328, 327, 324, 323, 318, 317, 316, 218, 315, 314, 313, 312, 218, 309, 308, 307, 306, 305, 304, 303, 302, 301, 111, 300, 299, 298, 293, 292, 291, 290, 289, 238, 280, 279, 151, 232, 273, 272, 271, 270, 218, 218, 269, 268, 267, 266, 265, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 151, 251, 250, 249, 248, 247, 246, 243, 242, 237, 236, 235, 151, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 151, 151, 205, 204, 156, 194, 193, 192, 191, 187, 186, 185, 180, 179, 178, 177, 176, 173, 172, 151, 148, 147, 146, 145, 142, 141, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 107, 106, 105, 104, 103, 102, 76, 88, 83, 76, 73, 68, 59, 53, 52, 45, 570, 3, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570 } ; static yyconst flex_int16_t yy_chk[957] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 49, 5, 49, 5, 5, 559, 5, 5, 11, 5, 6, 6, 5, 7, 7, 9, 5, 11, 5, 9, 5, 5, 5, 12, 556, 5, 5, 13, 5, 8, 96, 17, 5, 20, 8, 8, 8, 8, 13, 12, 16, 17, 19, 20, 16, 21, 96, 22, 24, 25, 27, 29, 30, 19, 31, 21, 16, 22, 24, 25, 27, 33, 29, 30, 34, 31, 36, 38, 38, 39, 39, 555, 33, 41, 41, 34, 42, 36, 40, 50, 104, 42, 42, 93, 50, 91, 91, 93, 40, 102, 40, 103, 40, 92, 92, 40, 40, 40, 40, 105, 40, 101, 101, 101, 101, 107, 40, 106, 108, 40, 109, 106, 104, 110, 112, 40, 40, 40, 112, 113, 40, 114, 115, 177, 102, 116, 115, 117, 118, 119, 180, 117, 118, 119, 144, 103, 144, 120, 106, 145, 105, 120, 109, 110, 145, 112, 137, 137, 178, 107, 176, 113, 138, 138, 108, 149, 149, 151, 117, 179, 114, 150, 150, 181, 151, 151, 115, 177, 116, 118, 182, 119, 186, 183, 180, 120, 156, 187, 185, 290, 178, 188, 188, 156, 156, 176, 156, 554, 156, 199, 156, 189, 189, 156, 156, 156, 156, 196, 156, 546, 179, 196, 182, 183, 156, 199, 402, 156, 234, 181, 185, 186, 234, 156, 156, 156, 402, 190, 156, 195, 187, 190, 218, 290, 190, 190, 195, 195, 230, 218, 218, 231, 245, 232, 245, 230, 230, 284, 231, 231, 232, 232, 238, 246, 293, 250, 252, 257, 246, 250, 252, 257, 238, 284, 238, 289, 238, 263, 263, 238, 238, 238, 238, 291, 238, 264, 264, 274, 275, 275, 238, 277, 277, 238, 274, 274, 278, 278, 276, 238, 238, 238, 292, 281, 238, 276, 276, 281, 293, 294, 289, 296, 295, 298, 299, 291, 300, 306, 310, 370, 311, 306, 319, 319, 319, 310, 310, 311, 311, 321, 330, 322, 330, 321, 369, 322, 321, 321, 322, 322, 368, 296, 331, 292, 295, 298, 348, 331, 350, 335, 348, 370, 350, 299, 354, 294, 335, 335, 356, 300, 371, 354, 354, 355, 355, 356, 356, 363, 363, 364, 366, 366, 367, 372, 373, 368, 367, 374, 369, 367, 367, 377, 378, 364, 375, 379, 391, 364, 401, 380, 391, 364, 364, 380, 364, 544, 380, 380, 392, 392, 392, 371, 398, 398, 401, 543, 364, 428, 428, 374, 538, 364, 364, 377, 375, 404, 405, 372, 417, 404, 373, 378, 537, 405, 405, 417, 417, 419, 379, 438, 438, 419, 439, 439, 449, 449, 449, 450, 450, 450, 451, 457, 457, 458, 458, 466, 525, 451, 451, 467, 525, 475, 466, 466, 535, 475, 467, 467, 475, 475, 475, 476, 476, 477, 478, 478, 534, 477, 479, 479, 477, 477, 477, 485, 485, 493, 494, 494, 495, 533, 501, 532, 493, 493, 530, 495, 495, 501, 501, 503, 503, 504, 504, 505, 523, 506, 522, 505, 526, 506, 505, 505, 506, 506, 507, 509, 509, 526, 507, 527, 527, 507, 507, 518, 518, 518, 524, 524, 524, 536, 536, 539, 539, 540, 541, 541, 547, 547, 548, 548, 540, 540, 549, 549, 550, 550, 551, 551, 557, 557, 558, 558, 561, 561, 562, 562, 563, 563, 564, 564, 565, 565, 566, 566, 521, 520, 519, 517, 516, 515, 514, 513, 512, 511, 508, 502, 500, 499, 498, 497, 496, 492, 491, 490, 489, 488, 487, 486, 484, 483, 482, 481, 480, 474, 473, 472, 471, 470, 469, 468, 465, 464, 463, 462, 461, 460, 459, 456, 455, 454, 453, 452, 448, 447, 446, 445, 444, 443, 442, 441, 440, 437, 436, 435, 434, 433, 432, 431, 430, 429, 427, 426, 425, 424, 423, 422, 421, 420, 418, 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 403, 400, 399, 397, 396, 395, 394, 393, 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, 376, 365, 362, 361, 360, 359, 358, 357, 351, 349, 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 334, 333, 332, 329, 328, 327, 326, 325, 324, 323, 320, 318, 317, 316, 315, 314, 313, 312, 309, 308, 307, 305, 304, 303, 302, 301, 297, 288, 287, 286, 285, 283, 282, 280, 279, 273, 272, 271, 270, 269, 268, 267, 266, 265, 262, 261, 260, 259, 258, 256, 255, 254, 253, 251, 249, 248, 247, 244, 243, 242, 241, 240, 239, 237, 236, 235, 233, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 198, 197, 194, 193, 192, 191, 184, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 155, 154, 153, 152, 148, 147, 146, 143, 142, 141, 140, 139, 122, 121, 111, 100, 99, 98, 97, 95, 94, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 48, 47, 46, 45, 44, 43, 37, 35, 32, 28, 26, 23, 18, 15, 14, 10, 3, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "dtimep.l" /* dtimep.lex exceeds the default table capacities for some old versions * of lex (and the minimum defaults as specified by POSIX). The following * choices meet or exceed the lex defaults for older SunOS4.x, Solaris, * HPUX, and AIX. */ #line 11 "dtimep.l" #include #include /* Since we're looking at a string at a time, don't worry about * wrapping to the next buffer. */ #define yywrap() 1 #define YY_SKIP_YYWRAP #define YY_NO_INPUT /* This is the tricky thing that makes this function cool. We * replace the traditional int yylex(void) declaration with our * dparsetime() declaration, essentially piggy-backing off the * utility of the yylex() function and adding what we need to make * the parsing function useful to us. */ #define YY_DECL struct tws *dparsetime(char *lexstr) /* yyerminate() is called after the input string is matched to * completion (actually, when the lexer reaches an EOF). The only * thing that really needs to be in this macro function is the * return call, which must be substituted inline into dparsetime. */ #define yyterminate() (void)yy_delete_buffer(lexhandle); \ if(!(tw.tw_flags & TW_SUCC)) { \ return (struct tws *)NULL; \ } \ if(tw.tw_year < 1970) \ tw.tw_year += 1900; \ if(tw.tw_year < 1970) \ tw.tw_year += 100; \ return(&tw) /* * Patchable flag that says how to interpret NN/NN/NN dates. When * true, we do it European style: DD/MM/YY. When false, we do it * American style: MM/DD/YY. Of course, these are all non-RFC822 * compliant. */ int europeandate = 0; /* * Table to convert month names to numeric month. We use the * fact that the low order 5 bits of the sum of the 2nd & 3rd * characters of the name is a hash with no collisions for the 12 * valid month names. (The mask to 5 bits maps any combination of * upper and lower case into the same hash value). */ static int month_map[] = { 0, 6, /* 1 - Jul */ 3, /* 2 - Apr */ 5, /* 3 - Jun */ 0, 10, /* 5 - Nov */ 0, 1, /* 7 - Feb */ 11, /* 8 - Dec */ 0, 0, 0, 0, 0, 0, 0, /*15 - Jan */ 0, 0, 0, 2, /*19 - Mar */ 0, 8, /*21 - Sep */ 0, 9, /*23 - Oct */ 0, 0, 4, /*26 - May */ 0, 7 /*28 - Aug */ }; /* * Lookup table for day-of-week using the same hash trick as for above name-of- * month table, but using the first and second character, not second and third. * * Compute index into table using: (day_name[0] & 7) + (day_name[1] & 4) */ static int day_map[] = { 0, 0, 0, 6, /* 3 - Sat */ 4, /* 4 - Thu */ 0, 5, /* 6 - Fri */ 0, /* 7 - Sun */ 2, /* 8 - Tue */ 1 /* 9 - Mon */, 0, 3 /*11 - Wed */ }; /* The SET* macros will parse for the appropriate field, and leave the * cp pointer at the first character after the desired field. Be * careful with variable-length fields or alpha-num mixes. * The SKIP* macros skip over characters of a particular class and * leave cp at the position of the first character that doesn't match * that class. Correspondingly, SKIPTO* skips until it reaches a * character of a particular class. */ #define INIT() { cp = yytext;} #define SETWDAY() { tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \ tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \ SKIPA(); } #define SETMON() { cp++; \ tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \ SKIPA(); } #define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \ SKIPD(); } #define SETYEAR() { tw.tw_year = atoi(cp); \ SKIPD(); } #define SETDAY() { tw.tw_mday = atoi(cp); \ tw.tw_flags |= TW_YES; \ SKIPD(); } #define SETTIME() { tw.tw_hour = atoi(cp); \ cp += 2; \ SKIPTOD(); \ tw.tw_min = atoi(cp); \ cp += 2; \ if(*cp == ':') { \ tw.tw_sec = atoi(++cp); SKIPD(); } } #define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \ tw.tw_flags |= TW_SZEXP; \ SKIPD(); } #define SETDST() { tw.tw_flags |= TW_DST; } #define SKIPD() { while ( isdigit(*cp++) ) ; \ --cp; } #define SKIPTOD() { while ( !isdigit(*cp++) ) ; \ --cp; } #define SKIPA() { while ( isalpha(*cp++) ) ; \ --cp; } #define SKIPTOA() { while ( !isalpha(*cp++) ) ; \ --cp; } #define SKIPSP() { while ( isspace(*cp++) ) ; \ --cp; } #define SKIPTOSP() { while ( !isspace(*cp++) ) ; \ --cp; } #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST # ifdef HAVE_SYS_TIME_H # include # endif #include static void zonehack (struct tws *tw) { register struct tm *tm; if (dmktime (tw) == (time_t) -1) return; tm = localtime (&tw->tw_clock); if (tm->tm_isdst) { tw->tw_flags |= TW_DST; tw->tw_zone -= 60; } } #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ /* The year can either be 2 digits, or 4. However, after Y2K, we found that some MUA were reporting the year 100, hence the middle term here. yyterminate() resolves the actual issues with 2-digit years. */ #line 1027 "sbr/dtimep.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); yy_size_t yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 226 "dtimep.l" /* This section begins the definition of dparsetime(). Put here any local variable definitions and initializations */ YY_BUFFER_STATE lexhandle; register unsigned char *cp; static struct tws tw; memset(&tw,0,sizeof(struct tws)); lexhandle = yy_scan_string(lexstr); #line 1225 "sbr/dtimep.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 571 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 908 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 241 "dtimep.l" { INIT(); SETWDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETTIME(); SKIPTOD(); SETYEAR(); } YY_BREAK case 2: YY_RULE_SETUP #line 254 "dtimep.l" { INIT(); SETWDAY(); SKIPTOD(); SETDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETYEAR(); SKIPTOD(); SETTIME(); } YY_BREAK case 3: YY_RULE_SETUP #line 266 "dtimep.l" { INIT(); SETDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETYEAR(); SKIPTOD(); SETTIME(); } YY_BREAK case 4: YY_RULE_SETUP #line 276 "dtimep.l" { INIT(); SETWDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); SKIPTOD(); SETTIME(); } YY_BREAK case 5: YY_RULE_SETUP #line 288 "dtimep.l" { INIT(); SETWDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); } YY_BREAK case 6: YY_RULE_SETUP #line 298 "dtimep.l" { INIT(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); SKIPTOA(); SETWDAY(); } YY_BREAK case 7: YY_RULE_SETUP #line 308 "dtimep.l" { INIT(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); } YY_BREAK case 8: YY_RULE_SETUP #line 316 "dtimep.l" { INIT(); if(europeandate) { /* DD/MM/YY */ SETDAY(); SKIPTOD(); SETMON_NUM(); } else { /* MM/DD/YY */ SETMON_NUM(); SKIPTOD(); SETDAY(); } SKIPTOD(); SETYEAR(); SKIPTOD(); SETTIME(); } YY_BREAK case 9: YY_RULE_SETUP #line 334 "dtimep.l" { INIT(); if(europeandate) { /* DD/MM/YY */ SETDAY(); SKIPTOD(); SETMON_NUM(); } else { /* MM/DD/YY */ SETMON_NUM(); SKIPTOD(); SETDAY(); } SKIPTOD(); SETYEAR(); } YY_BREAK case 10: YY_RULE_SETUP #line 351 "dtimep.l" YY_BREAK case 11: YY_RULE_SETUP #line 352 "dtimep.l" tw.tw_hour += 12; YY_BREAK case 12: YY_RULE_SETUP #line 354 "dtimep.l" { INIT(); SKIPTOD(); SETZONE(atoi(cp)); #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST zonehack (&tw); #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ yyterminate(); } YY_BREAK case 13: YY_RULE_SETUP #line 363 "dtimep.l" { INIT(); SKIPTOD(); SETZONE(-atoi(cp)); #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST zonehack (&tw); #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ yyterminate(); } YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP #line 373 "dtimep.l" INIT(); SETZONE(0); yyterminate(); YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP #line 374 "dtimep.l" INIT(); SETZONE(0); yyterminate(); YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP #line 375 "dtimep.l" INIT(); SETZONE(-500); yyterminate(); YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP #line 376 "dtimep.l" { INIT(); SETDST(); SETZONE(-500); yyterminate(); } YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP #line 378 "dtimep.l" INIT(); SETZONE(-600); yyterminate(); YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP #line 379 "dtimep.l" { INIT(); SETDST(); SETZONE(-600); yyterminate(); } YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP #line 381 "dtimep.l" INIT(); SETZONE(-700); yyterminate(); YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP #line 382 "dtimep.l" { INIT(); SETDST(); SETZONE(-700); yyterminate(); } YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP #line 384 "dtimep.l" INIT(); SETZONE(-800); yyterminate(); YY_BREAK case 23: /* rule 23 can match eol */ YY_RULE_SETUP #line 385 "dtimep.l" { INIT(); SETDST(); SETZONE(-800); yyterminate(); } YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP #line 387 "dtimep.l" INIT(); SETZONE(-330); yyterminate(); YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP #line 388 "dtimep.l" INIT(); SETZONE(-400); yyterminate(); YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP #line 389 "dtimep.l" { INIT(); SETDST(); SETZONE(-400); yyterminate(); } YY_BREAK case 27: /* rule 27 can match eol */ YY_RULE_SETUP #line 391 "dtimep.l" INIT(); SETZONE(-1000); yyterminate(); YY_BREAK case 28: /* rule 28 can match eol */ YY_RULE_SETUP #line 392 "dtimep.l" { INIT(); SETDST(); SETZONE(-1000); yyterminate(); } YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP #line 394 "dtimep.l" YY_BREAK case 30: YY_RULE_SETUP #line 396 "dtimep.l" ECHO; YY_BREAK #line 1596 "sbr/dtimep.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 571 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 571 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 570); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ yy_size_t yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 396 "dtimep.l" /* This is a portable way to squash a warning about the yyunput() * function being static but never used. It costs us a tiny amount * of extra code in the binary but the other options are: * "%option nounput" which is flex-specific * makefile hackery just to compile dtimep.c with different flags */ void dtimep_yyunput(int c) { unput(c); } nmh-1.5/sbr/dtimep.l000644 007761 000765 00000026413 11762736346 014344 0ustar00kenhkenh000000 000000 /* dtimep.lex exceeds the default table capacities for some old versions * of lex (and the minimum defaults as specified by POSIX). The following * choices meet or exceed the lex defaults for older SunOS4.x, Solaris, * HPUX, and AIX. */ %e4000 %p7000 %n2500 %a5000 %{ #include #include /* Since we're looking at a string at a time, don't worry about * wrapping to the next buffer. */ #define yywrap() 1 #define YY_SKIP_YYWRAP #define YY_NO_INPUT /* This is the tricky thing that makes this function cool. We * replace the traditional int yylex(void) declaration with our * dparsetime() declaration, essentially piggy-backing off the * utility of the yylex() function and adding what we need to make * the parsing function useful to us. */ #define YY_DECL struct tws *dparsetime(char *lexstr) /* yyerminate() is called after the input string is matched to * completion (actually, when the lexer reaches an EOF). The only * thing that really needs to be in this macro function is the * return call, which must be substituted inline into dparsetime. */ #define yyterminate() (void)yy_delete_buffer(lexhandle); \ if(!(tw.tw_flags & TW_SUCC)) { \ return (struct tws *)NULL; \ } \ if(tw.tw_year < 1970) \ tw.tw_year += 1900; \ if(tw.tw_year < 1970) \ tw.tw_year += 100; \ return(&tw) /* * Patchable flag that says how to interpret NN/NN/NN dates. When * true, we do it European style: DD/MM/YY. When false, we do it * American style: MM/DD/YY. Of course, these are all non-RFC822 * compliant. */ int europeandate = 0; /* * Table to convert month names to numeric month. We use the * fact that the low order 5 bits of the sum of the 2nd & 3rd * characters of the name is a hash with no collisions for the 12 * valid month names. (The mask to 5 bits maps any combination of * upper and lower case into the same hash value). */ static int month_map[] = { 0, 6, /* 1 - Jul */ 3, /* 2 - Apr */ 5, /* 3 - Jun */ 0, 10, /* 5 - Nov */ 0, 1, /* 7 - Feb */ 11, /* 8 - Dec */ 0, 0, 0, 0, 0, 0, 0, /*15 - Jan */ 0, 0, 0, 2, /*19 - Mar */ 0, 8, /*21 - Sep */ 0, 9, /*23 - Oct */ 0, 0, 4, /*26 - May */ 0, 7 /*28 - Aug */ }; /* * Lookup table for day-of-week using the same hash trick as for above name-of- * month table, but using the first and second character, not second and third. * * Compute index into table using: (day_name[0] & 7) + (day_name[1] & 4) */ static int day_map[] = { 0, 0, 0, 6, /* 3 - Sat */ 4, /* 4 - Thu */ 0, 5, /* 6 - Fri */ 0, /* 7 - Sun */ 2, /* 8 - Tue */ 1 /* 9 - Mon */, 0, 3 /*11 - Wed */ }; /* The SET* macros will parse for the appropriate field, and leave the * cp pointer at the first character after the desired field. Be * careful with variable-length fields or alpha-num mixes. * The SKIP* macros skip over characters of a particular class and * leave cp at the position of the first character that doesn't match * that class. Correspondingly, SKIPTO* skips until it reaches a * character of a particular class. */ #define INIT() { cp = yytext;} #define SETWDAY() { tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \ tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \ SKIPA(); } #define SETMON() { cp++; \ tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \ SKIPA(); } #define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \ SKIPD(); } #define SETYEAR() { tw.tw_year = atoi(cp); \ SKIPD(); } #define SETDAY() { tw.tw_mday = atoi(cp); \ tw.tw_flags |= TW_YES; \ SKIPD(); } #define SETTIME() { tw.tw_hour = atoi(cp); \ cp += 2; \ SKIPTOD(); \ tw.tw_min = atoi(cp); \ cp += 2; \ if(*cp == ':') { \ tw.tw_sec = atoi(++cp); SKIPD(); } } #define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \ tw.tw_flags |= TW_SZEXP; \ SKIPD(); } #define SETDST() { tw.tw_flags |= TW_DST; } #define SKIPD() { while ( isdigit(*cp++) ) ; \ --cp; } #define SKIPTOD() { while ( !isdigit(*cp++) ) ; \ --cp; } #define SKIPA() { while ( isalpha(*cp++) ) ; \ --cp; } #define SKIPTOA() { while ( !isalpha(*cp++) ) ; \ --cp; } #define SKIPSP() { while ( isspace(*cp++) ) ; \ --cp; } #define SKIPTOSP() { while ( !isspace(*cp++) ) ; \ --cp; } #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST # ifdef HAVE_SYS_TIME_H # include # endif #include static void zonehack (struct tws *tw) { register struct tm *tm; if (dmktime (tw) == (time_t) -1) return; tm = localtime (&tw->tw_clock); if (tm->tm_isdst) { tw->tw_flags |= TW_DST; tw->tw_zone -= 60; } } #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ %} sun ([Ss]un(day)?) mon ([Mm]on(day)?) tue ([Tt]ue(sday)?) wed ([Ww]ed(nesday)?) thu ([Tt]hu(rsday)?) fri ([Ff]ri(day)?) sat ([Ss]at(urday)?) DAY ({sun}|{mon}|{tue}|{wed}|{thu}|{fri}|{sat}) jan ([Jj]an(uary)?) feb ([Ff]eb(ruary)?) mar ([Mm]ar(ch)?) apr ([Aa]pr(il)?) may ([Mm]ay) jun ([Jj]un(e)?) jul ([Jj]ul(y)?) aug ([Aa]ug(ust)?) sep ([Ss]ep(tember)?) oct ([Oo]ct(ober)?) nov ([Nn]ov(ember)?) dec ([Dd]ec(ember)?) MONTH ({jan}|{feb}|{mar}|{apr}|{may}|{jun}|{jul}|{aug}|{sep}|{oct}|{nov}|{dec}) TIME ({D}:{d}{d}(:{d}{d})?) /* The year can either be 2 digits, or 4. However, after Y2K, we found that some MUA were reporting the year 100, hence the middle term here. yyterminate() resolves the actual issues with 2-digit years. */ YEAR (({d}{d})|(1{d}{d})|({d}{4})) w ([ \t]*) W ([ \t]+) D ([0-9]?[0-9]) d [0-9] nl [ \t\n()] %% %{ /* This section begins the definition of dparsetime(). Put here any local variable definitions and initializations */ YY_BUFFER_STATE lexhandle; register unsigned char *cp; static struct tws tw; memset(&tw,0,sizeof(struct tws)); lexhandle = yy_scan_string(lexstr); %} {DAY}","?{W}{MONTH}{W}{D}{W}{TIME}{W}{YEAR} { INIT(); SETWDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETTIME(); SKIPTOD(); SETYEAR(); } {DAY}","?{W}{D}{W}{MONTH}{W}{YEAR}{W}{TIME} { INIT(); SETWDAY(); SKIPTOD(); SETDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETYEAR(); SKIPTOD(); SETTIME(); } {D}{W}{MONTH}{W}{YEAR}{W}{TIME} { INIT(); SETDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETYEAR(); SKIPTOD(); SETTIME(); } {DAY}","?{W}{MONTH}{W}{D}","?{W}{YEAR}","?{W}{TIME} { INIT(); SETWDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); SKIPTOD(); SETTIME(); } {DAY}","?{W}{MONTH}{W}{D}","?{W}{YEAR} { INIT(); SETWDAY(); SKIPTOA(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); } {MONTH}{W}{D}","?{W}{YEAR}","?{W}{DAY} { INIT(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); SKIPTOA(); SETWDAY(); } {MONTH}{W}{D}","?{W}{YEAR} { INIT(); SETMON(); SKIPTOD(); SETDAY(); SKIPTOD(); SETYEAR(); } {D}("-"|"/"){D}("-"|"/"){YEAR}{W}{TIME} { INIT(); if(europeandate) { /* DD/MM/YY */ SETDAY(); SKIPTOD(); SETMON_NUM(); } else { /* MM/DD/YY */ SETMON_NUM(); SKIPTOD(); SETDAY(); } SKIPTOD(); SETYEAR(); SKIPTOD(); SETTIME(); } {D}("-"|"/"){D}("-"|"/"){YEAR} { INIT(); if(europeandate) { /* DD/MM/YY */ SETDAY(); SKIPTOD(); SETMON_NUM(); } else { /* MM/DD/YY */ SETMON_NUM(); SKIPTOD(); SETDAY(); } SKIPTOD(); SETYEAR(); } "[Aa][Mm]" "[Pp][Mm]" tw.tw_hour += 12; "+"{D}{d}{d} { INIT(); SKIPTOD(); SETZONE(atoi(cp)); #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST zonehack (&tw); #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ yyterminate(); } "-"{D}{d}{d} { INIT(); SKIPTOD(); SETZONE(-atoi(cp)); #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST zonehack (&tw); #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ yyterminate(); } {nl}("ut"|"UT") INIT(); SETZONE(0); yyterminate(); {nl}("gmt"|"GMT") INIT(); SETZONE(0); yyterminate(); {nl}("est"|"EST") INIT(); SETZONE(-500); yyterminate(); {nl}("edt"|"EDT") { INIT(); SETDST(); SETZONE(-500); yyterminate(); } {nl}("cst"|"CST") INIT(); SETZONE(-600); yyterminate(); {nl}("cdt"|"CDT") { INIT(); SETDST(); SETZONE(-600); yyterminate(); } {nl}("mst"|"MST") INIT(); SETZONE(-700); yyterminate(); {nl}("mdt"|"MDT") { INIT(); SETDST(); SETZONE(-700); yyterminate(); } {nl}("pst"|"PST") INIT(); SETZONE(-800); yyterminate(); {nl}("pdt"|"PDT") { INIT(); SETDST(); SETZONE(-800); yyterminate(); } {nl}("nst"|"NST") INIT(); SETZONE(-330); yyterminate(); {nl}("ast"|"AST") INIT(); SETZONE(-400); yyterminate(); {nl}("adt"|"ADT") { INIT(); SETDST(); SETZONE(-400); yyterminate(); } {nl}("hst"|"HST") INIT(); SETZONE(-1000); yyterminate(); {nl}("hdt"|"HDT") { INIT(); SETDST(); SETZONE(-1000); yyterminate(); } .|\n %% /* This is a portable way to squash a warning about the yyunput() * function being static but never used. It costs us a tiny amount * of extra code in the binary but the other options are: * "%option nounput" which is flex-specific * makefile hackery just to compile dtimep.c with different flags */ void dtimep_yyunput(int c) { unput(c); } nmh-1.5/sbr/error.c000644 007761 000765 00000005363 11713401274 014164 0ustar00kenhkenh000000 000000 /* * error.c -- main error handling routines * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #ifdef HAVE_WRITEV # include # include #endif #include /* * print out error message */ void advise (char *what, char *fmt, ...) { va_list ap; va_start(ap, fmt); advertise (what, NULL, fmt, ap); va_end(ap); } /* * print out error message and exit */ void adios (char *what, char *fmt, ...) { va_list ap; va_start(ap, fmt); advertise (what, NULL, fmt, ap); va_end(ap); done (1); } /* * admonish the user */ void admonish (char *what, char *fmt, ...) { va_list ap; va_start(ap, fmt); advertise (what, "continuing...", fmt, ap); va_end(ap); } /* * main routine for printing error messages. * * Use writev() if available, for slightly better performance. * Why? Well, there are a couple of reasons. Primarily, it * gives a smoother output... More importantly though, it's a * sexy syscall()... */ void advertise (char *what, char *tail, char *fmt, va_list ap) { int eindex = errno; #ifdef HAVE_WRITEV char buffer[BUFSIZ], err[BUFSIZ]; struct iovec iob[20], *iov; #endif fflush (stdout); #ifdef HAVE_WRITEV fflush (stderr); iov = iob; if (invo_name && *invo_name) { iov->iov_len = strlen (iov->iov_base = invo_name); iov++; iov->iov_len = strlen (iov->iov_base = ": "); iov++; } vsnprintf (buffer, sizeof(buffer), fmt, ap); iov->iov_len = strlen (iov->iov_base = buffer); iov++; if (what) { if (*what) { iov->iov_len = strlen (iov->iov_base = " "); iov++; iov->iov_len = strlen (iov->iov_base = what); iov++; iov->iov_len = strlen (iov->iov_base = ": "); iov++; } if (!(iov->iov_base = strerror (eindex))) { /* this shouldn't happen, but we'll test for it just in case */ snprintf (err, sizeof(err), "Error %d", eindex); iov->iov_base = err; } iov->iov_len = strlen (iov->iov_base); iov++; } if (tail && *tail) { iov->iov_len = strlen (iov->iov_base = ", "); iov++; iov->iov_len = strlen (iov->iov_base = tail); iov++; } iov->iov_len = strlen (iov->iov_base = "\n"); iov++; writev (fileno (stderr), iob, iov - iob); #else if (invo_name && *invo_name) fprintf (stderr, "%s: ", invo_name); vfprintf (stderr, fmt, ap); if (what) { char *s; if (*what) fprintf (stderr, " %s: ", what); if ((s = strerror(eindex))) fprintf (stderr, "%s", s); else fprintf (stderr, "Error %d", eindex); } if (tail) fprintf (stderr, ", %s", tail); fputc ('\n', stderr); #endif } nmh-1.5/sbr/escape_display_name.c000644 007761 000765 00000004307 11765267273 017035 0ustar00kenhkenh000000 000000 /* * escape_display_name.c -- Escape a display name, hopefully per RFC 5322. * * This code is Copyright (c) 2012, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include /* Escape a display name, hopefully per RFC 5322. Assumes one-byte characters. The char array pointed to by the name argument is modified in place. Its size is specified by the namesize argument. */ void escape_display_name (char *name, size_t namesize) { /* Quote and escape name that contains any specials, as necessary. */ if (strpbrk("\"(),.:;<>@[\\]", name)) { char *destp, *srcp; /* Maximum space requirement would be if each character had to be escaped, plus enclosing double quotes, plus null termintor. E.g., 2 characters, "", would require 7, "\"\""0, where that 0 is '\0'. */ char *tmp = mh_xmalloc (2*strlen(name) + 3); for (destp = tmp, srcp = name; *srcp; ++srcp) { if (srcp == name) { /* Insert initial double quote, if needed. */ if (*srcp != '"') { *destp++ = '"'; } } else { /* Escape embedded, unescaped double quote. */ if (*srcp == '"' && *(srcp+1) != '\0' && *(srcp-1) != '\\') { *destp++ = '\\'; } } *destp++ = *srcp; /* End of name. */ if (*(srcp+1) == '\0') { /* Insert final double quote, if needed. */ if (*srcp != '"') { *destp++ = '"'; } *destp++ = '\0'; } } if (strcmp (tmp, "\"")) { /* assert (strlen(tmp) + 1 == destp - tmp); */ size_t len = destp - tmp; strncpy (name, tmp, len <= namesize ? len : namesize); } else { /* Handle just " as special case here instead of above. */ strncpy (name, "\"\\\"\"", namesize); } name[namesize - 1] = '\0'; free (tmp); } } nmh-1.5/sbr/ext_hook.c000644 007761 000765 00000003013 11713401274 014641 0ustar00kenhkenh000000 000000 /* * * Run a program that hooks into some other system. The first argument is * name of the hook to use, the second is the full path name of a mail message. * The third argument is also the full path name of a mail message, or a NULL * pointer if it isn't needed. Look in the context for an error message if * something goes wrong; there is a built-in message in case one isn't specified. * Only produce the error message once. */ #include int ext_hook(char *hook_name, char *message_file_name_1, char *message_file_name_2) { char *hook; /* hook program from context */ pid_t pid; /* ID of child process */ int status; /* exit or other child process status */ char *vec[4]; /* argument vector for child process */ static int did_message = 0; /* set if we've already output a message */ if ((hook = context_find(hook_name)) == (char *)0) return (OK); switch (pid = vfork()) { case -1: status = NOTOK; advise(NULL, "external database may be out-of-date."); break; case 0: vec[0] = r1bindex(hook, '/'); vec[1] = message_file_name_1; vec[2] = message_file_name_2; vec[3] = (char *)0; execvp(hook, vec); _exit(-1); /* NOTREACHED */ default: status = pidwait(pid, -1); break; } if (status != OK) { if (did_message == 0) { if ((hook = context_find("msg-hook")) != (char *)0) advise(NULL, hook); else advise(NULL, "external hook (%s) did not work properly.", hook); did_message = 1; } return (NOTOK); } else return (OK); } nmh-1.5/sbr/fdcompare.c000644 007761 000765 00000001465 11762736346 015011 0ustar00kenhkenh000000 000000 /* * fdcompare.c -- are two files identical? * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int fdcompare (int fd1, int fd2) { register int i, n1, n2, resp; register char *c1, *c2; char b1[BUFSIZ], b2[BUFSIZ]; resp = 1; while ((n1 = read (fd1, b1, sizeof(b1))) >= 0 && (n2 = read (fd2, b2, sizeof(b2))) >= 0 && n1 == n2) { c1 = b1; c2 = b2; for (i = n1 < (int) sizeof(b1) ? n1 : (int) sizeof(b1); i--;) if (*c1++ != *c2++) { resp = 0; goto leave; } if (n1 < (int) sizeof(b1)) goto leave; } resp = 0; leave: ; lseek (fd1, (off_t) 0, SEEK_SET); lseek (fd2, (off_t) 0, SEEK_SET); return resp; } nmh-1.5/sbr/fmt_addr.c000644 007761 000765 00000006046 11762736346 014631 0ustar00kenhkenh000000 000000 /* * fmt_addr.c -- format an address field (from fmt_scan) * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include static char *buf; /* our current working buffer */ static char *bufend; /* end of working buffer */ static char *last_dst; /* buf ptr at end of last call */ static unsigned int bufsiz; /* current size of buf */ #define BUFINCR 512 /* how much to expand buf when if fills */ #define CPY(s) { cp = (s); while ((*dst++ = *cp++)) ; --dst; } /* check if there's enough room in buf for str. add more mem if needed */ #define CHECKMEM(str) \ if ((len = strlen (str)) >= bufend - dst) {\ int i = dst - buf;\ int n = last_dst - buf;\ bufsiz += ((dst + len - bufend) / BUFINCR + 1) * BUFINCR;\ buf = mh_xrealloc (buf, bufsiz);\ dst = buf + i;\ last_dst = buf + n;\ bufend = buf + bufsiz;\ } /* fmt_scan will call this routine if the user includes the function * "(formataddr {component})" in a format string. "orig" is the * original contents of the string register. "str" is the address * string to be formatted and concatenated onto orig. This routine * returns a pointer to the concatenated address string. * * We try to not do a lot of malloc/copy/free's (which is why we * don't call "getcpy") but still place no upper limit on the * length of the result string. * * This routine is placed in a separate library so it can be * overridden by particular programs (e.g., "replsbr"). */ char * formataddr (char *orig, char *str) { register int len; register int isgroup; register char *dst; register char *cp; register char *sp; register struct mailname *mp = NULL; /* if we don't have a buffer yet, get one */ if (bufsiz == 0) { buf = mh_xmalloc (BUFINCR); last_dst = buf; /* XXX */ bufsiz = BUFINCR - 6; /* leave some slop */ bufend = buf + bufsiz; } /* * If "orig" points to our buffer we can just pick up where we * left off. Otherwise we have to copy orig into our buffer. */ if (orig == buf) dst = last_dst; else if (!orig || !*orig) { dst = buf; *dst = '\0'; } else { dst = last_dst; /* XXX */ CHECKMEM (orig); CPY (orig); } /* concatenate all the new addresses onto 'buf' */ for (isgroup = 0; (cp = getname (str)); ) { if ((mp = getm (cp, NULL, 0, fmt_norm, NULL)) == NULL) continue; if (isgroup && (mp->m_gname || !mp->m_ingrp)) { *dst++ = ';'; isgroup = 0; } /* if we get here we're going to add an address */ if (dst != buf) { *dst++ = ','; *dst++ = ' '; } if (mp->m_gname) { CHECKMEM (mp->m_gname); CPY (mp->m_gname); isgroup++; } sp = adrformat (mp); CHECKMEM (sp); CPY (sp); mnfree (mp); } if (isgroup) *dst++ = ';'; *dst = '\0'; last_dst = dst; return (buf); } char *concataddr (char *orig, char *str) { return formataddr(orig, str); } nmh-1.5/sbr/fmt_compile.c000644 007761 000765 00000052120 11762736346 015341 0ustar00kenhkenh000000 000000 /* * fmt_compile.c -- "compile" format strings for fmt_scan * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. * * This code compiles the format strings (documented in mh-format(5)) into * an internal form to be later processed by fmt_scan.c. * * What happens here is that the format strings are parsed and an array * of struct format structures are returned. Each format structure is * a single operation interpreted by the the routines in fmt_scan.c. * * There is a NOT a one-to-one correspondence between format strings and * format instructions; some functions have side effects that can result * in multiple instructions being generated. The exact list of instructions * generated by a format string can be seem with the nmh fmtdump utility. * * A list of format instructions can be found in fmt_compile.h. * * If you wish to add a new function, you will need to do the following * things: * * - Add a new instruction to the list of instructions in fmt_compile.h. * Note that test instructions (starting with FT_IF_S_NULL) have special * handling, so if you are NOT writing a test function then you need * to insert it into the list before that _and_ bump all of the * following instruction numbers. * * - Add the function name to the functable[] array below, and write any * special code that your function may require in terms of parsing * (it very well may not need anything). * * - Add the code in fmt_scan.c to handle your new function. * * - Document the new function in the mh-format(5) man page. * */ #include #include #include #include #include #include #ifdef HAVE_SYS_TIME_H # include #endif #include /* * hash table for deciding if a component is "interesting" */ struct comp *wantcomp[128]; static struct format *formatvec; /* array to hold formats */ static struct format *next_fp; /* next free format slot */ static struct format *fp; /* current format slot */ static struct comp *cm; /* most recent comp ref */ static struct ftable *ftbl; /* most recent func ref */ static int ncomp; static int infunction; /* function nesting cnt */ extern struct mailname fmt_mnull; /* ftable->type (argument type) */ #define TF_COMP 0 /* component expected */ #define TF_NUM 1 /* number expected */ #define TF_STR 2 /* string expected */ #define TF_EXPR 3 /* component or func. expected */ #define TF_NONE 4 /* no argument */ #define TF_MYBOX 5 /* special - get current user's mbox */ #define TF_NOW 6 /* special - get current unix time */ #define TF_EXPR_SV 7 /* like expr but save current str reg */ #define TF_NOP 8 /* like expr but no result */ #define TF_MYNAME 9 /* special - get current name of user */ #define TF_MYHOST 10 /* special - get "local" hostname */ #define TF_LMBOX 11 /* special - get full local mailbox */ /* ftable->flags */ /* NB that TFL_PUTS is also used to decide whether the test * in a "%<(function)..." should be a string or numeric one. */ #define TFL_PUTS 1 /* implicit putstr if top level */ #define TFL_PUTN 2 /* implicit putnum if top level */ /* * The functable array maps between the text names of format functions and * the format instructions interpreted by the engine in fmt_scan.c. * * The elements of this structure are as follows: * * name - The name of the function as seen in the format string. This is * what maps a particular function name into a format instruction. * type - The type of argument this function expects. Those types are * listed above (with the TF_ prefix). This affects what gets * placed in the format instruction (the f_un union). * f_type - The instruction corresponding to this function (from the list * in fmt_compile.h). * extra - Used by some functions to provide extra data to the compiler. * Uses include: * - Providing an alternate instruction to combine a load * and test operation (see do_if()). * - Passed in f_value in the format instruction to provide * extra information for the engine (see FT_LV_DAT handling * in fmt_scan.c). * - Provide a hint as to preprocessing that is required for * this instruction (see do_name()). * flags - See the definitions for TFL_PUTS & TFL_PUTN above. */ struct ftable { char *name; /* function name */ char type; /* argument type */ char f_type; /* fmt type */ char extra; /* arg. type dependent extra info */ char flags; }; static struct ftable functable[] = { { "nonzero", TF_EXPR, FT_V_NE, FT_IF_V_NE, 0 }, { "zero", TF_EXPR, FT_V_EQ, FT_IF_V_EQ, 0 }, { "eq", TF_NUM, FT_V_EQ, FT_IF_V_EQ, 0 }, { "ne", TF_NUM, FT_V_NE, FT_IF_V_NE, 0 }, { "gt", TF_NUM, FT_V_GT, FT_IF_V_GT, 0 }, { "null", TF_EXPR, FT_S_NULL, FT_IF_S_NULL, 0 }, { "nonnull", TF_EXPR, FT_S_NONNULL, FT_IF_S, 0 }, { "match", TF_STR, FT_V_MATCH, FT_IF_MATCH, 0 }, { "amatch", TF_STR, FT_V_AMATCH, FT_IF_AMATCH, 0 }, { "putstr", TF_EXPR, FT_STR, 0, 0 }, { "putstrf", TF_EXPR, FT_STRF, 0, 0 }, { "putnum", TF_EXPR, FT_NUM, 0, 0 }, { "putnumf", TF_EXPR, FT_NUMF, 0, 0 }, { "putaddr", TF_STR, FT_PUTADDR, 0, 0 }, { "putlit", TF_STR, FT_STRLIT, 0, 0 }, { "void", TF_NOP, 0, 0, 0 }, { "comp", TF_COMP, FT_LS_COMP, 0, TFL_PUTS }, { "lit", TF_STR, FT_LS_LIT, 0, TFL_PUTS }, { "getenv", TF_STR, FT_LS_GETENV, 0, TFL_PUTS }, { "profile", TF_STR, FT_LS_CFIND, 0, TFL_PUTS }, { "decodecomp", TF_COMP, FT_LS_DECODECOMP, 0, TFL_PUTS }, { "decode", TF_EXPR, FT_LS_DECODE, 0, TFL_PUTS }, { "trim", TF_EXPR, FT_LS_TRIM, 0, 0 }, { "compval", TF_COMP, FT_LV_COMP, 0, TFL_PUTN }, { "compflag", TF_COMP, FT_LV_COMPFLAG, 0, TFL_PUTN }, { "num", TF_NUM, FT_LV_LIT, 0, TFL_PUTN }, { "msg", TF_NONE, FT_LV_DAT, 0, TFL_PUTN }, { "cur", TF_NONE, FT_LV_DAT, 1, TFL_PUTN }, { "size", TF_NONE, FT_LV_DAT, 2, TFL_PUTN }, { "width", TF_NONE, FT_LV_DAT, 3, TFL_PUTN }, { "unseen", TF_NONE, FT_LV_DAT, 4, TFL_PUTN }, { "dat", TF_NUM, FT_LV_DAT, 0, TFL_PUTN }, { "strlen", TF_NONE, FT_LV_STRLEN, 0, TFL_PUTN }, { "me", TF_MYBOX, FT_LS_LIT, 0, TFL_PUTS }, { "myname", TF_MYNAME, FT_LS_LIT, 0, TFL_PUTS }, { "myhost", TF_MYHOST, FT_LS_LIT, 0, TFL_PUTS }, { "localmbox", TF_LMBOX, FT_LS_LIT, 0, TFL_PUTS }, { "plus", TF_NUM, FT_LV_PLUS_L, 0, TFL_PUTN }, { "minus", TF_NUM, FT_LV_MINUS_L, 0, TFL_PUTN }, { "divide", TF_NUM, FT_LV_DIVIDE_L, 0, TFL_PUTN }, { "modulo", TF_NUM, FT_LV_MODULO_L, 0, TFL_PUTN }, { "charleft", TF_NONE, FT_LV_CHAR_LEFT, 0, TFL_PUTN }, { "timenow", TF_NOW, FT_LV_LIT, 0, TFL_PUTN }, { "month", TF_COMP, FT_LS_MONTH, FT_PARSEDATE, TFL_PUTS }, { "lmonth", TF_COMP, FT_LS_LMONTH, FT_PARSEDATE, TFL_PUTS }, { "tzone", TF_COMP, FT_LS_ZONE, FT_PARSEDATE, TFL_PUTS }, { "day", TF_COMP, FT_LS_DAY, FT_PARSEDATE, TFL_PUTS }, { "weekday", TF_COMP, FT_LS_WEEKDAY, FT_PARSEDATE, TFL_PUTS }, { "tws", TF_COMP, FT_LS_822DATE, FT_PARSEDATE, TFL_PUTS }, { "sec", TF_COMP, FT_LV_SEC, FT_PARSEDATE, TFL_PUTN }, { "min", TF_COMP, FT_LV_MIN, FT_PARSEDATE, TFL_PUTN }, { "hour", TF_COMP, FT_LV_HOUR, FT_PARSEDATE, TFL_PUTN }, { "mday", TF_COMP, FT_LV_MDAY, FT_PARSEDATE, TFL_PUTN }, { "mon", TF_COMP, FT_LV_MON, FT_PARSEDATE, TFL_PUTN }, { "year", TF_COMP, FT_LV_YEAR, FT_PARSEDATE, TFL_PUTN }, { "yday", TF_COMP, FT_LV_YDAY, FT_PARSEDATE, TFL_PUTN }, { "wday", TF_COMP, FT_LV_WDAY, FT_PARSEDATE, TFL_PUTN }, { "zone", TF_COMP, FT_LV_ZONE, FT_PARSEDATE, TFL_PUTN }, { "clock", TF_COMP, FT_LV_CLOCK, FT_PARSEDATE, TFL_PUTN }, { "rclock", TF_COMP, FT_LV_RCLOCK, FT_PARSEDATE, TFL_PUTN }, { "sday", TF_COMP, FT_LV_DAYF, FT_PARSEDATE, TFL_PUTN }, { "szone", TF_COMP, FT_LV_ZONEF, FT_PARSEDATE, TFL_PUTN }, { "dst", TF_COMP, FT_LV_DST, FT_PARSEDATE, TFL_PUTN }, { "pretty", TF_COMP, FT_LS_PRETTY, FT_PARSEDATE, TFL_PUTS }, { "nodate", TF_COMP, FT_LV_COMPFLAG, FT_PARSEDATE, TFL_PUTN }, { "date2local", TF_COMP, FT_LOCALDATE, FT_PARSEDATE, 0 }, { "date2gmt", TF_COMP, FT_GMTDATE, FT_PARSEDATE, 0 }, { "pers", TF_COMP, FT_LS_PERS, FT_PARSEADDR, TFL_PUTS }, { "mbox", TF_COMP, FT_LS_MBOX, FT_PARSEADDR, TFL_PUTS }, { "host", TF_COMP, FT_LS_HOST, FT_PARSEADDR, TFL_PUTS }, { "path", TF_COMP, FT_LS_PATH, FT_PARSEADDR, TFL_PUTS }, { "gname", TF_COMP, FT_LS_GNAME, FT_PARSEADDR, TFL_PUTS }, { "note", TF_COMP, FT_LS_NOTE, FT_PARSEADDR, TFL_PUTS }, { "addr", TF_COMP, FT_LS_ADDR, FT_PARSEADDR, TFL_PUTS }, { "proper", TF_COMP, FT_LS_822ADDR, FT_PARSEADDR, TFL_PUTS }, { "type", TF_COMP, FT_LV_HOSTTYPE, FT_PARSEADDR, TFL_PUTN }, { "ingrp", TF_COMP, FT_LV_INGRPF, FT_PARSEADDR, TFL_PUTN }, { "nohost", TF_COMP, FT_LV_NOHOSTF, FT_PARSEADDR, TFL_PUTN }, { "formataddr", TF_EXPR_SV,FT_FORMATADDR, FT_FORMATADDR, 0 }, { "concataddr", TF_EXPR_SV,FT_CONCATADDR, FT_FORMATADDR, 0 }, { "friendly", TF_COMP, FT_LS_FRIENDLY, FT_PARSEADDR, TFL_PUTS }, { "mymbox", TF_COMP, FT_LV_COMPFLAG, FT_MYMBOX, TFL_PUTN }, { "addtoseq", TF_STR, FT_ADDTOSEQ, 0, 0 }, { "unquote", TF_EXPR, FT_LS_UNQUOTE, 0, TFL_PUTS}, { NULL, 0, 0, 0, 0 } }; /* Add new component to the hash table */ #define NEWCOMP(cm,name) do { \ cm = ((struct comp *) calloc(1, sizeof (struct comp)));\ cm->c_name = name;\ ncomp++;\ i = CHASH(name);\ cm->c_next = wantcomp[i];\ wantcomp[i] = cm; \ } while (0) #define NEWFMT (next_fp++) #define NEW(type,fill,wid) do {\ fp=NEWFMT; fp->f_type=(type); fp->f_fill=(fill); fp->f_width=(wid); \ } while (0) /* Add (possibly new) component to the hash table */ #define ADDC(name) do { \ FINDCOMP(cm, name);\ if (!cm) {\ NEWCOMP(cm,name);\ }\ fp->f_comp = cm; \ } while (0) #define LV(type, value) do { NEW(type,0,0); fp->f_value = (value); } while (0) #define LS(type, str) do { NEW(type,0,0); fp->f_text = (str); } while (0) #define PUTCOMP(comp) do { NEW(FT_COMP,0,0); ADDC(comp); } while (0) #define PUTLIT(str) do { NEW(FT_LIT,0,0); fp->f_text = (str); } while (0) #define PUTC(c) do { NEW(FT_CHAR,0,0); fp->f_char = (c); } while (0) char *format_string; static unsigned char *usr_fstring; /* for CERROR */ #define CERROR(str) compile_error (str, cp) /* * static prototypes */ static struct ftable *lookup(char *); static void compile_error(char *, char *); static char *compile (char *); static char *do_spec(char *); static char *do_name(char *, int); static char *do_func(char *); static char *do_expr (char *, int); static char *do_loop(char *); static char *do_if(char *); /* * Lookup a function name in the functable */ static struct ftable * lookup(char *name) { register struct ftable *t = functable; register char *nm; register char c = *name; while ((nm = t->name)) { if (*nm == c && strcmp (nm, name) == 0) return (ftbl = t); t++; } return (struct ftable *) 0; } static void compile_error(char *str, char *cp) { int i, errpos, errctx; errpos = cp - format_string; errctx = errpos > 20 ? 20 : errpos; usr_fstring[errpos] = '\0'; for (i = errpos-errctx; i < errpos; i++) { #ifdef LOCALE if (iscntrl(usr_fstring[i])) #else if (usr_fstring[i] < 32) #endif usr_fstring[i] = '_'; } advise(NULL, "\"%s\": format compile error - %s", &usr_fstring[errpos-errctx], str); adios (NULL, "%*s", errctx+1, "^"); } /* * Compile format string "fstring" into format list "fmt". * Return the number of header components found in the format * string. */ int fmt_compile(char *fstring, struct format **fmt) { register char *cp; size_t i; if (format_string) free (format_string); format_string = getcpy (fstring); usr_fstring = fstring; /* init the component hash table. */ for (i = 0; i < sizeof(wantcomp)/sizeof(wantcomp[0]); i++) wantcomp[i] = 0; memset((char *) &fmt_mnull, 0, sizeof(fmt_mnull)); /* it takes at least 4 char to generate one format so we * allocate a worst-case format array using 1/4 the length * of the format string. We actually need twice this much * to handle both pre-processing (e.g., address parsing) and * normal processing. */ i = strlen(fstring)/2 + 1; if (i==1) i++; next_fp = formatvec = (struct format *)calloc ((size_t) i, sizeof(struct format)); if (next_fp == NULL) adios (NULL, "unable to allocate format storage"); ncomp = 0; infunction = 0; cp = compile(format_string); if (*cp) { CERROR("extra '%>', '%|' or '%?'"); } LV(FT_DONE, 0); /* really done */ *fmt = formatvec; return (ncomp); } static char * compile (char *sp) { register char *cp = sp; register int c; for (;;) { sp = cp; while ((c = *cp) && c != '%') cp++; *cp = 0; switch (cp-sp) { case 0: break; case 1: PUTC(*sp); break; default: PUTLIT(sp); break; } if (c == 0) return (cp); switch (c = *++cp) { case '%': PUTC (*cp); cp++; break; case '|': case '>': case '?': case ']': return (cp); case '<': cp = do_if(++cp); break; case '[': /* ] */ cp = do_loop(++cp); break; case ';': /* comment line */ cp++; while ((c = *cp++) && c != '\n') continue; break; default: cp = do_spec(cp); break; } } } /* * Process functions & components (handle field width here as well */ static char * do_spec(char *sp) { register char *cp = sp; register int c; #ifndef lint register int ljust = 0; #endif /* not lint */ register int wid = 0; register char fill = ' '; c = *cp++; if (c == '-') { ljust++; c = *cp++; } if (c == '0') { fill = c; c = *cp++; } while (isdigit(c)) { wid = wid*10 + (c - '0'); c = *cp++; } if (c == '{') { cp = do_name(cp, 0); if (! infunction) fp->f_type = wid? FT_COMPF : FT_COMP; } else if (c == '(') { cp = do_func(cp); if (! infunction) { if (ftbl->flags & TFL_PUTS) { LV( wid? FT_STRF : FT_STR, ftbl->extra); } else if (ftbl->flags & TFL_PUTN) { LV( wid? FT_NUMF : FT_NUM, ftbl->extra); } } } else { CERROR("component or function name expected"); } if (ljust) wid = -wid; fp->f_width = wid; fp->f_fill = fill; return (cp); } /* * Process a component name. Normally this involves generating an FT_COMP * instruction for the specified component. If preprocess is set, then we * do some extra processing. */ static char * do_name(char *sp, int preprocess) { register char *cp = sp; register int c; register int i; static int primed = 0; while (isalnum(c = *cp++) || c == '-' || c == '_') ; if (c != '}') { CERROR("'}' expected"); } cp[-1] = '\0'; PUTCOMP(sp); switch (preprocess) { case FT_PARSEDATE: if (cm->c_type & CT_ADDR) { CERROR("component used as both date and address"); } cm->c_tws = (struct tws *) calloc((size_t) 1, sizeof(*cm->c_tws)); fp->f_type = preprocess; PUTCOMP(sp); cm->c_type |= CT_DATE; break; case FT_MYMBOX: if (!primed) { ismymbox ((struct mailname *) 0); primed++; } /* fall through */ case FT_PARSEADDR: if (cm->c_type & CT_DATE) { CERROR("component used as both date and address"); } cm->c_mn = &fmt_mnull; fp->f_type = preprocess; PUTCOMP(sp); cm->c_type |= CT_ADDR; break; case FT_FORMATADDR: if (cm->c_type & CT_DATE) { CERROR("component used as both date and address"); } cm->c_type |= CT_ADDR; break; } return (cp); } /* * Generate one or more instructions corresponding to the named function. * The different type of function arguments are handled here. */ static char * do_func(char *sp) { register char *cp = sp; register int c; register struct ftable *t; register int n; int mflag; /* minus sign in NUM */ infunction++; while (isalnum(c = *cp++)) ; if (c != '(' && c != '{' && c != ' ' && c != ')') { CERROR("'(', '{', ' ' or ')' expected"); } cp[-1] = '\0'; if ((t = lookup (sp)) == 0) { CERROR("unknown function"); } if (isspace(c)) c = *cp++; switch (t->type) { case TF_COMP: if (c != '{') { CERROR("component name expected"); } cp = do_name(cp, t->extra); fp->f_type = t->f_type; c = *cp++; break; case TF_NUM: if ((mflag = (c == '-'))) c = *cp++; n = 0; while (isdigit(c)) { n = n*10 + (c - '0'); c = *cp++; } if (mflag) n = (-n); LV(t->f_type,n); break; case TF_STR: sp = cp - 1; while (c && c != ')') c = *cp++; cp[-1] = '\0'; LS(t->f_type,sp); break; case TF_NONE: LV(t->f_type,t->extra); break; case TF_MYBOX: LS(t->f_type, getusername()); break; case TF_MYNAME: LS(t->f_type, getfullname()); break; case TF_MYHOST: LS(t->f_type, LocalName(0)); break; case TF_LMBOX: LS(t->f_type, getlocalmbox()); break; case TF_NOW: LV(t->f_type, time((time_t *) 0)); break; case TF_EXPR_SV: LV(FT_SAVESTR, 0); /* fall through */ case TF_EXPR: *--cp = c; cp = do_expr(cp, t->extra); LV(t->f_type, 0); c = *cp++; ftbl = t; break; case TF_NOP: *--cp = c; cp = do_expr(cp, t->extra); c = *cp++; ftbl = t; break; } if (c != ')') { CERROR("')' expected"); } --infunction; return (cp); } /* * Handle an expression as an argument. Basically we call one of do_name(), * do_func(), or do_if() */ static char * do_expr (char *sp, int preprocess) { register char *cp = sp; register int c; if ((c = *cp++) == '{') { cp = do_name (cp, preprocess); fp->f_type = FT_LS_COMP; } else if (c == '(') { cp = do_func (cp); } else if (c == ')') { return (--cp); } else if (c == '%' && *cp == '<') { cp = do_if (cp+1); } else { CERROR ("'(', '{', '%<' or ')' expected"); } return (cp); } /* * I am guessing this was for some kind of loop statement, which would have * looked like %[ .... %]. It looks like the way this would have worked * is that the format engine would have seen that FT_DONE had a 1 in the * f_un.f_un_value and then decided whether or not to continue the loop. * There is no support for this in the format engine, so right now if * you try using it you will reach the FT_DONE and simply stop. I'm leaving * this here in case someone wants to continue the work. */ static char * do_loop(char *sp) { register char *cp = sp; struct format *floop; floop = next_fp; cp = compile (cp); if (*cp++ != ']') CERROR ("']' expected"); LV(FT_DONE, 1); /* not yet done */ LV(FT_GOTO, 0); fp->f_skip = floop - fp; /* skip backwards */ return cp; } /* * Handle an if-elsif-endif statement. Note here that the branching * is handled by the f_skip member of the struct format (which is really * just f_width overloaded). This number controls how far to move forward * (or back) in the format instruction array. */ static char * do_if(char *sp) { register char *cp = sp; register struct format *fexpr, *fif = (struct format *)NULL; register int c = '<'; for (;;) { if (c == '<') { /* doing an IF */ if ((c = *cp++) == '{') /*}*/{ cp = do_name(cp, 0); fp->f_type = FT_LS_COMP; LV (FT_IF_S, 0); } else if (c == '(') { cp = do_func(cp); /* see if we can merge the load and the "if" */ if (ftbl->f_type >= IF_FUNCS) fp->f_type = ftbl->extra; else { /* Put out a string test or a value test depending * on what this function's return type is. */ if (ftbl->flags & TFL_PUTS) { LV (FT_IF_S, 0); } else { LV (FT_IF_V_NE, 0); } } } else { CERROR("'(' or '{' expected"); /*}*/ } } fexpr = fp; /* loc of [ELS]IF */ cp = compile (cp); /* compile IF TRUE stmts */ if (fif) fif->f_skip = next_fp - fif; if ((c = *cp++) == '|') { /* the last ELSE */ LV(FT_GOTO, 0); fif = fp; /* loc of GOTO */ fexpr->f_skip = next_fp - fexpr; fexpr = (struct format *)NULL;/* no extra ENDIF */ cp = compile (cp); /* compile ELSE stmts */ fif->f_skip = next_fp - fif; c = *cp++; } else if (c == '?') { /* another ELSIF */ LV(FT_GOTO, 0); fif = fp; /* loc of GOTO */ fexpr->f_skip = next_fp - fexpr; c = '<'; /* impersonate an IF */ continue; } break; } if (c != '>') { CERROR("'>' expected."); } if (fexpr) /* IF ... [ELSIF ...] ENDIF */ fexpr->f_skip = next_fp - fexpr; return (cp); } nmh-1.5/sbr/fmt_def.c000644 007761 000765 00000000427 11713401274 014433 0ustar00kenhkenh000000 000000 /* * fmt_def.c -- some defines for sbr/fmt_scan.c * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int fmt_norm = AD_NAME; nmh-1.5/sbr/fmt_new.c000644 007761 000765 00000003213 11713401274 014462 0ustar00kenhkenh000000 000000 /* * fmt_new.c -- read format file/string and normalize * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #define QUOTE '\\' static char *formats = 0; /* * static prototypes */ static void normalize (char *); /* * Get new format string */ char * new_fs (char *form, char *format, char *default_fs) { struct stat st; register FILE *fp; if (formats) free (formats); if (form) { if ((fp = fopen (etcpath (form), "r")) == NULL) adios (form, "unable to open format file"); if (fstat (fileno (fp), &st) == -1) adios (form, "unable to stat format file"); formats = mh_xmalloc ((size_t) st.st_size + 1); if (read (fileno(fp), formats, (int) st.st_size) != st.st_size) adios (form, "error reading format file"); formats[st.st_size] = '\0'; fclose (fp); } else { formats = getcpy (format ? format : default_fs); } normalize (formats); /* expand escapes */ return formats; } /* * Expand escapes in format strings */ static void normalize (char *cp) { char *dp; for (dp = cp; *cp; cp++) { if (*cp != QUOTE) { *dp++ = *cp; } else { switch (*++cp) { case 'b': *dp++ = '\b'; break; case 'f': *dp++ = '\f'; break; case 'n': *dp++ = '\n'; break; case 'r': *dp++ = '\r'; break; case 't': *dp++ = '\t'; break; case '\n': break; case 0: cp--; /* fall */ default: *dp++ = *cp; break; } } } *dp = '\0'; } nmh-1.5/sbr/fmt_rfc2047.c000644 007761 000765 00000022161 11713401274 014763 0ustar00kenhkenh000000 000000 /* * fmt_rfc2047.c -- decode RFC-2047 header format * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #ifdef HAVE_ICONV # include # include #endif static signed char hexindex[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }; static signed char index_64[128] = { -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 }; #define char64(c) (((unsigned char) (c) > 127) ? -1 : index_64[(unsigned char) (c)]) static int unqp (unsigned char byte1, unsigned char byte2) { if (hexindex[byte1] == -1 || hexindex[byte2] == -1) return -1; return (hexindex[byte1] << 4 | hexindex[byte2]); } /* Check if character is linear whitespace */ #define is_lws(c) ((c) == ' ' || (c) == '\t' || (c) == '\n') /* * Decode the string as a RFC-2047 header field */ /* Add character to the destination buffer, and bomb out if it fills up */ #define ADDCHR(C) do { *q++ = (C); dstlen--; if (!dstlen) goto buffull; } while (0) int decode_rfc2047 (char *str, char *dst, size_t dstlen) { char *p, *q, *pp; char *startofmime, *endofmime; int c, quoted_printable; int encoding_found = 0; /* did we decode anything? */ int between_encodings = 0; /* are we between two encodings? */ int equals_pending = 0; /* is there a '=' pending? */ int whitespace = 0; /* how much whitespace between encodings? */ #ifdef HAVE_ICONV int use_iconv = 0; /* are we converting encoding with iconv? */ iconv_t cd = NULL; int fromutf8 = 0; char *saveq, *convbuf = NULL; size_t savedstlen; #endif if (!str) return 0; /* * Do a quick and dirty check for the '=' character. * This should quickly eliminate many cases. */ if (!strchr (str, '=')) return 0; for (p = str, q = dst; *p; p++) { /* reset iconv */ #ifdef HAVE_ICONV if (use_iconv) { iconv_close(cd); use_iconv = 0; } #endif /* * If we had an '=' character pending from * last iteration, then add it first. */ if (equals_pending) { ADDCHR('='); equals_pending = 0; between_encodings = 0; /* we have added non-whitespace text */ } if (*p != '=') { /* count linear whitespace while between encodings */ if (between_encodings && is_lws(*p)) whitespace++; else between_encodings = 0; /* we have added non-whitespace text */ ADDCHR(*p); continue; } equals_pending = 1; /* we have a '=' pending */ /* Check for initial =? */ if (*p == '=' && p[1] && p[1] == '?' && p[2]) { startofmime = p + 2; /* Scan ahead for the next '?' character */ for (pp = startofmime; *pp && *pp != '?'; pp++) ; if (!*pp) continue; /* Check if character set can be handled natively */ if (!check_charset(startofmime, pp - startofmime)) { #ifdef HAVE_ICONV /* .. it can't. We'll use iconv then. */ *pp = '\0'; cd = iconv_open(get_charset(), startofmime); fromutf8 = !mh_strcasecmp(startofmime, "UTF-8"); *pp = '?'; if (cd == (iconv_t)-1) continue; use_iconv = 1; #else continue; #endif } startofmime = pp + 1; /* Check for valid encoding type */ if (*startofmime != 'B' && *startofmime != 'b' && *startofmime != 'Q' && *startofmime != 'q') continue; /* Is encoding quoted printable or base64? */ quoted_printable = (*startofmime == 'Q' || *startofmime == 'q'); startofmime++; /* Check for next '?' character */ if (*startofmime != '?') continue; startofmime++; /* * Scan ahead for the ending ?= * * While doing this, we will also check if encoded * word has any embedded linear whitespace. */ endofmime = NULL; for (pp = startofmime; *pp && *(pp+1); pp++) { if (is_lws(*pp)) { break; } else if (*pp == '?' && pp[1] == '=') { endofmime = pp; break; } } if (is_lws(*pp) || endofmime == NULL) continue; /* * We've found an encoded word, so we can drop * the '=' that was pending */ equals_pending = 0; /* * If we are between two encoded words separated only by * linear whitespace, then we ignore the whitespace. * We will roll back the buffer the number of whitespace * characters we've seen since last encoded word. */ if (between_encodings) { q -= whitespace; dstlen += whitespace; } #ifdef HAVE_ICONV /* * empty encoded text. This ensures that we don't * malloc 0 bytes but skip on to the end */ if (endofmime == startofmime && use_iconv) { use_iconv = 0; iconv_close(cd); } if (use_iconv) { saveq = q; savedstlen = dstlen; q = convbuf = (char *) mh_xmalloc(endofmime - startofmime); } /* ADDCHR2 is for adding characters when q is or might be convbuf: * in this case on buffer-full we want to run iconv before returning. * I apologise for the dreadful name. */ #define ADDCHR2(C) do { *q++ = (C); dstlen--; if (!dstlen) goto iconvbuffull; } while (0) #else #define ADDCHR2(C) ADDCHR(C) #endif /* Now decode the text */ if (quoted_printable) { for (pp = startofmime; pp < endofmime; pp++) { if (*pp == '=') { c = unqp (pp[1], pp[2]); if (c == -1) continue; if (c != 0) *q++ = c; pp += 2; } else if (*pp == '_') { ADDCHR2(' '); } else { ADDCHR2(*pp); } } } else { /* base64 */ int c1, c2, c3, c4; c1 = c2 = c3 = c4 = -1; pp = startofmime; while (pp < endofmime) { /* 6 + 2 bits */ while ((pp < endofmime) && ((c1 = char64(*pp)) == -1)) { pp++; } if (pp < endofmime) { pp++; } while ((pp < endofmime) && ((c2 = char64(*pp)) == -1)) { pp++; } if (pp < endofmime && c1 != -1 && c2 != -1) { ADDCHR2((c1 << 2) | (c2 >> 4)); pp++; } /* 4 + 4 bits */ while ((pp < endofmime) && ((c3 = char64(*pp)) == -1)) { pp++; } if (pp < endofmime && c2 != -1 && c3 != -1) { ADDCHR2(((c2 & 0xF) << 4) | (c3 >> 2)); pp++; } /* 2 + 6 bits */ while ((pp < endofmime) && ((c4 = char64(*pp)) == -1)) { pp++; } if (pp < endofmime && c3 != -1 && c4 != -1) { ADDCHR2(((c3 & 0x3) << 6) | (c4)); pp++; } } } #ifdef HAVE_ICONV iconvbuffull: /* NB that the string at convbuf is not necessarily NUL terminated here: * q points to the first byte after the valid part. */ /* Convert to native character set */ if (use_iconv) { size_t inbytes = q - convbuf; ICONV_CONST char *start = convbuf; while (inbytes) { if (iconv(cd, &start, &inbytes, &saveq, &savedstlen) == (size_t)-1) { if (errno != EILSEQ) break; /* character couldn't be converted. we output a `?' * and try to carry on which won't work if * either encoding was stateful */ iconv (cd, 0, 0, &saveq, &savedstlen); if (!savedstlen) break; *saveq++ = '?'; savedstlen--; if (!savedstlen) break; /* skip to next input character */ if (fromutf8) { for (start++;(start < q) && ((*start & 192) == 128);start++) inbytes--; } else start++, inbytes--; if (start >= q) break; } } q = saveq; /* Stop now if (1) we hit the end of the buffer trying to do * MIME decoding and have just iconv-converted a partial string * or (2) our iconv-conversion hit the end of the buffer. */ if (!dstlen || !savedstlen) goto buffull; dstlen = savedstlen; free(convbuf); } #endif /* * Now that we are done decoding this particular * encoded word, advance string to trailing '='. */ p = endofmime + 1; encoding_found = 1; /* we found (at least 1) encoded word */ between_encodings = 1; /* we have just decoded something */ whitespace = 0; /* re-initialize amount of whitespace */ } } #ifdef HAVE_ICONV if (use_iconv) iconv_close(cd); #endif /* If an equals was pending at end of string, add it now. */ if (equals_pending) ADDCHR('='); *q = '\0'; return encoding_found; buffull: /* q is currently just off the end of the buffer, so rewind to NUL terminate */ q--; *q = '\0'; return encoding_found; } nmh-1.5/sbr/fmt_scan.c000644 007761 000765 00000052145 11765267273 014645 0ustar00kenhkenh000000 000000 /* * fmt_scan.c -- format string interpretation * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. * * This is the engine that processes the format instructions created by * fmt_compile (found in fmt_compile.c). */ #include #include #include #include #include #ifdef HAVE_SYS_TIME_H # include #endif #include #ifdef MULTIBYTE_SUPPORT # include # include #endif #ifdef LBL struct msgs *fmt_current_folder; /* current folder (set by main program) */ #endif extern int fmt_norm; /* defined in sbr/fmt_def.c = AD_NAME */ struct mailname fmt_mnull = { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL }; /* * static prototypes */ static int match (char *, char *); static char *get_x400_friendly (char *, char *, int); static int get_x400_comp (char *, char *, char *, int); /* * test if string "sub" appears anywhere in * string "str" (case insensitive). */ static int match (char *str, char *sub) { int c1, c2; char *s1, *s2; #ifdef LOCALE while ((c1 = *sub)) { c1 = (isalpha(c1) && isupper(c1)) ? tolower(c1) : c1; while ((c2 = *str++) && c1 != ((isalpha(c2) && isupper(c2)) ? tolower(c2) : c2)) ; if (! c2) return 0; s1 = sub + 1; s2 = str; while ((c1 = *s1++) && ((isalpha(c1) && isupper(c1)) ? tolower(c1) : c1) == ((isalpha(c2 =*s2++) && isupper(c2)) ? tolower(c2) : c2)) ; if (! c1) return 1; } #else while ((c1 = *sub)) { while ((c2 = *str++) && (c1 | 040) != (c2 | 040)) ; if (! c2) return 0; s1 = sub + 1; s2 = str; while ((c1 = *s1++) && (c1 | 040) == (*s2++ | 040)) ; if (! c1) return 1; } #endif return 1; } /* * copy a number to the destination subject to a maximum width */ static void cpnumber(char **dest, int num, unsigned int wid, char fill, size_t n) { int i, c; char *sp; char *cp = *dest; char *ep = cp + n; if (cp + wid < ep) { if ((i = (num)) < 0) i = -(num); if ((c = (wid)) < 0) c = -c; sp = cp + c; do { *--sp = (i % 10) + '0'; i /= 10; } while (i > 0 && sp > cp); if (i > 0) *sp = '?'; else if ((num) < 0 && sp > cp) *--sp = '-'; while (sp > cp) *--sp = fill; cp += c; } *dest = cp; } /* * copy string from str to dest padding with the fill character to a size * of wid characters. if wid is negative, the string is right aligned * no more than n bytes are copied */ static void cptrimmed(char **dest, char *str, unsigned int wid, char fill, size_t n) { int remaining; /* remaining output width available */ int c, ljust; int end; /* number of input bytes remaining in str */ #ifdef MULTIBYTE_SUPPORT int char_len; /* bytes in current character */ int w; wchar_t wide_char; #endif char *sp; /* current position in source string */ char *cp = *dest; /* current position in destination string */ char *ep = cp + n; /* end of destination buffer */ int prevCtrl = 1; /* get alignment */ ljust = 0; if ((remaining = (wid)) < 0) { remaining = -remaining; ljust++; } if ((sp = (str))) { mbtowc(NULL, NULL, 0); /* reset shift state */ end = strlen(str); while (*sp && remaining > 0 && end > 0) { #ifdef MULTIBYTE_SUPPORT char_len = mbtowc(&wide_char, sp, end); if (char_len <= 0 || (cp + char_len > ep)) break; end -= char_len; if (iswcntrl(wide_char) || iswspace(wide_char)) { sp += char_len; #else int c; end--; /* isnctrl(), etc., take an int argument. Cygwin's ctype.h intentionally warns if they are passed a char. */ c = *sp; if (iscntrl(c) || isspace(c)) { sp++; #endif if (!prevCtrl) { *cp++ = ' '; remaining--; } prevCtrl = 1; continue; } prevCtrl = 0; #ifdef MULTIBYTE_SUPPORT w = wcwidth(wide_char); if (w >= 0 && remaining >= w) { strncpy(cp, sp, char_len); cp += char_len; remaining -= w; } sp += char_len; #else *cp++ = *sp++; remaining--; #endif } } if (ljust) { if (cp + remaining > ep) remaining = ep - cp; ep = cp + remaining; if (remaining > 0) { /* copy string to the right */ while (--cp >= *dest) *(cp + remaining) = *cp; /* add padding at the beginning */ cp += remaining; for (c=remaining; c>0; c--) *cp-- = fill; } *dest = ep; } else { /* pad remaining space */ while (remaining-- > 0 && cp < ep) *cp++ = fill; *dest = cp; } } static void cpstripped (char **start, char *end, char *str) { int c; char *s = str; if (!s) return; /* skip any initial control characters or spaces */ while ((c = (unsigned char) *s) && #ifdef LOCALE (isascii(c) && (iscntrl(c) || isspace(c)))) #else (c <= 32)) #endif s++; /* compact repeated control characters and spaces into a single space */ while((c = (unsigned char) *s++) && *start < end) if (!isascii(c) || (!iscntrl(c) && !isspace(c))) *(*start)++ = c; else { while ((c = (unsigned char) *s) && #ifdef LOCALE (isascii(c) && (iscntrl(c) || isspace(c)))) #else (c <= 32)) #endif s++; *(*start)++ = ' '; } } static char *lmonth[] = { "January", "February","March", "April", "May", "June", "July", "August", "September","October", "November","December" }; static char * get_x400_friendly (char *mbox, char *buffer, int buffer_len) { char given[BUFSIZ], surname[BUFSIZ]; if (mbox == NULL) return NULL; if (*mbox == '"') mbox++; if (*mbox != '/') return NULL; if (get_x400_comp (mbox, "/PN=", buffer, buffer_len)) { for (mbox = buffer; (mbox = strchr(mbox, '.')); ) *mbox++ = ' '; return buffer; } if (!get_x400_comp (mbox, "/S=", surname, sizeof(surname))) return NULL; if (get_x400_comp (mbox, "/G=", given, sizeof(given))) snprintf (buffer, buffer_len, "%s %s", given, surname); else snprintf (buffer, buffer_len, "%s", surname); return buffer; } static int get_x400_comp (char *mbox, char *key, char *buffer, int buffer_len) { int idx; char *cp; if ((idx = stringdex (key, mbox)) < 0 || !(cp = strchr(mbox += idx + strlen (key), '/'))) return 0; snprintf (buffer, buffer_len, "%*.*s", (int)(cp - mbox), (int)(cp - mbox), mbox); return 1; } struct format * fmt_scan (struct format *format, char *scanl, int width, int *dat) { char *cp, *ep; unsigned char *sp; char *savestr = NULL; unsigned char *str = NULL; char buffer[BUFSIZ], buffer2[BUFSIZ]; int i, c, ljust, n; int value = 0; time_t t; struct format *fmt; struct comp *comp; struct tws *tws; struct mailname *mn; cp = scanl; ep = scanl + width - 1; for (fmt = format; fmt->f_type != FT_DONE; fmt++) switch (fmt->f_type) { case FT_PARSEADDR: case FT_PARSEDATE: fmt->f_comp->c_flags &= ~CF_PARSED; break; case FT_COMP: case FT_COMPF: case FT_LS_COMP: case FT_LS_DECODECOMP: /* * Trim these components of any newlines. * * But don't trim the "body" and "text" components. */ comp = fmt->f_comp; if (! (comp->c_flags & CF_TRIMMED) && comp->c_text) { i = strlen(comp->c_text); if (comp->c_text[i - 1] == '\n' && strcmp(comp->c_name, "body") != 0 && strcmp(comp->c_name, "text") != 0) comp->c_text[i - 1] = '\0'; comp->c_flags |= CF_TRIMMED; } break; } fmt = format; while (cp < ep) { switch (fmt->f_type) { case FT_COMP: cpstripped (&cp, ep, fmt->f_comp->c_text); break; case FT_COMPF: cptrimmed (&cp, fmt->f_comp->c_text, fmt->f_width, fmt->f_fill, ep - cp); break; case FT_LIT: sp = fmt->f_text; while( (c = *sp++) && cp < ep) *cp++ = c; break; case FT_LITF: sp = fmt->f_text; ljust = 0; i = fmt->f_width; if (i < 0) { i = -i; ljust++; /* XXX should do something with this */ } while( (c = *sp++) && --i >= 0 && cp < ep) *cp++ = c; while( --i >= 0 && cp < ep) *cp++ = fmt->f_fill; break; case FT_STR: cpstripped (&cp, ep, str); break; case FT_STRF: cptrimmed (&cp, str, fmt->f_width, fmt->f_fill, ep - cp); break; case FT_STRLIT: sp = str; while ((c = *sp++) && cp < ep) *cp++ = c; break; case FT_STRFW: adios (NULL, "internal error (FT_STRFW)"); case FT_NUM: n = snprintf(cp, ep - cp + 1, "%d", value); if (n >= 0) { if (n >= ep - cp) { cp = ep; } else cp += n; } break; case FT_NUMF: cpnumber (&cp, value, fmt->f_width, fmt->f_fill, ep - cp); break; case FT_CHAR: *cp++ = fmt->f_char; break; case FT_DONE: goto finished; case FT_IF_S: if (!(value = (str && *str))) { fmt += fmt->f_skip; continue; } break; case FT_IF_S_NULL: if (!(value = (str == NULL || *str == 0))) { fmt += fmt->f_skip; continue; } break; case FT_IF_V_EQ: if (value != fmt->f_value) { fmt += fmt->f_skip; continue; } break; case FT_IF_V_NE: if (value == fmt->f_value) { fmt += fmt->f_skip; continue; } break; case FT_IF_V_GT: if (value <= fmt->f_value) { fmt += fmt->f_skip; continue; } break; case FT_IF_MATCH: if (!(value = (str && match (str, fmt->f_text)))) { fmt += fmt->f_skip; continue; } break; case FT_V_MATCH: if (str) value = match (str, fmt->f_text); else value = 0; break; case FT_IF_AMATCH: if (!(value = (str && uprf (str, fmt->f_text)))) { fmt += fmt->f_skip; continue; } break; case FT_V_AMATCH: value = uprf (str, fmt->f_text); break; case FT_S_NONNULL: value = (str != NULL && *str != 0); break; case FT_S_NULL: value = (str == NULL || *str == 0); break; case FT_V_EQ: value = (fmt->f_value == value); break; case FT_V_NE: value = (fmt->f_value != value); break; case FT_V_GT: value = (fmt->f_value > value); break; case FT_GOTO: fmt += fmt->f_skip; continue; case FT_NOP: break; case FT_LS_COMP: str = fmt->f_comp->c_text; break; case FT_LS_LIT: str = fmt->f_text; break; case FT_LS_GETENV: if (!(str = getenv (fmt->f_text))) str = ""; break; case FT_LS_CFIND: if (!(str = context_find (fmt->f_text))) str = ""; break; case FT_LS_DECODECOMP: if (decode_rfc2047(fmt->f_comp->c_text, buffer2, sizeof(buffer2))) str = buffer2; else str = fmt->f_comp->c_text; break; case FT_LS_DECODE: if (str && decode_rfc2047(str, buffer2, sizeof(buffer2))) str = buffer2; break; case FT_LS_TRIM: if (str) { unsigned char *xp; strncpy(buffer, str, sizeof(buffer)); buffer[sizeof(buffer)-1] = '\0'; str = buffer; while (isspace(*str)) str++; ljust = 0; if ((i = fmt->f_width) < 0) { i = -i; ljust++; } if (!ljust && i > 0 && (int) strlen(str) > i) str[i] = '\0'; xp = str; xp += strlen(str) - 1; while (xp > str && isspace(*xp)) *xp-- = '\0'; if (ljust && i > 0 && (int) strlen(str) > i) str += strlen(str) - i; } break; case FT_LV_COMPFLAG: value = (fmt->f_comp->c_flags & CF_TRUE) != 0; break; case FT_LV_COMP: value = (comp = fmt->f_comp)->c_text ? atoi(comp->c_text) : 0; break; case FT_LV_LIT: value = fmt->f_value; break; case FT_LV_DAT: value = dat[fmt->f_value]; break; case FT_LV_STRLEN: if (str != NULL) value = strlen(str); else value = 0; break; case FT_LV_CHAR_LEFT: value = width - (cp - scanl); break; case FT_LV_PLUS_L: value += fmt->f_value; break; case FT_LV_MINUS_L: value = fmt->f_value - value; break; case FT_LV_DIVIDE_L: if (fmt->f_value) value = value / fmt->f_value; else value = 0; break; case FT_LV_MODULO_L: if (fmt->f_value) value = value % fmt->f_value; else value = 0; break; case FT_SAVESTR: savestr = str; break; case FT_LV_SEC: value = fmt->f_comp->c_tws->tw_sec; break; case FT_LV_MIN: value = fmt->f_comp->c_tws->tw_min; break; case FT_LV_HOUR: value = fmt->f_comp->c_tws->tw_hour; break; case FT_LV_MDAY: value = fmt->f_comp->c_tws->tw_mday; break; case FT_LV_MON: value = fmt->f_comp->c_tws->tw_mon + 1; break; case FT_LS_MONTH: str = tw_moty[fmt->f_comp->c_tws->tw_mon]; break; case FT_LS_LMONTH: str = lmonth[fmt->f_comp->c_tws->tw_mon]; break; case FT_LS_ZONE: str = dtwszone (fmt->f_comp->c_tws); break; case FT_LV_YEAR: value = fmt->f_comp->c_tws->tw_year; break; case FT_LV_WDAY: if (!(((tws = fmt->f_comp->c_tws)->tw_flags) & (TW_SEXP|TW_SIMP))) set_dotw (tws); value = tws->tw_wday; break; case FT_LS_DAY: if (!(((tws = fmt->f_comp->c_tws)->tw_flags) & (TW_SEXP|TW_SIMP))) set_dotw (tws); str = tw_dotw[tws->tw_wday]; break; case FT_LS_WEEKDAY: if (!(((tws = fmt->f_comp->c_tws)->tw_flags) & (TW_SEXP|TW_SIMP))) set_dotw (tws); str = tw_ldotw[tws->tw_wday]; break; case FT_LV_YDAY: value = fmt->f_comp->c_tws->tw_yday; break; case FT_LV_ZONE: value = fmt->f_comp->c_tws->tw_zone; break; case FT_LV_CLOCK: if ((value = fmt->f_comp->c_tws->tw_clock) == 0) value = dmktime(fmt->f_comp->c_tws); break; case FT_LV_RCLOCK: if ((value = fmt->f_comp->c_tws->tw_clock) == 0) value = dmktime(fmt->f_comp->c_tws); value = time((time_t *) 0) - value; break; case FT_LV_DAYF: if (!(((tws = fmt->f_comp->c_tws)->tw_flags) & (TW_SEXP|TW_SIMP))) set_dotw (tws); switch (fmt->f_comp->c_tws->tw_flags & TW_SDAY) { case TW_SEXP: value = 1; break; case TW_SIMP: value = 0; break; default: value = -1; break; } case FT_LV_ZONEF: if ((fmt->f_comp->c_tws->tw_flags & TW_SZONE) == TW_SZEXP) value = 1; else value = -1; break; case FT_LV_DST: value = fmt->f_comp->c_tws->tw_flags & TW_DST; break; case FT_LS_822DATE: str = dasctime (fmt->f_comp->c_tws , TW_ZONE); break; case FT_LS_PRETTY: str = dasctime (fmt->f_comp->c_tws, TW_NULL); break; case FT_LS_PERS: str = fmt->f_comp->c_mn->m_pers; break; case FT_LS_MBOX: str = fmt->f_comp->c_mn->m_mbox; break; case FT_LS_HOST: str = fmt->f_comp->c_mn->m_host; break; case FT_LS_PATH: str = fmt->f_comp->c_mn->m_path; break; case FT_LS_GNAME: str = fmt->f_comp->c_mn->m_gname; break; case FT_LS_NOTE: str = fmt->f_comp->c_mn->m_note; break; case FT_LS_822ADDR: str = adrformat( fmt->f_comp->c_mn ); break; case FT_LV_HOSTTYPE: value = fmt->f_comp->c_mn->m_type; break; case FT_LV_INGRPF: value = fmt->f_comp->c_mn->m_ingrp; break; case FT_LV_NOHOSTF: value = fmt->f_comp->c_mn->m_nohost; break; case FT_LS_ADDR: case FT_LS_FRIENDLY: if ((mn = fmt->f_comp->c_mn) == &fmt_mnull) { str = fmt->f_comp->c_text; break; } if (fmt->f_type == FT_LS_ADDR) goto unfriendly; if ((str = mn->m_pers) == NULL) { if ((str = mn->m_note)) { strncpy (buffer, str, sizeof(buffer)); buffer[sizeof(buffer)-1] = '\0'; str = buffer; if (*str == '(') str++; sp = str + strlen(str) - 1; if (*sp == ')') { *sp-- = '\0'; while (sp >= str) if (*sp == ' ') *sp-- = '\0'; else break; } } else if (!(str = get_x400_friendly (mn->m_mbox, buffer, sizeof(buffer)))) { unfriendly: ; switch (mn->m_type) { case LOCALHOST: str = mn->m_mbox; break; case UUCPHOST: snprintf (buffer, sizeof(buffer), "%s!%s", mn->m_host, mn->m_mbox); str = buffer; break; default: if (mn->m_mbox) { snprintf (buffer, sizeof(buffer), "%s@%s", mn->m_mbox, mn->m_host); str= buffer; } else str = mn->m_text; break; } } } break; /* UNQUOTEs RFC-2822 quoted-string and quoted-pair */ case FT_LS_UNQUOTE: if (str) { int m; strncpy(buffer, str, sizeof(buffer)); /* strncpy doesn't NUL-terminate if it fills the buffer */ buffer[sizeof(buffer)-1] = '\0'; str = buffer; /* we will parse from buffer to buffer2 */ n = 0; /* n is the input position in str */ m = 0; /* m is the ouput position in buffer2 */ while ( str[n] != '\0') { switch ( str[n] ) { case '\\': n++; if ( str[n] != '\0') buffer2[m++] = str[n++]; break; case '"': n++; break; default: buffer2[m++] = str[n++]; break; } } buffer2[m] = '\0'; str = buffer2; } break; case FT_LOCALDATE: comp = fmt->f_comp; if ((t = comp->c_tws->tw_clock) == 0) t = dmktime(comp->c_tws); tws = dlocaltime(&t); *comp->c_tws = *tws; break; case FT_GMTDATE: comp = fmt->f_comp; if ((t = comp->c_tws->tw_clock) == 0) t = dmktime(comp->c_tws); tws = dgmtime(&t); *comp->c_tws = *tws; break; case FT_PARSEDATE: comp = fmt->f_comp; if (comp->c_flags & CF_PARSED) break; if ((sp = comp->c_text) && (tws = dparsetime(sp))) { *comp->c_tws = *tws; comp->c_flags &= ~CF_TRUE; } else if ((comp->c_flags & CF_DATEFAB) == 0) { memset ((char *) comp->c_tws, 0, sizeof *comp->c_tws); comp->c_flags = CF_TRUE; } comp->c_flags |= CF_PARSED; break; case FT_FORMATADDR: /* hook for custom address list formatting (see replsbr.c) */ str = formataddr (savestr, str); break; case FT_CONCATADDR: /* The same as formataddr, but doesn't do duplicate suppression */ str = concataddr (savestr, str); break; case FT_PUTADDR: /* output the str register as an address component, * splitting it into multiple lines if necessary. The * value reg. contains the max line length. The lit. * field may contain a string to prepend to the result * (e.g., "To: ") */ { unsigned char *lp; char *lastb; int indent, wid, len; lp = str; wid = value; len = strlen (str); sp = fmt->f_text; indent = strlen (sp); wid -= indent; if (wid <= 0) { adios(NULL, "putaddr -- num register (%d) must be greater " "than label width (%d)", value, indent); } while( (c = *sp++) && cp < ep) *cp++ = c; while (len > wid) { /* try to break at a comma; failing that, break at a * space. */ lastb = 0; sp = lp + wid; while (sp > lp && (c = *--sp) != ',') { if (! lastb && isspace(c)) lastb = sp - 1; } if (sp == lp) { if (! (sp = lastb)) { sp = lp + wid - 1; while (*sp && *sp != ',' && !isspace(*sp)) sp++; if (*sp != ',') sp--; } } len -= sp - lp + 1; while (cp < ep && lp <= sp) *cp++ = *lp++; while (isspace(*lp)) lp++, len--; if (*lp) { if (cp < ep) *cp++ = '\n'; for (i=indent; cp < ep && i > 0; i--) *cp++ = ' '; } } cpstripped (&cp, ep, lp); } break; case FT_PARSEADDR: comp = fmt->f_comp; if (comp->c_flags & CF_PARSED) break; if (comp->c_mn != &fmt_mnull) mnfree (comp->c_mn); if ((sp = comp->c_text) && (sp = getname(sp)) && (mn = getm (sp, NULL, 0, fmt_norm, NULL))) { comp->c_mn = mn; while (getname("")) ; comp->c_flags |= CF_PARSED; } else { while (getname("")) /* XXX */ ; comp->c_mn = &fmt_mnull; } break; case FT_MYMBOX: /* * if there's no component, we say true. Otherwise we * say "true" only if we can parse the address and it * matches one of our addresses. */ comp = fmt->f_comp; if (comp->c_mn != &fmt_mnull) mnfree (comp->c_mn); if ((sp = comp->c_text) && (sp = getname(sp)) && (mn = getm (sp, NULL, 0, AD_NAME, NULL))) { comp->c_mn = mn; if (ismymbox(mn)) comp->c_flags |= CF_TRUE; else comp->c_flags &= ~CF_TRUE; while ((sp = getname(sp))) if ((comp->c_flags & CF_TRUE) == 0 && (mn = getm (sp, NULL, 0, AD_NAME, NULL))) if (ismymbox(mn)) comp->c_flags |= CF_TRUE; } else { while (getname("")) /* XXX */ ; if (comp->c_text == 0) comp->c_flags |= CF_TRUE; else comp->c_flags &= ~CF_TRUE; comp->c_mn = &fmt_mnull; } break; case FT_ADDTOSEQ: #ifdef LBL /* If we're working on a folder (as opposed to a file), add the * current msg to sequence given in literal field. Don't * disturb string or value registers. */ if (fmt_current_folder) seq_addmsg(fmt_current_folder, fmt->f_text, dat[0], -1); #endif break; } fmt++; } #ifndef JLR finished:; if (cp[-1] != '\n') *cp++ = '\n'; *cp = 0; return ((struct format *)0); #else /* JLR */ if (cp[-1] != '\n') *cp++ = '\n'; while (fmt->f_type != FT_DONE) fmt++; finished:; *cp = '\0'; return (fmt->f_value ? ++fmt : (struct format *) 0); #endif /* JLR */ } nmh-1.5/sbr/folder_addmsg.c000644 007761 000765 00000012313 11765267273 015636 0ustar00kenhkenh000000 000000 /* * folder_addmsg.c -- Link message into folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include /* * Link message into a folder. Return the new number * of the message. If an error occurs, return -1. */ int folder_addmsg (struct msgs **mpp, char *msgfile, int selected, int unseen, int preserve, int deleting, char *from_dir) { int infd, outfd, linkerr, msgnum; char *nmsg, newmsg[BUFSIZ]; char oldmsg[BUFSIZ]; struct msgs *mp; struct stat st1, st2; mp = *mpp; /* should we preserve the numbering of the message? */ if (preserve && (msgnum = m_atoi (msgfile)) > 0) { ; } else if (mp->nummsg == 0) { /* check if we are adding to empty folder */ msgnum = 1; } else { /* else use highest message number + 1 */ msgnum = mp->hghmsg + 1; } /* * We might need to make several attempts * in order to add the message to the folder. */ for (;; msgnum++) { /* * See if we need more space. If we need space at the * end, then we allocate space for an addition 100 messages. * If we need space at the beginning of the range, then just * extend message status range to cover this message number. */ if (msgnum > mp->hghoff) { if ((mp = folder_realloc (mp, mp->lowoff, msgnum + 100))) *mpp = mp; else { advise (NULL, "unable to allocate folder storage"); return -1; } } else if (msgnum < mp->lowoff) { if ((mp = folder_realloc (mp, msgnum, mp->hghoff))) *mpp = mp; else { advise (NULL, "unable to allocate folder storage"); return -1; } } /* * If a message is already in that slot, * then loop to next available slot. */ if (does_exist (mp, msgnum)) continue; /* setup the bit flags for this message */ clear_msg_flags (mp, msgnum); set_exists (mp, msgnum); /* should we set the SELECT_UNSEEN bit? */ if (unseen) { set_unseen (mp, msgnum); } /* should we set the SELECTED bit? */ if (selected) { set_selected (mp, msgnum); /* check if highest or lowest selected */ if (mp->numsel == 0) { mp->lowsel = msgnum; mp->hghsel = msgnum; } else { if (msgnum < mp->lowsel) mp->lowsel = msgnum; if (msgnum > mp->hghsel) mp->hghsel = msgnum; } /* increment number selected */ mp->numsel++; } /* * check if this is highest or lowest message */ if (mp->nummsg == 0) { mp->lowmsg = msgnum; mp->hghmsg = msgnum; } else { if (msgnum < mp->lowmsg) mp->lowmsg = msgnum; if (msgnum > mp->hghmsg) mp->hghmsg = msgnum; } /* increment message count */ mp->nummsg++; nmsg = m_name (msgnum); snprintf (newmsg, sizeof(newmsg), "%s/%s", mp->foldpath, nmsg); /* * Now try to link message into folder. * Then run the external hook on the message if one was specified in the context. * Run the refile hook if we're moving the message from one place to another. * We have to construct the from path name for this because it's not there. * Run the add hook if the message is getting copied or linked somewhere else. */ if (link (msgfile, newmsg) != -1) { if (deleting) { (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile); (void)ext_hook("ref-hook", oldmsg, newmsg); } else (void)ext_hook("add-hook", newmsg, (char *)0); return msgnum; } else { linkerr = errno; #ifdef EISREMOTE if (linkerr == EISREMOTE) linkerr = EXDEV; #endif /* EISREMOTE */ /* * Check if the file in our desired location is the same * as the source file. If so, then just leave it alone * and return. Otherwise, we will continue the main loop * and try again at another slot (hghmsg+1). */ if (linkerr == EEXIST) { if (stat (msgfile, &st2) == 0 && stat (newmsg, &st1) == 0 && st2.st_ino == st1.st_ino) { return msgnum; } else { continue; } } /* * If link failed because we are trying to link * across devices, then check if there is a message * already in the desired location. If so, then return * error, else just copy the message. */ if (linkerr == EXDEV) { if (stat (newmsg, &st1) == 0) { advise (NULL, "message %s:%s already exists", mp->foldpath, newmsg); return -1; } else { if ((infd = open (msgfile, O_RDONLY)) == -1) { advise (msgfile, "unable to open message %s", msgfile); return -1; } fstat (infd, &st1); if ((outfd = creat (newmsg, (int) st1.st_mode & 0777)) == -1) { advise (newmsg, "unable to create"); close (infd); return -1; } cpydata (infd, outfd, msgfile, newmsg); close (infd); close (outfd); if (deleting) { (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%s", from_dir, msgfile); (void)ext_hook("ref-hook", oldmsg, newmsg); } else (void)ext_hook("add-hook", newmsg, (char *)0); return msgnum; } } /* * Else, some other type of link error, * so just return error. */ advise (newmsg, "error linking %s to", msgfile); return -1; } } } nmh-1.5/sbr/folder_delmsgs.c000644 007761 000765 00000006505 11713401274 016023 0ustar00kenhkenh000000 000000 /* * folder_delmsgs.c -- "remove" SELECTED messages from a folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * 1) If we are using an external rmmproc, then exec it. * 2) Else if unlink_msgs is non-zero, then unlink the * SELECTED messages. * 3) Else rename SELECTED messages by prefixing name * with a standard prefix. * * If there is an error, return -1, else return 0. */ int folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook) { pid_t pid; int msgnum, vecp, retval = 0; char buf[100], *dp, **vec; char msgpath[BUFSIZ]; /* * If "rmmproc" is defined, exec it to remove messages. */ if (rmmproc) { /* Unset the EXISTS flag for each message to be removed */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) unset_exists (mp, msgnum); } /* Mark that the sequence information has changed */ mp->msgflags |= SEQMOD; if (mp->numsel > MAXARGS - 2) adios (NULL, "more than %d messages for %s exec", MAXARGS - 2, rmmproc); vec = (char **) calloc ((size_t) (mp->numsel + 2), sizeof(*vec)); if (vec == NULL) adios (NULL, "unable to allocate exec vector"); vecp = 1; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum) && !(vec[vecp++] = strdup (m_name (msgnum)))) adios (NULL, "strdup failed"); } vec[vecp] = NULL; fflush (stdout); vec[0] = r1bindex (rmmproc, '/'); switch (pid = vfork()) { case -1: advise ("fork", "unable to"); return -1; case 0: execvp (rmmproc, vec); fprintf (stderr, "unable to exec "); perror (rmmproc); _exit (-1); default: return (pidwait (pid, -1)); } } /* * Either unlink or rename the SELECTED messages */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum)) { /* unselect message */ unset_selected (mp, msgnum); mp->numsel--; /* * Run the external hook on the message if one was specified in the context. * All we have is the message number; we have changed to the directory * containing the message. So, we need to extract that directory to form * the complete path. Note that the caller knows the directory, but has * no way of passing that to us. */ if (!nohook) { (void)snprintf(msgpath, sizeof (msgpath), "%s/%d", mp->foldpath, msgnum); (void)ext_hook("del-hook", msgpath, (char *)0); } dp = m_name (msgnum); if (unlink_msgs) { /* just unlink the messages */ if (unlink (dp) == -1) { admonish (dp, "unable to unlink"); retval = -1; continue; } } else { /* or rename messages with standard prefix */ strncpy (buf, m_backup (dp), sizeof(buf)); if (rename (dp, buf) == -1) { admonish (buf, "unable to rename %s to", dp); retval = -1; continue; } } /* If removal was successful, decrement message count */ unset_exists (mp, msgnum); mp->nummsg--; } } /* Sanity check */ if (mp->numsel != 0) adios (NULL, "oops, mp->numsel should be 0"); /* Mark that the sequence information has changed */ mp->msgflags |= SEQMOD; return retval; } nmh-1.5/sbr/folder_free.c000644 007761 000765 00000001104 11713401274 015274 0ustar00kenhkenh000000 000000 /* * folder_free.c -- free a folder/message structure * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void folder_free (struct msgs *mp) { int i; if (!mp) return; if (mp->foldpath) free (mp->foldpath); /* free the sequence names */ for (i = 0; mp->msgattrs[i]; i++) free (mp->msgattrs[i]); free (mp->msgstats); /* free message status area */ free (mp); /* free main folder structure */ } nmh-1.5/sbr/folder_pack.c000644 007761 000765 00000004557 11713401274 015310 0ustar00kenhkenh000000 000000 /* * folder_pack.c -- pack (renumber) the messages in a folder * -- into a contiguous range from 1 to n. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * Pack the message in a folder. * Return -1 if error, else return 0. */ int folder_pack (struct msgs **mpp, int verbose) { int hole, msgnum, newcurrent = 0; char newmsg[BUFSIZ], oldmsg[BUFSIZ]; struct msgs *mp; mp = *mpp; /* * Just return if folder is empty. */ if (mp->nummsg == 0) return 0; /* * Make sure we have message status space allocated * for all numbers from 1 to current high message. */ if (mp->lowoff > 1) { if ((mp = folder_realloc (mp, 1, mp->hghmsg))) *mpp = mp; else { advise (NULL, "unable to allocate folder storage"); return -1; } } for (msgnum = mp->lowmsg, hole = 1; msgnum <= mp->hghmsg; msgnum++) { if (does_exist (mp, msgnum)) { if (msgnum != hole) { strncpy (newmsg, m_name (hole), sizeof(newmsg)); strncpy (oldmsg, m_name (msgnum), sizeof(oldmsg)); if (verbose) printf ("message %s becomes %s\n", oldmsg, newmsg); /* * Invoke the external refile hook for each message being renamed. * This is done before the file is renamed so that the old message * file is around for the hook. */ (void)snprintf(oldmsg, sizeof (oldmsg), "%s/%d", mp->foldpath, msgnum); (void)snprintf(newmsg, sizeof (newmsg), "%s/%d", mp->foldpath, hole); ext_hook("ref-hook", oldmsg, newmsg); /* move the message file */ if (rename (oldmsg, newmsg) == -1) { advise (newmsg, "unable to rename %s to", oldmsg); return -1; } /* check if this is the current message */ if (msgnum == mp->curmsg) newcurrent = hole; /* copy the attribute flags for this message */ copy_msg_flags (mp, hole, msgnum); if (msgnum == mp->lowsel) mp->lowsel = hole; if (msgnum == mp->hghsel) mp->hghsel = hole; /* mark that sequence information has been modified */ mp->msgflags |= SEQMOD; } hole++; } } /* record the new number for the high/low message */ mp->lowmsg = 1; mp->hghmsg = hole - 1; /* update the "cur" sequence */ if (newcurrent != 0) seq_setcur (mp, newcurrent); return 0; } nmh-1.5/sbr/folder_read.c000644 007761 000765 00000007365 11762736346 015324 0ustar00kenhkenh000000 000000 /* * folder_read.c -- initialize folder structure and read folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* We allocate the `mi' array 1024 elements at a time */ #define NUMMSGS 1024 /* * 1) Create the folder/message structure * 2) Read the directory (folder) and temporarily * record the numbers of the messages we have seen. * 3) Then allocate the array for message attributes and * set the initial flags for all messages we've seen. * 4) Read and initialize the sequence information. */ struct msgs * folder_read (char *name) { int msgnum, prefix_len, len, *mi; struct msgs *mp; struct stat st; struct dirent *dp; DIR *dd; name = m_mailpath (name); if (!(dd = opendir (name))) { free (name); return NULL; } if (stat (name, &st) == -1) { free (name); return NULL; } /* Allocate the main structure for folder information */ mp = (struct msgs *) mh_xmalloc ((size_t) sizeof(*mp)); clear_folder_flags (mp); mp->foldpath = name; mp->lowmsg = 0; mp->hghmsg = 0; mp->curmsg = 0; mp->lowsel = 0; mp->hghsel = 0; mp->numsel = 0; mp->nummsg = 0; if (access (name, W_OK) == -1) set_readonly (mp); prefix_len = strlen(BACKUP_PREFIX); /* * Allocate a temporary place to record the * name of the messages in this folder. */ len = NUMMSGS; mi = (int *) mh_xmalloc ((size_t) (len * sizeof(*mi))); while ((dp = readdir (dd))) { if ((msgnum = m_atoi (dp->d_name)) && msgnum > 0) { /* * Check if we need to allocate more * temporary elements for message names. */ if (mp->nummsg >= len) { len += NUMMSGS; mi = (int *) mh_xrealloc (mi, (size_t) (len * sizeof(*mi))); } /* Check if this is the first message we've seen */ if (mp->nummsg == 0) { mp->lowmsg = msgnum; mp->hghmsg = msgnum; } else { /* Check if this is it the highest or lowest we've seen? */ if (msgnum < mp->lowmsg) mp->lowmsg = msgnum; if (msgnum > mp->hghmsg) mp->hghmsg = msgnum; } /* * Now increment count, and record message * number in a temporary place for now. */ mi[mp->nummsg++] = msgnum; } else { switch (dp->d_name[0]) { case '.': case ',': continue; default: /* skip any files beginning with backup prefix */ if (!strncmp (dp->d_name, BACKUP_PREFIX, prefix_len)) continue; /* skip the LINK file */ if (!strcmp (dp->d_name, LINK)) continue; /* indicate that there are other files in folder */ set_other_files (mp); continue; } } } closedir (dd); mp->lowoff = max (mp->lowmsg, 1); /* Go ahead and allocate space for 100 additional messages. */ mp->hghoff = mp->hghmsg + 100; /* for testing, allocate minimal necessary space */ /* mp->hghoff = max (mp->hghmsg, 1); */ /* * Allocate space for status of each message. */ mp->msgstats = mh_xmalloc (MSGSTATSIZE(mp, mp->lowoff, mp->hghoff)); /* * Clear all the flag bits for all the message * status entries we just allocated. */ for (msgnum = mp->lowoff; msgnum <= mp->hghoff; msgnum++) clear_msg_flags (mp, msgnum); /* * Scan through the array of messages we've seen and * setup the initial flags for those messages in the * newly allocated mp->msgstats area. */ for (msgnum = 0; msgnum < mp->nummsg; msgnum++) set_exists (mp, mi[msgnum]); free (mi); /* We don't need this anymore */ /* * Read and initialize the sequence information. */ seq_read (mp); return mp; } nmh-1.5/sbr/folder_realloc.c000644 007761 000765 00000004616 11713401274 016007 0ustar00kenhkenh000000 000000 /* * folder_realloc.c -- realloc a folder/msgs structure * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* * Reallocate some of the space in the folder * structure (currently just message status array). * * Return pointer to new folder structure. * If error, return NULL. */ struct msgs * folder_realloc (struct msgs *mp, int lo, int hi) { int msgnum; /* sanity checks */ if (lo < 1) adios (NULL, "BUG: called folder_realloc with lo (%d) < 1", lo); if (hi < 1) adios (NULL, "BUG: called folder_realloc with hi (%d) < 1", hi); if (mp->nummsg > 0 && lo > mp->lowmsg) adios (NULL, "BUG: called folder_realloc with lo (%d) > mp->lowmsg (%d)", lo, mp->lowmsg); if (mp->nummsg > 0 && hi < mp->hghmsg) adios (NULL, "BUG: called folder_realloc with hi (%d) < mp->hghmsg (%d)", hi, mp->hghmsg); /* Check if we really need to reallocate anything */ if (lo == mp->lowoff && hi == mp->hghoff) return mp; if (lo == mp->lowoff) { /* * We are just extending (or shrinking) the end of message * status array. So we don't have to move anything and can * just realloc the message status array. */ mp->msgstats = mh_xrealloc (mp->msgstats, MSGSTATSIZE(mp, lo, hi)); } else { /* * We are changing the offset of the message status * array. So we will need to shift everything. */ seqset_t *tmpstats; /* first allocate the new message status space */ tmpstats = mh_xmalloc (MSGSTATSIZE(mp, lo, hi)); /* then copy messages status array with shift */ if (mp->nummsg > 0) { for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) tmpstats[msgnum - lo] = mp->msgstats[msgnum - mp->lowoff]; } free(mp->msgstats); mp->msgstats = tmpstats; } mp->lowoff = lo; mp->hghoff = hi; /* * Clear all the flags for entries outside * the current message range for this folder. */ if (mp->nummsg > 0) { for (msgnum = mp->lowoff; msgnum < mp->lowmsg; msgnum++) clear_msg_flags (mp, msgnum); for (msgnum = mp->hghmsg + 1; msgnum <= mp->hghoff; msgnum++) clear_msg_flags (mp, msgnum); } else { /* no messages, so clear entire range */ for (msgnum = mp->lowoff; msgnum <= mp->hghoff; msgnum++) clear_msg_flags (mp, msgnum); } return mp; } nmh-1.5/sbr/gans.c000644 007761 000765 00000002014 11713401274 013751 0ustar00kenhkenh000000 000000 /* * gans.c -- get an answer from the user * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int gans (char *prompt, struct swit *ansp) { register int i; register char *cp; register struct swit *ap; char ansbuf[BUFSIZ]; for (;;) { printf ("%s", prompt); fflush (stdout); cp = ansbuf; while ((i = getchar ()) != '\n') { if (i == EOF) return 0; if (cp < &ansbuf[sizeof ansbuf - 1]) { #ifdef LOCALE i = (isalpha(i) && isupper(i)) ? tolower(i) : i; #else if (i >= 'A' && i <= 'Z') i += 'a' - 'A'; #endif *cp++ = i; } } *cp = '\0'; if (ansbuf[0] == '?' || cp == ansbuf) { printf ("Options are:\n"); for (ap = ansp; ap->sw; ap++) printf (" %s\n", ap->sw); continue; } if ((i = smatch (ansbuf, ansp)) < 0) { printf ("%s: %s.\n", ansbuf, i == -1 ? "unknown" : "ambiguous"); continue; } return i; } } nmh-1.5/sbr/getans.c000644 007761 000765 00000004044 11762736346 014326 0ustar00kenhkenh000000 000000 /* * getans.c -- get an answer from the user and return a string array * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include static char ansbuf[BUFSIZ]; static sigjmp_buf sigenv; /* * static prototypes */ static void intrser (int); char ** getans (char *prompt, struct swit *ansp) { int i; SIGNAL_HANDLER istat = NULL; char *cp, **cpp; if (!(sigsetjmp(sigenv, 1))) { istat = SIGNAL (SIGINT, intrser); } else { SIGNAL (SIGINT, istat); return NULL; } for (;;) { printf ("%s", prompt); fflush (stdout); cp = ansbuf; while ((i = getchar ()) != '\n') { if (i == EOF) { /* * If we get an EOF, return */ if (feof(stdin)) siglongjmp (sigenv, 1); /* * For errors, if we get an EINTR that means that we got * a signal and we should retry. If we get another error, * then just return. */ else if (ferror(stdin)) { if (errno == EINTR) { clearerr(stdin); continue; } fprintf(stderr, "\nError %s during read\n", strerror(errno)); siglongjmp (sigenv, 1); } else { /* * Just for completeness's sake ... */ fprintf(stderr, "\nUnknown problem in getchar()\n"); siglongjmp (sigenv, 1); } } if (cp < &ansbuf[sizeof ansbuf - 1]) *cp++ = i; } *cp = '\0'; if (ansbuf[0] == '?' || cp == ansbuf) { printf ("Options are:\n"); print_sw (ALL, ansp, "", stdout); continue; } cpp = brkstring (ansbuf, " ", NULL); switch (smatch (*cpp, ansp)) { case AMBIGSW: ambigsw (*cpp, ansp); continue; case UNKWNSW: printf (" -%s unknown. Hit for help.\n", *cpp); continue; default: SIGNAL (SIGINT, istat); return cpp; } } } static void intrser (int i) { NMH_UNUSED (i); /* * should this be siglongjmp? */ siglongjmp (sigenv, 1); } nmh-1.5/sbr/getansreadline.c000644 007761 000765 00000007711 11762736346 016036 0ustar00kenhkenh000000 000000 /* * getansreadline.c -- get an answer from the user, with readline * * This code is Copyright (c) 2012, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include #ifdef READLINE_SUPPORT #include #include static struct swit *rl_cmds; static char *nmh_command_generator(const char *, int); static char **nmh_completion(const char *, int, int); static void initialize_readline(void); static char ansbuf[BUFSIZ]; #if 0 static sigjmp_buf sigenv; /* * static prototypes */ static void intrser (int); char ** getans (char *prompt, struct swit *ansp) { int i; SIGNAL_HANDLER istat = NULL; char *cp, **cpp; if (!(sigsetjmp(sigenv, 1))) { istat = SIGNAL (SIGINT, intrser); } else { SIGNAL (SIGINT, istat); return NULL; } for (;;) { printf ("%s", prompt); fflush (stdout); cp = ansbuf; while ((i = getchar ()) != '\n') { if (i == EOF) { /* * If we get an EOF, return */ if (feof(stdin)) siglongjmp (sigenv, 1); /* * For errors, if we get an EINTR that means that we got * a signal and we should retry. If we get another error, * then just return. */ else if (ferror(stdin)) { if (errno == EINTR) { clearerr(stdin); continue; } fprintf(stderr, "\nError %s during read\n", strerror(errno)); siglongjmp (sigenv, 1); } else { /* * Just for completeness's sake ... */ fprintf(stderr, "\nUnknown problem in getchar()\n"); siglongjmp (sigenv, 1); } } if (cp < &ansbuf[sizeof ansbuf - 1]) *cp++ = i; } *cp = '\0'; if (ansbuf[0] == '?' || cp == ansbuf) { printf ("Options are:\n"); print_sw (ALL, ansp, "", stdout); continue; } cpp = brkstring (ansbuf, " ", NULL); switch (smatch (*cpp, ansp)) { case AMBIGSW: ambigsw (*cpp, ansp); continue; case UNKWNSW: printf (" -%s unknown. Hit for help.\n", *cpp); continue; default: SIGNAL (SIGINT, istat); return cpp; } } } static void intrser (int i) { NMH_UNUSED (i); /* * should this be siglongjmp? */ siglongjmp (sigenv, 1); } #endif /* * getans, but with readline support */ char ** getans_via_readline(char *prompt, struct swit *ansp) { char *ans, **cpp; initialize_readline(); rl_cmds = ansp; for (;;) { ans = readline(prompt); /* * If we get an EOF, return */ if (ans == NULL) return NULL; if (ans[0] == '?' || ans[0] == '\0') { printf("Options are:\n"); print_sw(ALL, ansp, "", stdout); free(ans); continue; } add_history(ans); strncpy(ansbuf, ans, sizeof(ansbuf)); ansbuf[sizeof(ansbuf) - 1] = '\0'; cpp = brkstring(ansbuf, " ", NULL); switch (smatch(*cpp, ansp)) { case AMBIGSW: ambigsw(*cpp, ansp); continue; case UNKWNSW: printf(" -%s unknown. Hit for help.\n", *cpp); continue; default: free(ans); return cpp; } free(ans); } } static void initialize_readline(void) { rl_readline_name = "Nmh"; rl_attempted_completion_function = nmh_completion; } static char ** nmh_completion(const char *text, int start, int end) { char **matches; NMH_UNUSED (end); matches = (char **) NULL; if (start == 0) matches = rl_completion_matches(text, nmh_command_generator); return matches; } static char * nmh_command_generator(const char *text, int state) { static int list_index, len; char *name, *p; char buf[256]; if (!state) { list_index = 0; len = strlen(text); } while ((name = rl_cmds[list_index].sw)) { list_index++; strncpy(buf, name, sizeof(buf)); buf[sizeof(buf) - 1] = '\0'; p = *brkstring(buf, " ", NULL); if (strncmp(p, text, len) == 0) return strdup(p); } return NULL; } #endif /* READLINE_SUPPORT */ nmh-1.5/sbr/getanswer.c000644 007761 000765 00000000725 11476006206 015031 0ustar00kenhkenh000000 000000 /* * getanswer.c -- get a yes/no answer from the user * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include int getanswer (char *prompt) { static int interactive = -1; if (interactive < 0) interactive = isatty (fileno (stdin)) ? 1 : 0; return (interactive ? gans (prompt, anoyes) : 1); } nmh-1.5/sbr/getarguments.c000644 007761 000765 00000002162 11713401274 015532 0ustar00kenhkenh000000 000000 /* * getarguments.c -- Get the argument vector ready to go. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include char ** getarguments (char *invo_name, int argc, char **argv, int check_context) { char *cp = NULL, **ap = NULL, **bp = NULL, **arguments = NULL; int n = 0; /* * Check if profile/context specifies any arguments */ if (check_context && (cp = context_find (invo_name))) { cp = getcpy (cp); /* make copy */ ap = brkstring (cp, " ", "\n"); /* split string */ /* Count number of arguments split */ bp = ap; while (*bp++) n++; } arguments = (char **) mh_xmalloc ((argc + n) * sizeof(*arguments)); bp = arguments; /* Copy any arguments from profile/context */ if (ap != NULL && n > 0) { while (*ap) *bp++ = *ap++; } /* Copy arguments from command line */ argv++; while (*argv) *bp++ = *argv++; /* Now NULL terminate the array */ *bp = NULL; return arguments; } nmh-1.5/sbr/getcpy.c000644 007761 000765 00000001222 11713401274 014314 0ustar00kenhkenh000000 000000 /* * getcpy.c -- copy a string in managed memory * * THIS IS OBSOLETE. NEED TO REPLACE ALL OCCURENCES * OF GETCPY WITH STRDUP. BUT THIS WILL REQUIRE * CHANGING PARTS OF THE CODE TO DEAL WITH NULL VALUES. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include char * getcpy (char *str) { char *cp; size_t len; if (str) { len = strlen(str) + 1; cp = mh_xmalloc (len); memcpy (cp, str, len); } else { cp = mh_xmalloc ((size_t) 1); *cp = '\0'; } return cp; } nmh-1.5/sbr/getfolder.c000644 007761 000765 00000001302 11713401274 014773 0ustar00kenhkenh000000 000000 /* * getfolder.c -- get the current or default folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char * getfolder(int wantcurrent) { register char *folder; /* * If wantcurrent == 1, then try the current folder first */ if (wantcurrent && (folder = context_find (pfolder)) && *folder != '\0') return folder; /* * Else try the Inbox profile entry */ if ((folder = context_find (inbox)) && *folder != '\0') return folder; /* * Else return compile time default. */ return defaultfolder; } nmh-1.5/sbr/getpass.c000644 007761 000765 00000006353 11713401274 014501 0ustar00kenhkenh000000 000000 /* * Portions of this code are Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #include /* for isatty() */ #include "h/mh.h" /* for adios() */ /* We don't use MAX_PASS here because the maximum password length on a remote POP daemon will have nothing to do with the length on our OS. 256 is arbitrary but hopefully big enough to accomodate everyone. */ #define MAX_PASSWORD_LEN 256 #ifndef TCSANOW #define TCSANOW 0 #endif char * nmh_getpass(const char *prompt) { struct termios oterm, term; int ch; char *p; FILE *fout, *fin; static char buf[MAX_PASSWORD_LEN + 1]; int istty = isatty(fileno(stdin)); /* Find if stdin is connect to a terminal. If so, read directly from * the terminal, and turn off echo. Otherwise read from stdin. */ if (!istty || !(fout = fin = fopen("/dev/tty", "w+"))) { fout = stderr; fin = stdin; } else /* Reading directly from terminal here */ { (void)tcgetattr(fileno(fin), &oterm); term = oterm; /* Save original info */ term.c_lflag &= ~ECHO; (void)fputs(prompt, fout); rewind(fout); /* implied flush */ (void)tcsetattr(fileno(fin), TCSANOW, &term); } for (p = buf; (ch = getc(fin)) != EOF && ch != '\n' && p < buf + MAX_PASSWORD_LEN;) *p++ = ch; *p = '\0'; if (istty) { (void)tcsetattr(fileno(fin), TCSANOW, &oterm); rewind(fout); (void)fputc('\n', fout); (void)fclose(fin); } return buf; } nmh-1.5/sbr/lock_file.c000644 007761 000765 00000026731 11762736346 015003 0ustar00kenhkenh000000 000000 /* * lock.c -- routines to lock/unlock files * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ /* Modified by Ruud de Rooij to support Miquel van Smoorenburg's liblockfile * * Since liblockfile locking shares most of its code with dot locking, it * is enabled by defining both DOT_LOCKING and HAVE_LIBLOCKFILE. * * Ruud de Rooij Sun, 28 Mar 1999 15:34:03 +0200 */ #include #include #include #ifdef HAVE_SYS_TIME_H # include #endif #include #include #ifdef HAVE_FCNTL_H # include #else # include #endif #if defined(LOCKF_LOCKING) || defined(FLOCK_LOCKING) # include #endif #include #if defined(HAVE_LIBLOCKFILE) #include #endif #ifdef LOCKDIR char *lockdir = LOCKDIR; #endif /* Are we using any kernel locking? */ #if defined (FLOCK_LOCKING) || defined(LOCKF_LOCKING) || defined(FCNTL_LOCKING) # define KERNEL_LOCKING #endif #ifdef DOT_LOCKING /* struct for getting name of lock file to create */ struct lockinfo { char curlock[BUFSIZ]; #if !defined(HAVE_LIBLOCKFILE) char tmplock[BUFSIZ]; #endif }; /* * Amount of time to wait before * updating ctime of lock file. */ #define NSECS 20 #if !defined(HAVE_LIBLOCKFILE) /* * How old does a lock file need to be * before we remove it. */ #define RSECS 180 #endif /* HAVE_LIBLOCKFILE */ /* struct for recording and updating locks */ struct lock { int l_fd; char *l_lock; struct lock *l_next; }; /* top of list containing all open locks */ static struct lock *l_top = NULL; #endif /* DOT_LOCKING */ /* * static prototypes */ #ifdef KERNEL_LOCKING static int lkopen_kernel (char *, int, mode_t); #endif #ifdef DOT_LOCKING static int lkopen_dot (char *, int, mode_t); static void lockname (char *, struct lockinfo *, int); static void timerON (char *, int); static void timerOFF (int); static void alrmser (int); #if !defined(HAVE_LIBLOCKFILE) static int lockit (struct lockinfo *); #endif #endif /* * Base routine to open and lock a file, * and return a file descriptor. */ int lkopen (char *file, int access, mode_t mode) { #ifdef KERNEL_LOCKING return lkopen_kernel(file, access, mode); #endif #ifdef DOT_LOCKING return lkopen_dot(file, access, mode); #endif } /* * Base routine to close and unlock a file, * given a file descriptor. */ int lkclose (int fd, char *file) { #ifdef FCNTL_LOCKING struct flock buf; #endif #ifdef DOT_LOCKING struct lockinfo lkinfo; #endif if (fd == -1) return 0; #ifdef FCNTL_LOCKING buf.l_type = F_UNLCK; buf.l_whence = SEEK_SET; buf.l_start = 0; buf.l_len = 0; fcntl(fd, F_SETLK, &buf); #endif #ifdef FLOCK_LOCKING flock (fd, LOCK_UN); #endif #ifdef LOCKF_LOCKING /* make sure we unlock the whole thing */ lseek (fd, (off_t) 0, SEEK_SET); lockf (fd, F_ULOCK, 0L); #endif #ifdef DOT_LOCKING lockname (file, &lkinfo, 0); /* get name of lock file */ #if !defined(HAVE_LIBLOCKFILE) unlink (lkinfo.curlock); /* remove lock file */ #else lockfile_remove(lkinfo.curlock); #endif /* HAVE_LIBLOCKFILE */ timerOFF (fd); /* turn off lock timer */ #else /* DOT_LOCKING */ NMH_UNUSED (file); #endif /* DOT_LOCKING */ return (close (fd)); } /* * Base routine to open and lock a file, * and return a FILE pointer */ FILE * lkfopen (char *file, char *mode) { int fd, access; FILE *fp; if (strcmp (mode, "r") == 0) access = O_RDONLY; else if (strcmp (mode, "r+") == 0) access = O_RDWR; else if (strcmp (mode, "w") == 0) access = O_WRONLY | O_CREAT | O_TRUNC; else if (strcmp (mode, "w+") == 0) access = O_RDWR | O_CREAT | O_TRUNC; else if (strcmp (mode, "a") == 0) access = O_WRONLY | O_CREAT | O_APPEND; else if (strcmp (mode, "a+") == 0) access = O_RDWR | O_CREAT | O_APPEND; else { errno = EINVAL; return NULL; } if ((fd = lkopen (file, access, 0666)) == -1) return NULL; if ((fp = fdopen (fd, mode)) == NULL) { close (fd); return NULL; } return fp; } /* * Base routine to close and unlock a file, * given a FILE pointer */ int lkfclose (FILE *fp, char *file) { #ifdef FCNTL_LOCKING struct flock buf; #endif #ifdef DOT_LOCKING struct lockinfo lkinfo; #endif if (fp == NULL) return 0; #ifdef FCNTL_LOCKING buf.l_type = F_UNLCK; buf.l_whence = SEEK_SET; buf.l_start = 0; buf.l_len = 0; fcntl(fileno(fp), F_SETLK, &buf); #endif #ifdef FLOCK_LOCKING flock (fileno(fp), LOCK_UN); #endif #ifdef LOCKF_LOCKING /* make sure we unlock the whole thing */ fseek (fp, 0L, SEEK_SET); lockf (fileno(fp), F_ULOCK, 0L); #endif #ifdef DOT_LOCKING lockname (file, &lkinfo, 0); /* get name of lock file */ #if !defined(HAVE_LIBLOCKFILE) unlink (lkinfo.curlock); /* remove lock file */ #else lockfile_remove(lkinfo.curlock); #endif /* HAVE_LIBLOCKFILE */ timerOFF (fileno(fp)); /* turn off lock timer */ #else /* DOT_LOCKING */ NMH_UNUSED (file); #endif /* DOT_LOCKING */ return (fclose (fp)); } #ifdef KERNEL_LOCKING /* * open and lock a file, using kernel locking */ static int lkopen_kernel (char *file, int access, mode_t mode) { int fd, i, j; # ifdef FCNTL_LOCKING struct flock buf; # endif /* FCNTL_LOCKING */ for (i = 0; i < 5; i++) { # if defined(LOCKF_LOCKING) || defined(FCNTL_LOCKING) /* remember the original mode */ j = access; /* make sure we open at the beginning */ access &= ~O_APPEND; /* * We MUST have write permission or * lockf/fcntl() won't work */ if ((access & 03) == O_RDONLY) { access &= ~O_RDONLY; access |= O_RDWR; } # endif /* LOCKF_LOCKING || FCNTL_LOCKING */ if ((fd = open (file, access | O_NDELAY, mode)) == -1) return -1; # ifdef FCNTL_LOCKING buf.l_type = F_WRLCK; buf.l_whence = SEEK_SET; buf.l_start = 0; buf.l_len = 0; if (fcntl (fd, F_SETLK, &buf) != -1) return fd; # endif # ifdef FLOCK_LOCKING if (flock (fd, (((access & 03) == O_RDONLY) ? LOCK_SH : LOCK_EX) | LOCK_NB) != -1) return fd; # endif # ifdef LOCKF_LOCKING if (lockf (fd, F_TLOCK, 0L) != -1) { /* see if we should be at the end */ if (j & O_APPEND) lseek (fd, (off_t) 0, SEEK_END); return fd; } # endif j = errno; close (fd); sleep (5); } close (fd); errno = j; return -1; } #endif /* KERNEL_LOCKING */ #ifdef DOT_LOCKING /* * open and lock a file, using dot locking */ static int lkopen_dot (char *file, int access, mode_t mode) { int fd; struct lockinfo lkinfo; /* open the file */ if ((fd = open (file, access, mode)) == -1) return -1; /* * Get the name of the eventual lock file, as well * as a name for a temporary lock file. */ lockname (file, &lkinfo, 1); #if !defined(HAVE_LIBLOCKFILE) { int i; for (i = 0;;) { /* attempt to create lock file */ if (lockit (&lkinfo) == 0) { /* if successful, turn on timer and return */ timerON (lkinfo.curlock, fd); return fd; } else { /* * Abort locking, if we fail to lock after 5 attempts * and are never able to stat the lock file. */ struct stat st; if (stat (lkinfo.curlock, &st) == -1) { if (i++ > 5) return -1; sleep (5); } else { time_t curtime; i = 0; time (&curtime); /* check for stale lockfile, else sleep */ if (curtime > st.st_ctime + RSECS) unlink (lkinfo.curlock); else sleep (5); } lockname (file, &lkinfo, 1); } } } #else if (lockfile_create(lkinfo.curlock, 5, 0) == L_SUCCESS) { timerON(lkinfo.curlock, fd); return fd; } else { close(fd); return -1; } #endif /* HAVE_LIBLOCKFILE */ } #if !defined(HAVE_LIBLOCKFILE) /* * Routine that actually tries to create * the lock file. */ static int lockit (struct lockinfo *li) { int fd; char *curlock, *tmplock; #if 0 char buffer[128]; #endif curlock = li->curlock; tmplock = li->tmplock; if ((fd = mkstemp(tmplock)) == -1) return -1; #if 0 /* write our process id into lock file */ snprintf (buffer, sizeof(buffer), "nmh lock: pid %d\n", (int) getpid()); write(fd, buffer, strlen(buffer) + 1); #endif close (fd); /* * Now try to create the real lock file * by linking to the temporary file. */ fd = link(tmplock, curlock); unlink(tmplock); return (fd == -1 ? -1 : 0); } #endif /* HAVE_LIBLOCKFILE */ /* * Get name of lock file, and temporary lock file */ static void lockname (char *file, struct lockinfo *li, int isnewlock) { int bplen, tmplen; char *bp, *cp; #if 0 struct stat st; #endif if ((cp = strrchr (file, '/')) == NULL || *++cp == 0) cp = file; bp = li->curlock; bplen = 0; #ifdef LOCKDIR snprintf (bp, sizeof(li->curlock), "%s/", lockdir); tmplen = strlen (bp); bp += tmplen; bplen += tmplen; #else if (cp != file) { snprintf (bp, sizeof(li->curlock), "%.*s", (int)(cp - file), file); tmplen = strlen (bp); bp += tmplen; bplen += tmplen; } #endif #if 0 /* * mmdf style dot locking. Currently not supported. * If we start supporting mmdf style dot locking, * we will need to change the return value of lockname */ if (stat (file, &st) == -1) return -1; snprintf (bp, sizeof(li->curlock) - bplen, "LCK%05d.%05d", st.st_dev, st.st_ino); #endif snprintf (bp, sizeof(li->curlock) - bplen, "%s.lock", cp); #if !defined(HAVE_LIBLOCKFILE) /* * If this is for a new lock, create a name for * the temporary lock file for lockit() */ if (isnewlock) { if ((cp = strrchr (li->curlock, '/')) == NULL || *++cp == 0) strncpy (li->tmplock, ",LCK.XXXXXX", sizeof(li->tmplock)); else snprintf (li->tmplock, sizeof(li->tmplock), "%.*s,LCK.XXXXXX", (int)(cp - li->curlock), li->curlock); } #endif } /* * Add new lockfile to the list of open lockfiles * and start the lock file timer. */ static void timerON (char *curlock, int fd) { struct lock *lp; size_t len; lp = (struct lock *) mh_xmalloc (sizeof(*lp)); len = strlen(curlock) + 1; lp->l_fd = fd; lp->l_lock = mh_xmalloc (len); memcpy (lp->l_lock, curlock, len); lp->l_next = l_top; if (!l_top) { /* perhaps SIGT{STP,TIN,TOU} ? */ SIGNAL (SIGALRM, alrmser); alarm (NSECS); } l_top = lp; } /* * Search through the list of lockfiles for the * current lockfile, and remove it from the list. */ static void timerOFF (int fd) { struct lock *pp, *lp; alarm(0); if (l_top) { for (pp = lp = l_top; lp; pp = lp, lp = lp->l_next) { if (lp->l_fd == fd) break; } if (lp) { if (lp == l_top) l_top = lp->l_next; else pp->l_next = lp->l_next; free (lp->l_lock); free (lp); } } /* if there are locks left, restart timer */ if (l_top) alarm (NSECS); } /* * If timer goes off, we update the ctime of all open * lockfiles, so another command doesn't remove them. */ static void alrmser (int sig) { char *lockfile; struct lock *lp; NMH_UNUSED (sig); /* update the ctime of all the lock files */ for (lp = l_top; lp; lp = lp->l_next) { lockfile = lp->l_lock; #if !defined(HAVE_LIBLOCKFILE) { int j; if (*lockfile && (j = creat (lockfile, 0600)) != -1) close (j); } #else lockfile_touch(lockfile); #endif } /* restart the alarm */ alarm (NSECS); } #endif /* DOT_LOCKING */ nmh-1.5/sbr/m_atoi.c000644 007761 000765 00000001214 11713401274 014272 0ustar00kenhkenh000000 000000 /* * m_atoi.c -- Parse a string representation of a message number, and * -- return the numeric value of the message. If the string * -- contains any non-digit characters, then return 0. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int m_atoi (char *str) { int i; unsigned char *cp; for (i = 0, cp = str; *cp; cp++) { #ifdef LOCALE if (!isdigit(*cp)) #else if (*cp < '0' || *cp > '9') #endif return 0; i *= 10; i += (*cp - '0'); } return i; } nmh-1.5/sbr/m_backup.c000644 007761 000765 00000001075 11713401274 014610 0ustar00kenhkenh000000 000000 /* * m_backup.c -- construct a backup file * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char * m_backup (char *file) { char *cp; static char buffer[BUFSIZ]; if ((cp = r1bindex(file, '/')) == file) snprintf(buffer, sizeof(buffer), "%s%s", BACKUP_PREFIX, cp); else snprintf(buffer, sizeof(buffer), "%.*s%s%s", (int)(cp - file), file, BACKUP_PREFIX, cp); unlink(buffer); return buffer; } nmh-1.5/sbr/m_convert.c000644 007761 000765 00000021400 11762736346 015034 0ustar00kenhkenh000000 000000 /* * m_convert.c -- parse a message range or sequence and set SELECTED * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * error codes for sequence * and message range processing */ #define BADMSG (-2) #define BADRNG (-3) #define BADNEW (-4) #define BADNUM (-5) #define BADLST (-6) #define FIRST 1 #define LAST 2 #define getnew(mp) (mp->hghmsg + 1) static int convdir; /* convert direction */ static char *delimp; /* * static prototypes */ static int m_conv (struct msgs *, char *, int); static int attr (struct msgs *, char *); int m_convert (struct msgs *mp, char *name) { int first, last, found, range, err; unsigned char *bp; char *cp; /* check if user defined sequence */ err = attr (mp, cp = name); if (err == -1) return 0; else if (err < 0) goto badmsg; else if (err > 0) return 1; /* * else err == 0, so continue */ found = 0; /* * Check for special "new" sequence, which * is valid only if ALLOW_NEW is set. */ if ((mp->msgflags & ALLOW_NEW) && !strcmp (cp, "new")) { if ((err = first = getnew (mp)) <= 0) goto badmsg; else goto single; } if (!strcmp (cp, "all")) cp = "first-last"; if ((err = first = m_conv (mp, cp, FIRST)) <= 0) goto badmsg; cp = delimp; if (*cp != '\0' && *cp != '-' && *cp != ':') { badelim: advise (NULL, "illegal argument delimiter: `%c'(0%o)", *delimp, *delimp); return 0; } if (*cp == '-') { cp++; if ((err = last = m_conv (mp, cp, LAST)) <= 0) { badmsg: switch (err) { case BADMSG: advise (NULL, "no %s message", cp); break; case BADNUM: advise (NULL, "message %s doesn't exist", cp); break; case BADRNG: advise (NULL, "message %s out of range 1-%d", cp, mp->hghmsg); break; case BADLST: badlist: advise (NULL, "bad message list %s", name); break; case BADNEW: advise (NULL, "folder full, no %s message", name); break; default: advise (NULL, "no messages match specification"); } return 0; } if (last < first) goto badlist; if (*delimp) goto badelim; if (first > mp->hghmsg || last < mp->lowmsg) { rangerr: advise (NULL, "no messages in range %s", name); return 0; } /* tighten the range to search */ if (last > mp->hghmsg) last = mp->hghmsg; if (first < mp->lowmsg) first = mp->lowmsg; } else if (*cp == ':') { cp++; if (*cp == '-') { convdir = -1; cp++; } else { if (*cp == '+') { convdir = 1; cp++; } } if ((range = atoi (bp = cp)) == 0) goto badlist; while (isdigit (*bp)) bp++; if (*bp) goto badelim; if ((convdir > 0 && first > mp->hghmsg) || (convdir < 0 && first < mp->lowmsg)) goto rangerr; /* tighten the range to search */ if (first < mp->lowmsg) first = mp->lowmsg; if (first > mp->hghmsg) first = mp->hghmsg; for (last = first; last >= mp->lowmsg && last <= mp->hghmsg; last += convdir) if (does_exist (mp, last)) if (--range <= 0) break; if (last < mp->lowmsg) last = mp->lowmsg; if (last > mp->hghmsg) last = mp->hghmsg; if (last < first) { range = last; last = first; first = range; } } else { single: /* * Single Message * * If ALLOW_NEW is set, then allow selecting of an * empty slot. If ALLOW_NEW is not set, then we * check if message is in-range and exists. */ if (mp->msgflags & ALLOW_NEW) { set_select_empty (mp, first); } else { if (first > mp->hghmsg || first < mp->lowmsg || !(does_exist (mp, first))) { if (!strcmp (name, "cur") || !strcmp (name, ".")) advise (NULL, "no %s message", name); else advise (NULL, "message %d doesn't exist", first); return 0; } } last = first; /* range of 1 */ } /* * Cycle through the range and select the messages * that exist. If ALLOW_NEW is set, then we also check * if we are selecting an empty slot. */ for (; first <= last; first++) { if (does_exist (mp, first) || ((mp->msgflags & ALLOW_NEW) && is_select_empty (mp, first))) { if (!is_selected (mp, first)) { set_selected (mp, first); mp->numsel++; if (mp->lowsel == 0 || first < mp->lowsel) mp->lowsel = first; if (first > mp->hghsel) mp->hghsel = first; } found++; } } if (!found) goto rangerr; return 1; } /* * Convert the various message names to * their numeric values. * * n (integer) * prev * next * first * last * cur * . (same as cur) */ static int m_conv (struct msgs *mp, char *str, int call) { register int i; register unsigned char *cp, *bp; unsigned char buf[16]; convdir = 1; cp = bp = str; if (isdigit (*cp)) { while (isdigit (*bp)) bp++; delimp = bp; i = atoi (cp); if (i <= mp->hghmsg) return i; else if (*delimp || call == LAST) return mp->hghmsg + 1; else if (mp->msgflags & ALLOW_NEW) return BADRNG; else return BADNUM; } #ifdef LOCALE /* doesn't enforce lower case */ for (bp = buf; (isalpha(*cp) || *cp == '.') && (bp - buf < (int) sizeof(buf) - 1); ) #else for (bp = buf; ((*cp >= 'a' && *cp <= 'z') || *cp == '.') && (bp - buf < (int) sizeof(buf) - 1); ) #endif /* LOCALE */ { *bp++ = *cp++; } *bp++ = '\0'; delimp = cp; if (!strcmp (buf, "first")) return (mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? mp->lowmsg : BADMSG); if (!strcmp (buf, "last")) { convdir = -1; return (mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? mp->hghmsg : BADMSG); } if (!strcmp (buf, "cur") || !strcmp (buf, ".")) return (mp->curmsg > 0 ? mp->curmsg : BADMSG); if (!strcmp (buf, "prev")) { convdir = -1; for (i = (mp->curmsg <= mp->hghmsg) ? mp->curmsg - 1 : mp->hghmsg; i >= mp->lowmsg; i--) { if (does_exist (mp, i)) return i; } return BADMSG; } if (!strcmp (buf, "next")) { for (i = (mp->curmsg >= mp->lowmsg) ? mp->curmsg + 1 : mp->lowmsg; i <= mp->hghmsg; i++) { if (does_exist (mp, i)) return i; } return BADMSG; } return BADLST; } /* * Handle user defined sequences. * They can take the following forms: * * seq * seq:prev * seq:next * seq:first * seq:last * seq:+n * seq:-n * seq:n */ static int attr (struct msgs *mp, char *cp) { register unsigned char *dp; char *bp = NULL; register int i, j; int found, inverted = 0, range = 0, /* no range */ first = 0; /* hack for "cur-name", "cur-n", etc. */ if (!strcmp (cp, "cur")) return 0; if (ssequal ("cur:", cp)) /* this code need to be rewritten... */ return 0; /* Check for sequence negation */ if ((dp = context_find (nsequence)) && *dp != '\0' && ssequal (dp, cp)) { inverted = 1; cp += strlen (dp); } convdir = 1; /* convert direction */ for (dp = cp; *dp && isalnum(*dp); dp++) continue; if (*dp == ':') { bp = dp++; range = 1; /* * seq:prev (or) * seq:next (or) * seq:first (or) * seq:last */ if (isalpha (*dp)) { if (!strcmp (dp, "prev")) { convdir = -1; first = (mp->curmsg > 0) && (mp->curmsg <= mp->hghmsg) ? mp->curmsg - 1 : mp->hghmsg; } else if (!strcmp (dp, "next")) { convdir = 1; first = (mp->curmsg >= mp->lowmsg) ? mp->curmsg + 1 : mp->lowmsg; } else if (!strcmp (dp, "first")) { convdir = 1; } else if (!strcmp (dp, "last")) { convdir = -1; } else return BADLST; } else { /* * seq:n (or) * seq:+n (or) * seq:-n */ if (*dp == '+') dp++; else if (*dp == '-') { dp++; convdir = -1; } if ((range = atoi(dp)) == 0) return BADLST; while (isdigit (*dp)) dp++; if (*dp) return BADLST; } *bp = '\0'; /* temporarily terminate sequence name */ } i = seq_getnum (mp, cp); /* get index of sequence */ if (bp) *bp = ':'; /* restore sequence name */ if (i == -1) return 0; found = 0; /* count the number we select for this argument */ for (j = first ? first : (convdir > 0) ? mp->lowmsg : mp->hghmsg; j >= mp->lowmsg && j <= mp->hghmsg; j += convdir) { if (does_exist (mp, j) && inverted ? !in_sequence (mp, i, j) : in_sequence (mp, i, j)) { if (!is_selected (mp, j)) { set_selected (mp, j); mp->numsel++; if (mp->lowsel == 0 || j < mp->lowsel) mp->lowsel = j; if (j > mp->hghsel) mp->hghsel = j; } found++; /* * If we have a range, then break out * once we've found enough. */ if (range && found >= range) break; } } if (found > 0) return found; if (first) return BADMSG; advise (NULL, "sequence %s %s", cp, inverted ? "full" : "empty"); return -1; } nmh-1.5/sbr/m_draft.c000644 007761 000765 00000004461 11713401274 014445 0ustar00kenhkenh000000 000000 /* * m_draft.c -- construct the name of a draft message * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include char * m_draft (char *folder, char *msg, int use, int *isdf) { register char *cp; register struct msgs *mp; static char buffer[BUFSIZ]; if (*isdf == -1 || folder == NULL || *folder == '\0') { if (*isdf == -1 || (cp = context_find ("Draft-Folder")) == NULL) { *isdf = 0; return m_maildir (msg && *msg ? msg : draft); } else { folder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); } } *isdf = 1; chdir (m_maildir ("")); strncpy (buffer, m_maildir (folder), sizeof(buffer)); create_folder (buffer, 0, done); if (chdir (buffer) == -1) adios (buffer, "unable to change directory to"); if (!(mp = folder_read (folder))) adios (NULL, "unable to read folder %s", folder); /* * Make sure we have enough message status space for all * the message numbers from 1 to "new", since we might * select an empty slot. If we add more space at the * end, go ahead and add 10 additional slots. */ if (mp->hghmsg >= mp->hghoff) { if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10))) adios (NULL, "unable to allocate folder storage"); } else if (mp->lowoff > 1) { if (!(mp = folder_realloc (mp, 1, mp->hghoff))) adios (NULL, "unable to allocate folder storage"); } mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */ /* * If we have been give a valid message name, then use that. * Else, if we are given the "use" option, then use the * current message. Else, use special sequence "new". */ if (!m_convert (mp, msg && *msg ? msg : use ? "cur" : "new")) done (1); seq_setprev (mp); if (mp->numsel > 1) adios (NULL, "only one message draft at a time!"); snprintf (buffer, sizeof(buffer), "%s/%s", mp->foldpath, m_name (mp->lowsel)); cp = buffer; seq_setcur (mp, mp->lowsel);/* set current message for folder */ seq_save (mp); /* synchronize message sequences */ folder_free (mp); /* free folder/message structure */ return cp; } nmh-1.5/sbr/m_getfld.c000644 007761 000765 00000056315 11762736346 014636 0ustar00kenhkenh000000 000000 /* * m_getfld.c -- read/parse a message * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include /* This module has a long and checkered history. First, it didn't burst maildrops correctly because it considered two CTRL-A:s in a row to be an inter-message delimiter. It really is four CTRL-A:s followed by a newline. Unfortunately, MMDF will convert this delimiter *inside* a message to a CTRL-B followed by three CTRL-A:s and a newline. This caused the old version of m_getfld() to declare eom prematurely. The fix was a lot slower than c == '\001' && peekc (iob) == '\001' but it worked, and to increase generality, MBOX style maildrops could be parsed as well. Unfortunately the speed issue finally caught up with us since this routine is at the very heart of MH. To speed things up considerably, the routine Eom() was made an auxilary function called by the macro eom(). Unless we are bursting a maildrop, the eom() macro returns FALSE saying we aren't at the end of the message. The next thing to do is to read the mts.conf file and initialize delimiter[] and delimlen accordingly... After mhl was made a built-in in msh, m_getfld() worked just fine (using m_unknown() at startup). Until one day: a message which was the result of a bursting was shown. Then, since the burst boundaries aren't CTRL-A:s, m_getfld() would blinding plunge on past the boundary. Very sad. The solution: introduce m_eomsbr(). This hook gets called after the end of each line (since testing for eom involves an fseek()). This worked fine, until one day: a message with no body portion arrived. Then the while (eom (c = Getc (iob), iob)) continue; loop caused m_getfld() to return FMTERR. So, that logic was changed to check for (*eom_action) and act accordingly. This worked fine, until one day: someone didn't use four CTRL:A's as their delimiters. So, the bullet got bit and we read mts.h and continue to struggle on. It's not that bad though, since the only time the code gets executed is when inc (or msh) calls it, and both of these have already called mts_init(). ------------------------ (Written by Van Jacobson for the mh6 m_getfld, January, 1986): This routine was accounting for 60% of the cpu time used by most mh programs. I spent a bit of time tuning and it now accounts for <10% of the time used. Like any heavily tuned routine, it's a bit complex and you want to be sure you understand everything that it's doing before you start hacking on it. Let me try to emphasize that: every line in this atrocity depends on every other line, sometimes in subtle ways. You should understand it all, in detail, before trying to change any part. If you do change it, test the result thoroughly (I use a hand-constructed test file that exercises all the ways a header name, header body, header continuation, header-body separator, body line and body eom can align themselves with respect to a buffer boundary). "Minor" bugs in this routine result in garbaged or lost mail. If you hack on this and slow it down, I, my children and my children's children will curse you. This routine gets used on three different types of files: normal, single msg files, "packed" unix or mmdf mailboxs (when used by inc) and packed, directoried bulletin board files (when used by msh). The biggest impact of different file types is in "eom" testing. The code has been carefully organized to test for eom at appropriate times and at no other times (since the check is quite expensive). I have tried to arrange things so that the eom check need only be done on entry to this routine. Since an eom can only occur after a newline, this is easy to manage for header fields. For the msg body, we try to efficiently search the input buffer to see if contains the eom delimiter. If it does, we take up to the delimiter, otherwise we take everything in the buffer. (The change to the body eom/copy processing produced the most noticeable performance difference, particularly for "inc" and "show".) There are three qualitatively different things this routine busts out of a message: field names, field text and msg bodies. Field names are typically short (~8 char) and the loop that extracts them might terminate on a colon, newline or max width. I considered using a Vax "scanc" to locate the end of the field followed by a "bcopy" but the routine call overhead on a Vax is too large for this to work on short names. If Berkeley ever makes "inline" part of the C optimiser (so things like "scanc" turn into inline instructions) a change here would be worthwhile. Field text is typically 60 - 100 characters so there's (barely) a win in doing a routine call to something that does a "locc" followed by a "bmove". About 30% of the fields have continuations (usually the 822 "received:" lines) and each continuation generates another routine call. "Inline" would be a big win here, as well. Messages, as of this writing, seem to come in two flavors: small (~1K) and long (>2K). Most messages have 400 - 600 bytes of headers so message bodies average at least a few hundred characters. Assuming your system uses reasonably sized stdio buffers (1K or more), this routine should be able to remove the body in large (>500 byte) chunks. The makes the cost of a call to "bcopy" small but there is a premium on checking for the eom in packed maildrops. The eom pattern is always a simple string so we can construct an efficient pattern matcher for it (e.g., a Vax "matchc" instruction). Some thought went into recognizing the start of an eom that has been split across two buffers. This routine wants to deal with large chunks of data so, rather than "getc" into a local buffer, it uses stdio's buffer. If you try to use it on a non-buffered file, you'll get what you deserve. This routine "knows" that struct FILEs have a _ptr and a _cnt to describe the current state of the buffer and it knows that _filbuf ignores the _ptr & _cnt and simply fills the buffer. If stdio on your system doesn't work this way, you may have to make small changes in this routine. This routine also "knows" that an EOF indication on a stream is "sticky" (i.e., you will keep getting EOF until you reposition the stream). If your system doesn't work this way it is broken and you should complain to the vendor. As a consequence of the sticky EOF, this routine will never return any kind of EOF status when there is data in "name" or "buf"). */ /* * static prototypes */ static int m_Eom (int, FILE *); static unsigned char *matchc(int, char *, int, char *); static unsigned char *locc(int, unsigned char *, unsigned char); #define Getc(iob) getc(iob) #define eom(c,iob) (msg_style != MS_DEFAULT && \ (((c) == *msg_delim && m_Eom(c,iob)) ||\ (eom_action && (*eom_action)(c)))) static unsigned char **pat_map; /* * defined in sbr/m_msgdef.c = 0 * This is a disgusting hack for "inc" so it can know how many * characters were stuffed in the buffer on the last call * (see comments in uip/scansbr.c). */ extern int msg_count; /* * defined in sbr/m_msgdef.c = MS_DEFAULT */ extern int msg_style; /* * The "full" delimiter string for a packed maildrop consists * of a newline followed by the actual delimiter. E.g., the * full string for a Unix maildrop would be: "\n\nFrom ". * "Fdelim" points to the start of the full string and is used * in the BODY case of the main routine to search the buffer for * a possible eom. Msg_delim points to the first character of * the actual delim. string (i.e., fdelim+1). Edelim * points to the 2nd character of actual delimiter string. It * is used in m_Eom because the first character of the string * has been read and matched before m_Eom is called. */ extern char *msg_delim; /* defined in sbr/m_msgdef.c = "" */ static unsigned char *fdelim; static unsigned char *delimend; static int fdelimlen; static unsigned char *edelim; static int edelimlen; static int (*eom_action)(int) = NULL; #ifdef _FSTDIO # define _ptr _p /* Gag */ # define _cnt _r /* Retch */ # define _filbuf __srget /* Puke */ # define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC # if defined __CYGWIN__ /* Cygwin's stdio.h does not declare __srget(). */ int __srget(FILE *); # endif /* __CYGWIN__ */ #endif #ifndef DEFINED__FILBUF_TO_SOMETHING_SPECIFIC extern int _filbuf(FILE*); #endif int m_getfld (int state, unsigned char *name, unsigned char *buf, int bufsz, FILE *iob) { register unsigned char *bp, *cp, *ep, *sp; register int cnt, c, i, j; if ((c = Getc(iob)) < 0) { msg_count = 0; *buf = 0; return FILEEOF; } if (eom (c, iob)) { if (! eom_action) { /* flush null messages */ while ((c = Getc(iob)) >= 0 && eom (c, iob)) ; if (c >= 0) ungetc(c, iob); } msg_count = 0; *buf = 0; return FILEEOF; } switch (state) { case FLDEOF: case BODYEOF: case FLD: if (c == '\n' || c == '-') { /* we hit the header/body separator */ while (c != '\n' && (c = Getc(iob)) >= 0) ; if (c < 0 || (c = Getc(iob)) < 0 || eom (c, iob)) { if (! eom_action) { /* flush null messages */ while ((c = Getc(iob)) >= 0 && eom (c, iob)) ; if (c >= 0) ungetc(c, iob); } msg_count = 0; *buf = 0; return FILEEOF; } state = BODY; goto body; } /* * get the name of this component. take characters up * to a ':', a newline or NAMESZ-1 characters, whichever * comes first. */ cp = name; i = NAMESZ - 1; for (;;) { #ifdef LINUX_STDIO bp = sp = (unsigned char *) iob->_IO_read_ptr - 1; j = (cnt = ((long) iob->_IO_read_end - (long) iob->_IO_read_ptr) + 1) < i ? cnt : i; #elif defined(__DragonFly__) bp = sp = (unsigned char *) ((struct __FILE_public *)iob)->_p - 1; j = (cnt = ((struct __FILE_public *)iob)->_r+1) < i ? cnt : i; #else bp = sp = (unsigned char *) iob->_ptr - 1; j = (cnt = iob->_cnt+1) < i ? cnt : i; #endif while (--j >= 0 && (c = *bp++) != ':' && c != '\n') *cp++ = c; j = bp - sp; if ((cnt -= j) <= 0) { #ifdef LINUX_STDIO iob->_IO_read_ptr = iob->_IO_read_end; if (__underflow(iob) == EOF) { #elif defined(__DragonFly__) if (__srget(iob) == EOF) { #else if (_filbuf(iob) == EOF) { #endif *cp = *buf = 0; advise (NULL, "eof encountered in field \"%s\"", name); return FMTERR; } #ifdef LINUX_STDIO iob->_IO_read_ptr++; /* NOT automatic in __underflow()! */ #endif } else { #ifdef LINUX_STDIO iob->_IO_read_ptr = bp + 1; #elif defined(__DragonFly__) ((struct __FILE_public *)iob)->_p = bp + 1; ((struct __FILE_public *)iob)->_r = cnt - 1; #else iob->_ptr = bp + 1; iob->_cnt = cnt - 1; #endif } if (c == ':') break; /* * something went wrong. possibilities are: * . hit a newline (error) * . got more than namesz chars. (error) * . hit the end of the buffer. (loop) */ if (c == '\n') { /* We hit the end of the line without seeing ':' to * terminate the field name. This is usually (always?) * spam. But, blowing up is lame, especially when * scan(1)ing a folder with such messages. Pretend such * lines are the first of the body (at least mutt also * handles it this way). */ /* See if buf can hold this line, since we were assuming * we had a buffer of NAMESZ, not bufsz. */ /* + 1 for the newline */ if (bufsz < j + 1) { /* No, it can't. Oh well, guess we'll blow up. */ *cp = *buf = 0; advise (NULL, "eol encountered in field \"%s\"", name); state = FMTERR; goto finish; } memcpy (buf, name, j - 1); buf[j - 1] = '\n'; buf[j] = '\0'; /* mhparse.c:get_content wants to find the position of the * body start, but it thinks there's a blank line between * the header and the body (naturally!), so seek back so * that things line up even though we don't have that * blank line in this case. Simpler parsers (e.g. mhl) * get extra newlines, but that should be harmless enough, * right? This is a corrupt message anyway. */ fseek (iob, ftell (iob) - 2, SEEK_SET); return BODY; } if ((i -= j) <= 0) { *cp = *buf = 0; advise (NULL, "field name \"%s\" exceeds %d bytes", name, NAMESZ - 2); state = LENERR; goto finish; } } while (isspace (*--cp) && cp >= name) ; *++cp = 0; /* fall through */ case FLDPLUS: /* * get (more of) the text of a field. take * characters up to the end of this field (newline * followed by non-blank) or bufsz-1 characters. */ cp = buf; i = bufsz-1; for (;;) { #ifdef LINUX_STDIO cnt = (long) iob->_IO_read_end - (long) iob->_IO_read_ptr; bp = (unsigned char *) --iob->_IO_read_ptr; #elif defined(__DragonFly__) cnt = ((struct __FILE_public *)iob)->_r++; bp = (unsigned char *) --((struct __FILE_public *)iob)->_p; #else cnt = iob->_cnt++; bp = (unsigned char *) --iob->_ptr; #endif c = cnt < i ? cnt : i; while ((ep = locc( c, bp, '\n' ))) { /* * if we hit the end of this field, return. */ if ((j = *++ep) != ' ' && j != '\t') { #ifdef LINUX_STDIO j = ep - (unsigned char *) iob->_IO_read_ptr; memcpy (cp, iob->_IO_read_ptr, j); iob->_IO_read_ptr = ep; #elif defined(__DragonFly__) j = ep - (unsigned char *) ((struct __FILE_public *)iob)->_p; memcpy (cp, ((struct __FILE_public *)iob)->_p, j); ((struct __FILE_public *)iob)->_p = ep; ((struct __FILE_public *)iob)->_r -= j; #else j = ep - (unsigned char *) iob->_ptr; memcpy (cp, iob->_ptr, j); iob->_ptr = ep; iob->_cnt -= j; #endif cp += j; state = FLD; goto finish; } c -= ep - bp; bp = ep; } /* * end of input or dest buffer - copy what we've found. */ #ifdef LINUX_STDIO c += bp - (unsigned char *) iob->_IO_read_ptr; memcpy( cp, iob->_IO_read_ptr, c); #elif defined(__DragonFly__) c += bp - (unsigned char *) ((struct __FILE_public *)iob)->_p; memcpy( cp, ((struct __FILE_public *)iob)->_p, c); #else c += bp - (unsigned char *) iob->_ptr; memcpy( cp, iob->_ptr, c); #endif i -= c; cp += c; if (i <= 0) { /* the dest buffer is full */ #ifdef LINUX_STDIO iob->_IO_read_ptr += c; #elif defined(__DragonFly__) ((struct __FILE_public *)iob)->_r -= c; ((struct __FILE_public *)iob)->_p += c; #else iob->_cnt -= c; iob->_ptr += c; #endif state = FLDPLUS; break; } /* * There's one character left in the input buffer. * Copy it & fill the buffer. If the last char * was a newline and the next char is not whitespace, * this is the end of the field. Otherwise loop. */ --i; #ifdef LINUX_STDIO *cp++ = j = *(iob->_IO_read_ptr + c); iob->_IO_read_ptr = iob->_IO_read_end; c = __underflow(iob); iob->_IO_read_ptr++; /* NOT automatic! */ #elif defined(__DragonFly__) *cp++ =j = *(((struct __FILE_public *)iob)->_p + c); c = __srget(iob); #else *cp++ = j = *(iob->_ptr + c); c = _filbuf(iob); #endif if (c == EOF || ((j == '\0' || j == '\n') && c != ' ' && c != '\t')) { if (c != EOF) { #ifdef LINUX_STDIO --iob->_IO_read_ptr; #elif defined(__DragonFly__) --((struct __FILE_public *)iob)->_p; ++((struct __FILE_public *)iob)->_r; #else --iob->_ptr; ++iob->_cnt; #endif } state = FLD; break; } } break; case BODY: body: /* * get the message body up to bufsz characters or the * end of the message. Sleazy hack: if bufsz is negative * we assume that we were called to copy directly into * the output buffer and we don't add an eos. */ i = (bufsz < 0) ? -bufsz : bufsz-1; #ifdef LINUX_STDIO bp = (unsigned char *) --iob->_IO_read_ptr; cnt = (long) iob->_IO_read_end - (long) iob->_IO_read_ptr; #elif defined(__DragonFly__) bp = (unsigned char *) --((struct __FILE_public *)iob)->_p; cnt = ++((struct __FILE_public *)iob)->_r; #else bp = (unsigned char *) --iob->_ptr; cnt = ++iob->_cnt; #endif c = (cnt < i ? cnt : i); if (msg_style != MS_DEFAULT && c > 1) { /* * packed maildrop - only take up to the (possible) * start of the next message. This "matchc" should * probably be a Boyer-Moore matcher for non-vaxen, * particularly since we have the alignment table * all built for the end-of-buffer test (next). * But our vax timings indicate that the "matchc" * instruction is 50% faster than a carefully coded * B.M. matcher for most strings. (So much for elegant * algorithms vs. brute force.) Since I (currently) * run MH on a vax, we use the matchc instruction. --vj */ if ((ep = matchc( fdelimlen, fdelim, c, bp ))) c = ep - bp + 1; else { /* * There's no delim in the buffer but there may be * a partial one at the end. If so, we want to leave * it so the "eom" check on the next call picks it up. * Use a modified Boyer-Moore matcher to make this * check relatively cheap. The first "if" figures * out what position in the pattern matches the last * character in the buffer. The inner "while" matches * the pattern against the buffer, backwards starting * at that position. Note that unless the buffer * ends with one of the characters in the pattern * (excluding the first and last), we do only one test. */ ep = bp + c - 1; if ((sp = pat_map[*ep])) { do { /* This if() is true unless (a) the buffer is too * small to contain this delimiter prefix, or * (b) it contains exactly enough chars for the * delimiter prefix. * For case (a) obviously we aren't going to match. * For case (b), if the buffer really contained exactly * a delim prefix, then the m_eom call at entry * should have found it. Thus it's not a delim * and we know we won't get a match. */ if (((sp - fdelim) + 2) <= c) { cp = sp; /* Unfortunately although fdelim has a preceding NUL * we can't use this as a sentinel in case the buffer * contains a NUL in exactly the wrong place (this * would cause us to run off the front of fdelim). */ while (*--ep == *--cp) if (cp < fdelim) break; if (cp < fdelim) { /* we matched the entire delim prefix, * so only take the buffer up to there. * we know ep >= bp -- check above prevents underrun */ c = (ep - bp) + 2; break; } } /* try matching one less char of delim string */ ep = bp + c - 1; } while (--sp > fdelim); } } } memcpy( buf, bp, c ); #ifdef LINUX_STDIO iob->_IO_read_ptr += c; #elif defined(__DragonFly__) ((struct __FILE_public *)iob)->_r -= c; ((struct __FILE_public *)iob)->_p += c; #else iob->_cnt -= c; iob->_ptr += c; #endif if (bufsz < 0) { msg_count = c; return (state); } cp = buf + c; break; default: adios (NULL, "m_getfld() called with bogus state of %d", state); } finish: *cp = 0; msg_count = cp - buf; return (state); } void m_unknown(FILE *iob) { register int c; register long pos; char text[10]; register char *cp; register char *delimstr; /* * Figure out what the message delimitter string is for this * maildrop. (This used to be part of m_Eom but I didn't like * the idea of an "if" statement that could only succeed on the * first call to m_Eom getting executed on each call, i.e., at * every newline in the message). * * If the first line of the maildrop is a Unix "From " line, we * say the style is MBOX and eat the rest of the line. Otherwise * we say the style is MMDF and look for the delimiter string * specified when nmh was built (or from the mts.conf file). */ msg_style = MS_UNKNOWN; pos = ftell (iob); if (fread (text, sizeof(*text), 5, iob) == 5 && strncmp (text, "From ", 5) == 0) { msg_style = MS_MBOX; delimstr = "\nFrom "; while ((c = getc (iob)) != '\n' && c >= 0) ; } else { /* not a Unix style maildrop */ fseek (iob, pos, SEEK_SET); if (mmdlm2 == NULL || *mmdlm2 == 0) mmdlm2 = "\001\001\001\001\n"; delimstr = mmdlm2; msg_style = MS_MMDF; } c = strlen (delimstr); fdelim = (unsigned char *) mh_xmalloc((size_t) (c + 3)); *fdelim++ = '\0'; *fdelim = '\n'; msg_delim = (char *)fdelim+1; edelim = (unsigned char *)msg_delim+1; fdelimlen = c + 1; edelimlen = c - 1; strcpy (msg_delim, delimstr); delimend = (unsigned char *)msg_delim + edelimlen; if (edelimlen <= 1) adios (NULL, "maildrop delimiter must be at least 2 bytes"); /* * build a Boyer-Moore end-position map for the matcher in m_getfld. * N.B. - we don't match just the first char (since it's the newline * separator) or the last char (since the matchc would have found it * if it was a real delim). */ pat_map = (unsigned char **) calloc (256, sizeof(unsigned char *)); for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ ) pat_map[(unsigned char)*cp] = (unsigned char *) cp; if (msg_style == MS_MMDF) { /* flush extra msg hdrs */ while ((c = Getc(iob)) >= 0 && eom (c, iob)) ; if (c >= 0) ungetc(c, iob); } } void m_eomsbr (int (*action)(int)) { if ((eom_action = action)) { msg_style = MS_MSH; *msg_delim = 0; fdelimlen = 1; delimend = fdelim; } else { msg_style = MS_MMDF; msg_delim = (char *)fdelim + 1; fdelimlen = strlen((char *)fdelim); delimend = (unsigned char *)(msg_delim + edelimlen); } } /* * test for msg delimiter string */ static int m_Eom (int c, FILE *iob) { register long pos = 0L; register int i; char text[10]; pos = ftell (iob); if ((i = fread (text, sizeof *text, edelimlen, iob)) != edelimlen || strncmp (text, (char *)edelim, edelimlen)) { if (i == 0 && msg_style == MS_MBOX) /* the final newline in the (brain damaged) unix-format * maildrop is part of the delimitter - delete it. */ return 1; #if 0 fseek (iob, pos, SEEK_SET); #endif fseek (iob, (long)(pos-1), SEEK_SET); getc (iob); /* should be OK */ return 0; } if (msg_style == MS_MBOX) { while ((c = getc (iob)) != '\n') if (c < 0) break; } return 1; } static unsigned char * matchc(int patln, char *pat, int strln, char *str) { register char *es = str + strln - patln; register char *sp; register char *pp; register char *ep = pat + patln; register char pc = *pat++; for(;;) { while (pc != *str++) if (str > es) return 0; if (str > es+1) return 0; sp = str; pp = pat; while (pp < ep && *sp++ == *pp) pp++; if (pp >= ep) return ((unsigned char *)--str); } } /* * Locate character "term" in the next "cnt" characters of "src". * If found, return its address, otherwise return 0. */ static unsigned char * locc(int cnt, unsigned char *src, unsigned char term) { while (*src++ != term && --cnt > 0); return (cnt > 0 ? --src : (unsigned char *)0); } nmh-1.5/sbr/m_gmprot.c000644 007761 000765 00000000567 11713401274 014660 0ustar00kenhkenh000000 000000 /* * m_gmprot.c -- return the msg-protect value * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int m_gmprot (void) { register char *cp; return atooi ((cp = context_find ("msg-protect")) && *cp ? cp : msgprot); } nmh-1.5/sbr/m_maildir.c000644 007761 000765 00000003472 11713401274 014767 0ustar00kenhkenh000000 000000 /* * m_maildir.c -- get the path for the mail directory * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #define CWD "./" #define NCWD (sizeof(CWD) - 1) #define DOT "." #define DOTDOT ".." #define PWD "../" #define NPWD (sizeof(PWD) - 1) static char mailfold[BUFSIZ]; /* * static prototypes */ static char *exmaildir (char *); char * m_maildir (char *folder) { register char *cp, *ep; if ((cp = exmaildir (folder)) && (ep = cp + strlen (cp) - 1) > cp && *ep == '/') *ep = '\0'; return cp; } char * m_mailpath (char *folder) { register char *cp; char maildir[BUFSIZ]; if (*folder != '/' && strncmp (folder, CWD, NCWD) && strcmp (folder, DOT) && strcmp (folder, DOTDOT) && strncmp (folder, PWD, NPWD)) { strncpy (maildir, mailfold, sizeof(maildir)); /* preserve... */ cp = getcpy (m_maildir (folder)); strncpy (mailfold, maildir, sizeof(mailfold)); } else { cp = path (folder, TFOLDER); } return cp; } static char * exmaildir (char *folder) { register char *cp, *pp; /* use current folder if none is specified */ if (folder == NULL) folder = getfolder(1); if (!(*folder != '/' && strncmp (folder, CWD, NCWD) && strcmp (folder, DOT) && strcmp (folder, DOTDOT) && strncmp (folder, PWD, NPWD))) { strncpy (mailfold, folder, sizeof(mailfold)); return mailfold; } cp = mailfold; if ((pp = context_find ("path")) && *pp) { if (*pp != '/') { sprintf (cp, "%s/", mypath); cp += strlen (cp); } cp = copy (pp, cp); } else { cp = copy (path ("./", TFOLDER), cp); } if (cp[-1] != '/') *cp++ = '/'; strcpy (cp, folder); return mailfold; } nmh-1.5/sbr/m_mktemp.c000644 007761 000765 00000010520 11762736346 014652 0ustar00kenhkenh000000 000000 /* * m_mktemp.c -- Construct a temporary file. * * This code is Copyright (c) 2010, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include static char *get_temp_dir(); /* Create a temporary file. If pfx_in is null, the temporary file * will be created in the temporary directory (more on that later). * If pfx_in is not null, then the temporary file location will be * defined by the value pfx_in. * * The file created will be at the pathname specified appended with * 6 random (we hope :) characters. * * The return value will be the pathname to the file created. * * CAUTION: The return pointer references static data. If * you need to modify, or save, the return string, make a copy of it * first. * * When pfx_in is null, the temporary directory is determined as * follows, in order: * * MHTMPDIR envvar * TMPDIR envvar * TMP envvar * User's mail directory. * * NOTE: One will probably use m_mktemp2() instead of this function. * For example, if you want to create a temp file in the defined * temporary directory, but with a custom basename prefix, do * something like the following: * * char *tmp_pathname = m_mktemp2(NULL, "mypre", ...); */ char * m_mktemp ( const char *pfx_in, /* Pathname prefix for temporary file. */ int *fd_ret, /* (return,optional) File descriptor to temp file. */ FILE **fp_ret /* (return,optional) FILE pointer to temp file. */ ) { static char tmpfil[BUFSIZ]; int fd = -1; int keep_open = 0; mode_t oldmode = umask(077); if (pfx_in == NULL) { snprintf(tmpfil, sizeof(tmpfil), "%s/nmhXXXXXX", get_temp_dir()); } else { snprintf(tmpfil, sizeof(tmpfil), "%sXXXXXX", pfx_in); } fd = mkstemp(tmpfil); if (fd < 0) { umask(oldmode); return NULL; } if (fd_ret != NULL) { *fd_ret = fd; keep_open = 1; } if (fp_ret != NULL) { FILE *fp = fdopen(fd, "w+"); if (fp == NULL) { int olderr = errno; unlink(tmpfil); close(fd); errno = olderr; umask(oldmode); return NULL; } *fp_ret = fp; keep_open = 1; } if (!keep_open) { close(fd); } umask(oldmode); return tmpfil; } /* This version allows one to specify the directory the temp file should * by created based on a given pathname. Although m_mktemp() technically * supports this, this version is when the directory is defined by * a separate variable from the prefix, eliminating the caller from having * to do string manipulation to generate the desired. pathname prefix. * * The pfx_in parameter specifies a basename prefix for the file. If dir_in * is NULL, then the defined temporary directory (see comments to m_mktemp() * above) is used to create the temp file. */ char * m_mktemp2 ( const char *dir_in, /* Directory to place temp file. */ const char *pfx_in, /* Basename prefix for temp file. */ int *fd_ret, /* (return,optional) File descriptor to temp file. */ FILE **fp_ret /* (return,optional) FILE pointer to temp file. */ ) { static char buffer[BUFSIZ]; char *cp; int n; if (dir_in == NULL) { if (pfx_in == NULL) { return m_mktemp(NULL, fd_ret, fp_ret); } snprintf(buffer, sizeof(buffer), "%s/%s", get_temp_dir(), pfx_in); return m_mktemp(buffer, fd_ret, fp_ret); } if ((cp = r1bindex ((char *)dir_in, '/')) == dir_in) { /* No directory component */ return m_mktemp(pfx_in, fd_ret, fp_ret); } n = (int)(cp-dir_in); /* Length of dir component */ snprintf(buffer, sizeof(buffer), "%.*s%s", n, dir_in, pfx_in); return m_mktemp(buffer, fd_ret, fp_ret); } static char * get_temp_dir() { /* Ignore envvars if we are setuid */ if ((getuid()==geteuid()) && (getgid()==getegid())) { char *tmpdir = NULL; tmpdir = getenv("MHTMPDIR"); if (tmpdir != NULL && *tmpdir != '\0') return tmpdir; tmpdir = getenv("TMPDIR"); if (tmpdir != NULL && *tmpdir != '\0') return tmpdir; tmpdir = getenv("TMP"); if (tmpdir != NULL && *tmpdir != '\0') return tmpdir; } return m_maildir(""); } nmh-1.5/sbr/m_msgdef.c000644 007761 000765 00000002076 11713401274 014612 0ustar00kenhkenh000000 000000 /* * m_msgdef.c -- some defines for sbr/m_getfld.c * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * disgusting hack for "inc" so it can know how many characters * were stuffed in the buffer on the last call (see comments * in uip/scansbr.c) */ int msg_count = 0; int msg_style = MS_DEFAULT; /* * The "full" delimiter string for a packed maildrop consists * of a newline followed by the actual delimiter. E.g., the * full string for a Unix maildrop would be: "\n\nFrom ". * "Fdelim" points to the start of the full string and is used * in the BODY case of the main routine to search the buffer for * a possible eom. Msg_delim points to the first character of * the actual delim. string (i.e., fdelim+1). Edelim * points to the 2nd character of actual delimiter string. It * is used in m_Eom because the first character of the string * has been read and matched before m_Eom is called. */ char *msg_delim = ""; nmh-1.5/sbr/m_name.c000644 007761 000765 00000000624 11713401274 014262 0ustar00kenhkenh000000 000000 /* * m_name.c -- return a message number as a string * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include static char name[BUFSIZ]; char * m_name (int num) { if (num <= 0) return "?"; snprintf (name, sizeof(name), "%d", num); return name; } nmh-1.5/sbr/makedir.c000644 007761 000765 00000006670 11713401274 014451 0ustar00kenhkenh000000 000000 /* * makedir.c -- make a directory * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ /* * Modified to try recursive create. */ #include #include #include #include int makedir (char *dir) { char path[PATH_MAX]; char* folder_perms_ASCII; int had_an_error = 0; mode_t folder_perms, saved_umask; pid_t pid; register char* c; context_save(); /* save the context file */ fflush(stdout); if (!(folder_perms_ASCII = context_find ("folder-protect"))) folder_perms_ASCII = foldprot; /* defaults to "700" */ /* Because mh-profile.man documents "Folder-Protect:" as an octal constant, and we don't want to force the user to remember to include a leading zero, we call atooi(folder_perms_ASCII) here rather than strtoul(folder_perms_ASCII, NULL, 0). Therefore, if anyone ever tries to specify a mode in say, hex, they'll get garbage. (I guess nmh uses its atooi() function rather than calling strtoul() with a radix of 8 because some ancient platforms are missing that functionality. */ folder_perms = atooi(folder_perms_ASCII); /* Folders have definite desired permissions that are set -- we don't want to interact with the umask. Clear it temporarily. */ saved_umask = umask(0); if (getuid () == geteuid ()) { c = strncpy(path, dir, sizeof(path)); while (!had_an_error && (c = strchr((c + 1), '/')) != NULL) { *c = (char)0; if (access(path, X_OK)) { if (errno != ENOENT){ advise (dir, "unable to create directory"); had_an_error = 1; } /* Create an outer directory. */ if (mkdir(path, folder_perms)) { advise (dir, "unable to create directory"); had_an_error = 1; } } *c = '/'; } if (!had_an_error) { /* Create the innermost nested subdirectory of the path we're being asked to create. */ if (mkdir (dir, folder_perms) == -1) { advise (dir, "unable to create directory"); had_an_error = 1; } } } else { /* Ummm, why do we want to avoid creating directories with the effective user ID? None of the nmh tools are installed such that the effective should be different from the real, and if some parent process made the two be different, I don't see why it should be our job to enforce the real UID. Also, why the heck do we call the mkdir executable rather than the library function in this case?? If we do want to call the mkdir executable, we should at least be giving it -p (and change the single chmod() call below) so it can successfully create nested directories like the above code can. -- Dan Harkless */ switch (pid = vfork()) { case -1: advise ("fork", "unable to"); return 0; case 0: setgid (getgid ()); setuid (getuid ()); execl ("/bin/mkdir", "mkdir", dir, NULL); execl ("/usr/bin/mkdir", "mkdir", dir, NULL); fprintf (stderr, "unable to exec "); perror ("mkdir"); _exit (-1); default: if (pidXwait(pid, "mkdir")) return 0; break; } chmod (dir, folder_perms); } umask(saved_umask); /* put the user's umask back */ if (had_an_error) return 0; /* opposite of UNIX error return convention */ else return 1; } nmh-1.5/sbr/mf.c000644 007761 000765 00000041754 11713401274 013441 0ustar00kenhkenh000000 000000 /* * mf.c -- mail filter subroutines * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include /* * static prototypes */ static char *getcpy (char *); static void compress (char *, unsigned char *); static int isat (char *); static int parse_address (void); static int phrase (char *); static int route_addr (char *); static int local_part (char *); static int domain (char *); static int route (char *); static int my_lex (char *); static char * getcpy (char *s) { register char *p; if (!s) { /* causes compiles to blow up because the symbol _cleanup is undefined where did this ever come from? */ /* _cleanup(); */ abort(); for(;;) pause(); } p = mh_xmalloc ((size_t) (strlen (s) + 2)); strcpy (p, s); return p; } int isfrom(char *string) { return (strncmp (string, "From ", 5) == 0 || strncmp (string, ">From ", 6) == 0); } int lequal (unsigned char *a, unsigned char *b) { for (; *a; a++, b++) if (*b == 0) return FALSE; else { char c1 = islower (*a) ? toupper (*a) : *a; char c2 = islower (*b) ? toupper (*b) : *b; if (c1 != c2) return FALSE; } return (*b == 0); } /* * seekadrx() is tricky. We want to cover both UUCP-style and ARPA-style * addresses, so for each list of addresses we see if we can find some * character to give us a hint. */ #define CHKADR 0 /* undertermined address style */ #define UNIXDR 1 /* UNIX-style address */ #define ARPADR 2 /* ARPAnet-style address */ static char *punctuators = ";<>.()[]"; static char *vp = NULL; static char *tp = NULL; static struct adrx adrxs1; struct adrx * seekadrx (char *addrs) { static int state = CHKADR; register char *cp; register struct adrx *adrxp; if (state == CHKADR) for (state = UNIXDR, cp = addrs; *cp; cp++) if (strchr(punctuators, *cp)) { state = ARPADR; break; } switch (state) { case UNIXDR: adrxp = uucpadrx (addrs); break; case ARPADR: default: adrxp = getadrx (addrs); break; } if (adrxp == NULL) state = CHKADR; return adrxp; } /* * uucpadrx() implements a partial UUCP-style address parser. It's based * on the UUCP notion that addresses are separated by spaces or commas. */ struct adrx * uucpadrx (char *addrs) { register unsigned char *cp, *wp, *xp, *yp; register char *zp; register struct adrx *adrxp = &adrxs1; if (vp == NULL) { vp = tp = getcpy (addrs); compress (addrs, vp); } else if (tp == NULL) { free (vp); vp = NULL; return NULL; } for (cp = tp; isspace (*cp); cp++) continue; if (*cp == 0) { free (vp); vp = tp = NULL; return NULL; } if ((wp = strchr(cp, ',')) == NULL) { if ((wp = strchr(cp, ' ')) != NULL) { xp = wp; while (isspace (*xp)) xp++; if (*xp != 0 && isat (--xp)) { yp = xp + 4; while (isspace (*yp)) yp++; if (*yp != 0) { if ((zp = strchr(yp, ' ')) != NULL) *zp = 0, tp = ++zp; else tp = NULL; } else *wp = 0, tp = ++wp; } else *wp = 0, tp = ++wp; } else tp = NULL; } else *wp = 0, tp = ++wp; if (adrxp->text) free (adrxp->text); adrxp->text = getcpy (cp); adrxp->mbox = cp; adrxp->host = adrxp->path = NULL; if ((wp = strrchr(cp, '@')) != NULL) { *wp++ = 0; adrxp->host = *wp ? wp : NULL; } else for (wp = cp + strlen (cp) - 4; wp >= cp; wp--) if (isat (wp)) { *wp++ = 0; adrxp->host = wp + 3; } adrxp->pers = adrxp->grp = adrxp->note = adrxp->err = NULL; adrxp->ingrp = 0; return adrxp; } static void compress (char *fp, unsigned char *tp) { register char c; register unsigned char *cp; for (c = ' ', cp = tp; (*tp = *fp++) != 0;) if (isspace (*tp)) { if (c != ' ') *tp++ = c = ' '; } else c = *tp++; if (c == ' ' && cp < tp) *--tp = 0; } static int isat (char *p) { return (strncmp (p, " AT ", 4) && strncmp (p, " At ", 4) && strncmp (p, " aT ", 4) && strncmp (p, " at ", 4) ? FALSE : TRUE); } /* * * getadrx() implements a partial 822-style address parser. The parser * is neither complete nor correct. It does however recognize nearly all * of the 822 address syntax. In addition it handles the majority of the * 733 syntax as well. Most problems arise from trying to accomodate both. * * In terms of 822, the route-specification in * * "<" [route] local-part "@" domain ">" * * is parsed and returned unchanged. Multiple at-signs are compressed * via source-routing. Recursive groups are not allowed as per the * standard. * * In terms of 733, " at " is recognized as equivalent to "@". * * In terms of both the parser will not complain about missing hosts. * * ----- * * We should not allow addresses like * * Marshall T. Rose * * but should insist on * * "Marshall T. Rose" * * Unfortunately, a lot of mailers stupidly let people get away with this. * * ----- * * We should not allow addresses like * * * * but should insist on * * MRose@UCI * * Unfortunately, a lot of mailers stupidly let people's UAs get away with * this. * * ----- * * We should not allow addresses like * * @UCI:MRose@UCI-750a * * but should insist on * * Marshall Rose <@UCI:MRose@UCI-750a> * * Unfortunately, a lot of mailers stupidly do this. * */ #define QUOTE '\\' #define LX_END 0 #define LX_ERR 1 #define LX_ATOM 2 #define LX_QSTR 3 #define LX_DLIT 4 #define LX_SEMI 5 #define LX_COMA 6 #define LX_LBRK 7 #define LX_RBRK 8 #define LX_COLN 9 #define LX_DOT 10 #define LX_AT 11 struct specials { char lx_chr; int lx_val; }; static struct specials special[] = { { ';', LX_SEMI }, { ',', LX_COMA }, { '<', LX_LBRK }, { '>', LX_RBRK }, { ':', LX_COLN }, { '.', LX_DOT }, { '@', LX_AT }, { '(', LX_ERR }, { ')', LX_ERR }, { QUOTE, LX_ERR }, { '"', LX_ERR }, { '[', LX_ERR }, { ']', LX_ERR }, { 0, 0 } }; static int glevel = 0; static int ingrp = 0; static int last_lex = LX_END; static char *dp = NULL; static unsigned char *cp = NULL; static unsigned char *ap = NULL; static char *pers = NULL; static char *mbox = NULL; static char *host = NULL; static char *path = NULL; static char *grp = NULL; static char *note = NULL; static char err[BUFSIZ]; static char adr[BUFSIZ]; static struct adrx adrxs2; struct adrx * getadrx (char *addrs) { register char *bp; register struct adrx *adrxp = &adrxs2; if (pers) free (pers); if (mbox) free (mbox); if (host) free (host); if (path) free (path); if (grp) free (grp); if (note) free (note); pers = mbox = host = path = grp = note = NULL; err[0] = 0; if (dp == NULL) { dp = cp = getcpy (addrs ? addrs : ""); glevel = 0; } else if (cp == NULL) { free (dp); dp = NULL; return NULL; } switch (parse_address ()) { case DONE: free (dp); dp = cp = NULL; return NULL; case OK: switch (last_lex) { case LX_COMA: case LX_END: break; default: /* catch trailing comments */ bp = cp; my_lex (adr); cp = bp; break; } break; default: break; } if (err[0]) for (;;) { switch (last_lex) { case LX_COMA: case LX_END: break; default: my_lex (adr); continue; } break; } while (isspace (*ap)) ap++; if (cp) sprintf (adr, "%.*s", (int)(cp - ap), ap); else strcpy (adr, ap); bp = adr + strlen (adr) - 1; if (*bp == ',' || *bp == ';' || *bp == '\n') *bp = 0; adrxp->text = adr; adrxp->pers = pers; adrxp->mbox = mbox; adrxp->host = host; adrxp->path = path; adrxp->grp = grp; adrxp->ingrp = ingrp; adrxp->note = note; adrxp->err = err[0] ? err : NULL; return adrxp; } static int parse_address (void) { char buffer[BUFSIZ]; again: ; ap = cp; switch (my_lex (buffer)) { case LX_ATOM: case LX_QSTR: pers = getcpy (buffer); break; case LX_SEMI: if (glevel-- <= 0) { strcpy (err, "extraneous semi-colon"); return NOTOK; } case LX_COMA: if (note) { free (note); note = NULL; } goto again; case LX_END: return DONE; case LX_LBRK: /* sigh (2) */ goto get_addr; case LX_AT: /* sigh (3) */ cp = ap; if (route_addr (buffer) == NOTOK) return NOTOK; return OK; /* why be choosy? */ default: sprintf (err, "illegal address construct (%s)", buffer); return NOTOK; } switch (my_lex (buffer)) { case LX_ATOM: case LX_QSTR: pers = add (buffer, add (" ", pers)); more_phrase: ; /* sigh (1) */ if (phrase (buffer) == NOTOK) return NOTOK; switch (last_lex) { case LX_LBRK: get_addr: ; if (route_addr (buffer) == NOTOK) return NOTOK; if (last_lex == LX_RBRK) return OK; sprintf (err, "missing right-bracket (%s)", buffer); return NOTOK; case LX_COLN: get_group: ; if (glevel++ > 0) { sprintf (err, "nested groups not allowed (%s)", pers); return NOTOK; } grp = add (": ", pers); pers = NULL; { char *pp = cp; for (;;) switch (my_lex (buffer)) { case LX_SEMI: case LX_END: /* tsk, tsk */ glevel--; return OK; case LX_COMA: continue; default: cp = pp; return parse_address (); } } case LX_DOT: /* sigh (1) */ pers = add (".", pers); goto more_phrase; default: sprintf (err, "no mailbox in address, only a phrase (%s%s)", pers, buffer); return NOTOK; } case LX_LBRK: goto get_addr; case LX_COLN: goto get_group; case LX_DOT: mbox = add (buffer, pers); pers = NULL; if (route_addr (buffer) == NOTOK) return NOTOK; goto check_end; case LX_AT: ingrp = glevel; mbox = pers; pers = NULL; if (domain (buffer) == NOTOK) return NOTOK; check_end: ; switch (last_lex) { case LX_SEMI: if (glevel-- <= 0) { strcpy (err, "extraneous semi-colon"); return NOTOK; } case LX_COMA: case LX_END: return OK; default: sprintf (err, "junk after local@domain (%s)", buffer); return NOTOK; } case LX_SEMI: /* no host */ case LX_COMA: case LX_END: ingrp = glevel; if (last_lex == LX_SEMI && glevel-- <= 0) { strcpy (err, "extraneous semi-colon"); return NOTOK; } mbox = pers; pers = NULL; return OK; default: sprintf (err, "missing mailbox (%s)", buffer); return NOTOK; } } static int phrase (char *buffer) { for (;;) switch (my_lex (buffer)) { case LX_ATOM: case LX_QSTR: pers = add (buffer, add (" ", pers)); continue; default: return OK; } } static int route_addr (char *buffer) { register char *pp = cp; if (my_lex (buffer) == LX_AT) { if (route (buffer) == NOTOK) return NOTOK; } else cp = pp; if (local_part (buffer) == NOTOK) return NOTOK; switch (last_lex) { case LX_AT: return domain (buffer); case LX_SEMI: /* if in group */ case LX_RBRK: /* no host */ case LX_COMA: case LX_END: return OK; default: sprintf (err, "no at-sign after local-part (%s)", buffer); return NOTOK; } } static int local_part (char *buffer) { ingrp = glevel; for (;;) { switch (my_lex (buffer)) { case LX_ATOM: case LX_QSTR: mbox = add (buffer, mbox); break; default: sprintf (err, "no mailbox in local-part (%s)", buffer); return NOTOK; } switch (my_lex (buffer)) { case LX_DOT: mbox = add (buffer, mbox); continue; default: return OK; } } } static int domain (char *buffer) { for (;;) { switch (my_lex (buffer)) { case LX_ATOM: case LX_DLIT: host = add (buffer, host); break; default: sprintf (err, "no sub-domain in domain-part of address (%s)", buffer); return NOTOK; } switch (my_lex (buffer)) { case LX_DOT: host = add (buffer, host); continue; case LX_AT: /* sigh (0) */ mbox = add (host, add ("%", mbox)); free (host); host = NULL; continue; default: return OK; } } } static int route (char *buffer) { path = getcpy ("@"); for (;;) { switch (my_lex (buffer)) { case LX_ATOM: case LX_DLIT: path = add (buffer, path); break; default: sprintf (err, "no sub-domain in domain-part of address (%s)", buffer); return NOTOK; } switch (my_lex (buffer)) { case LX_COMA: path = add (buffer, path); for (;;) { switch (my_lex (buffer)) { case LX_COMA: continue; case LX_AT: path = add (buffer, path); break; default: sprintf (err, "no at-sign found for next domain in route (%s)", buffer); } break; } continue; case LX_AT: /* XXX */ case LX_DOT: path = add (buffer, path); continue; case LX_COLN: path = add (buffer, path); return OK; default: sprintf (err, "no colon found to terminate route (%s)", buffer); return NOTOK; } } } static int my_lex (char *buffer) { /* buffer should be at least BUFSIZ bytes long */ int i, gotat = 0; register unsigned char c; register char *bp; /* Add C to the buffer bp. After use of this macro *bp is guaranteed to be within the buffer. */ #define ADDCHR(C) do { *bp++ = (C); if ((bp - buffer) == (BUFSIZ-1)) goto my_lex_buffull; } while (0) bp = buffer; *bp = 0; if (!cp) return (last_lex = LX_END); gotat = isat (cp); c = *cp++; while (isspace (c)) c = *cp++; if (c == 0) { cp = NULL; return (last_lex = LX_END); } if (c == '(') { ADDCHR(c); for (i = 0;;) switch (c = *cp++) { case 0: cp = NULL; return (last_lex = LX_ERR); case QUOTE: ADDCHR(c); if ((c = *cp++) == 0) { cp = NULL; return (last_lex = LX_ERR); } ADDCHR(c); continue; case '(': i++; default: ADDCHR(c); continue; case ')': ADDCHR(c); if (--i < 0) { *bp = 0; note = note ? add (buffer, add (" ", note)) : getcpy (buffer); return my_lex (buffer); } } } if (c == '"') { ADDCHR(c); for (;;) switch (c = *cp++) { case 0: cp = NULL; return (last_lex = LX_ERR); case QUOTE: ADDCHR(c); if ((c = *cp++) == 0) { cp = NULL; return (last_lex = LX_ERR); } default: ADDCHR(c); continue; case '"': ADDCHR(c); *bp = 0; return (last_lex = LX_QSTR); } } if (c == '[') { ADDCHR(c); for (;;) switch (c = *cp++) { case 0: cp = NULL; return (last_lex = LX_ERR); case QUOTE: ADDCHR(c); if ((c = *cp++) == 0) { cp = NULL; return (last_lex = LX_ERR); } default: ADDCHR(c); continue; case ']': ADDCHR(c); *bp = 0; return (last_lex = LX_DLIT); } } ADDCHR(c); *bp = 0; for (i = 0; special[i].lx_chr != 0; i++) if (c == special[i].lx_chr) return (last_lex = special[i].lx_val); if (iscntrl (c)) return (last_lex = LX_ERR); for (;;) { if ((c = *cp++) == 0) break; for (i = 0; special[i].lx_chr != 0; i++) if (c == special[i].lx_chr) goto got_atom; if (iscntrl (c) || isspace (c)) break; ADDCHR(c); } got_atom: ; if (c == 0) cp = NULL; else cp--; *bp = 0; last_lex = !gotat || cp == NULL || strchr(cp, '<') != NULL ? LX_ATOM : LX_AT; return last_lex; my_lex_buffull: /* Out of buffer space. *bp is the last byte in the buffer */ *bp = 0; return (last_lex = LX_ERR); } char * legal_person (char *p) { int i; register char *cp; static char buffer[BUFSIZ]; if (*p == '"') return p; for (cp = p; *cp; cp++) for (i = 0; special[i].lx_chr; i++) if (*cp == special[i].lx_chr) { sprintf (buffer, "\"%s\"", p); return buffer; } return p; } int mfgets (FILE *in, char **bp) { int i; register char *cp, *dp, *ep; static int len = 0; static char *pp = NULL; if (pp == NULL) pp = mh_xmalloc ((size_t) (len = BUFSIZ)); for (ep = (cp = pp) + len - 2;;) { switch (i = getc (in)) { case EOF: eol: ; if (cp != pp) { *cp = 0; *bp = pp; return OK; } eoh: ; *bp = NULL; free (pp); pp = NULL; return DONE; case 0: continue; case '\n': if (cp == pp) /* end of headers, gobble it */ goto eoh; switch (i = getc (in)) { default: /* end of line */ case '\n': /* end of headers, save for next call */ ungetc (i, in); goto eol; case ' ': /* continue headers */ case '\t': *cp++ = '\n'; break; } /* fall into default case */ default: *cp++ = i; break; } if (cp >= ep) { dp = mh_xrealloc (pp, (size_t) (len += BUFSIZ)); cp += dp - pp, ep = (pp = cp) + len - 2; } } } nmh-1.5/sbr/mts.c000644 007761 000765 00000022417 11765267273 013655 0ustar00kenhkenh000000 000000 /* * mts.c -- definitions for the mail transport system * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* for snprintf() */ #include #include #define nmhetcdir(file) NMHETCDIR#file #include #include #include #include #include #include /* * static prototypes */ static char *tailor_value (unsigned char *); static void getuserinfo (void); static const char *get_mtsconf_pathname(void); static const char *get_mtsuserconf_pathname(void); static void mts_read_conf_file (FILE *fp); /* * *mmdfldir and *uucpldir are the maildrop directories. If maildrops * are kept in the user's home directory, then these should be empty * strings. In this case, the appropriate ...lfil array should contain * the name of the file in the user's home directory. Usually, this is * something like ".mail". */ /* * nmh mail transport interface customization file */ static char *mtsconf = nmhetcdir(/mts.conf); static char *localname = ""; static char *localdomain = ""; static char *systemname = ""; char *mmdfldir = MAILSPOOL; char *mmdflfil = ""; char *uucpldir = "/usr/spool/mail"; char *uucplfil = ""; char *mmdlm1 = "\001\001\001\001\n"; char *mmdlm2 = "\001\001\001\001\n"; /* Cache the username, fullname, and mailbox of the user */ static char username[BUFSIZ]; static char fullname[BUFSIZ]; static char localmbox[BUFSIZ]; /* * MTS specific variables */ static char *sm_method = "smtp"; int sm_mts = MTS_SMTP; char *sendmail = SENDMAILPATH; /* * SMTP/POP stuff */ char *clientname = NULL; char *servers = "localhost"; char *pophost = ""; /* * Global MailDelivery file */ char *maildelivery = nmhetcdir(/maildelivery); /* * Aliasing Facility (doesn't belong here) */ int Everyone = NOTOK; static char *everyone = "-1"; char *NoShell = ""; /* * Customize the MTS settings for nmh by adjusting * the file mts.conf in the nmh etc directory. */ struct bind { char *keyword; char **value; }; static struct bind binds[] = { { "localname", &localname }, { "localdomain", &localdomain }, { "systemname", &systemname }, { "mmdfldir", &mmdfldir }, { "mmdflfil", &mmdflfil }, { "uucpldir", &uucpldir }, { "uucplfil", &uucplfil }, { "mmdelim1", &mmdlm1 }, { "mmdelim2", &mmdlm2 }, { "mts", &sm_method }, { "sendmail", &sendmail }, { "clientname", &clientname }, { "servers", &servers }, { "pophost", &pophost }, { "maildelivery", &maildelivery }, { "everyone", &everyone }, { "noshell", &NoShell }, { NULL, NULL } }; /* * Read the configuration file for the nmh interface * to the mail transport system (MTS). */ void mts_init (char *name) { const char *cp; FILE *fp; static int inited = 0; NMH_UNUSED (name); if (inited++ || (fp = fopen (get_mtsconf_pathname(), "r")) == NULL) return; mts_read_conf_file(fp); fclose (fp); cp = get_mtsuserconf_pathname(); if (cp != NULL && ((fp = fopen (get_mtsuserconf_pathname(), "r")) != NULL)) { mts_read_conf_file(fp); fclose (fp); } Everyone = atoi (everyone); if (strcmp(sm_method, "smtp") == 0) sm_mts = MTS_SMTP; else if (strcmp(sm_method, "sendmail") == 0) sm_mts = MTS_SENDMAIL; else { advise(NULL, "unsupported \"mts\" value in mts.conf: %s", sm_method); sm_mts = MTS_SMTP; } } #define QUOTE '\\' /* * Convert escaped values, malloc some new space, * and copy string to malloc'ed memory. */ static char * tailor_value (unsigned char *s) { int i, r; char *bp; char buffer[BUFSIZ]; size_t len; for (bp = buffer; *s; bp++, s++) { if (*s != QUOTE) { *bp = *s; } else { switch (*++s) { case 'b': *bp = '\b'; break; case 'f': *bp = '\f'; break; case 'n': *bp = '\n'; break; case 't': *bp = '\t'; break; case 0: s--; case QUOTE: *bp = QUOTE; break; default: if (!isdigit (*s)) { *bp++ = QUOTE; *bp = *s; } r = *s != '0' ? 10 : 8; for (i = 0; isdigit (*s); s++) i = i * r + *s - '0'; s--; *bp = toascii (i); break; } } } *bp = 0; len = strlen (buffer) + 1; bp = mh_xmalloc (len); memcpy (bp, buffer, len); return bp; } /* * Get the fully qualified name of the local host. * * If flag is 0, then use anything out of mts.conf (like localname). * If flag is 1, then only use the "proper" local hostname. */ char * LocalName (int flag) { static char buffer0[BUFSIZ] = ""; static char buffer1[BUFSIZ] = ""; static char *buffer[] = { buffer0, buffer1 }; char *buf; struct addrinfo hints, *res; if (flag < 0 || flag > 1) return NULL; buf = buffer[flag]; /* check if we have cached the local name */ if (buf[0]) return buf; mts_init ("mts"); /* check if the mts.conf file specifies a "localname" */ if (*localname && flag == 0) { strncpy (buf, localname, sizeof(buffer0)); } else { memset(buf, 0, sizeof(buffer0)); /* first get our local name */ gethostname (buf, sizeof(buffer0) - 1); /* now fully qualify our name */ memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_CANONNAME; hints.ai_family = PF_UNSPEC; if (getaddrinfo(buf, NULL, &hints, &res) == 0) { strncpy(buf, res->ai_canonname, sizeof(buffer0) - 1); freeaddrinfo(res); } } /* * If the mts.conf file specifies a "localdomain", * we append that now. This should rarely be needed. */ if (*localdomain) { strcat (buf, "."); strcat (buf, localdomain); } return buf; } /* * This is only for UUCP mail. It gets the hostname * as part of the UUCP "domain". */ char * SystemName (void) { static char buffer[BUFSIZ] = ""; /* check if we have cached the system name */ if (buffer[0]) return buffer; mts_init ("mts"); /* check if mts.conf file specifies a "systemname" */ if (*systemname) { strncpy (buffer, systemname, sizeof(buffer)); return buffer; } gethostname (buffer, sizeof(buffer)); return buffer; } /* * Get the username of current user */ char * getusername (void) { if (username[0] == '\0') getuserinfo(); return username; } /* * Get full name of current user (typically from GECOS * field of password file). */ char * getfullname (void) { if (username[0] == '\0') getuserinfo(); return fullname; } /* * Get the full local mailbox name. This is in the form: * * User Name */ char * getlocalmbox (void) { if (username[0] == '\0') getuserinfo(); if (localmbox[0] == '\0') { char *cp; if ((cp = context_find("Local-Mailbox")) != NULL) { strncpy(localmbox, cp, sizeof(localmbox)); } else { snprintf(localmbox, sizeof(localmbox), "%s <%s@%s>", fullname, username, LocalName(0)); } localmbox[sizeof(localmbox) - 1] = '\0'; } return localmbox; } /* * Find the user's username and full name, and cache them. */ static void getuserinfo (void) { register unsigned char *cp; register char *np; register struct passwd *pw; if ((pw = getpwuid (getuid ())) == NULL || pw->pw_name == NULL || *pw->pw_name == '\0') { strncpy (username, "unknown", sizeof(username)); snprintf (fullname, sizeof(fullname), "The Unknown User-ID (%d)", (int) getuid ()); return; } np = pw->pw_gecos; /* Get the user's real name from the GECOS field. Stop once we hit a ',', which some OSes use to separate other 'finger' information in the GECOS field, like phone number. */ for (cp = fullname; *np != '\0' && *np != ','; *cp++ = *np++) continue; *cp = '\0'; strncpy (username, pw->pw_name, sizeof(username)); /* The $SIGNATURE environment variable overrides the GECOS field's idea of your real name. If SIGNATURE isn't set, use the Signature profile setting if it exists. Note that post(8) and whom(1) use context_foil (), so they won't see the profile component. */ if ((cp = getenv ("SIGNATURE")) && *cp) strncpy (fullname, cp, sizeof(fullname)); else if ((cp = context_find("Signature"))) strncpy (fullname, cp, sizeof(fullname)); fullname[sizeof(fullname) - 1] = '\0'; escape_display_name(fullname, sizeof(fullname)); localmbox[0] = '\0'; return; } static const char* get_mtsconf_pathname (void) { const char *cp = getenv ( "MHMTSCONF" ); if (cp != NULL && *cp != '\0') { return cp; } return mtsconf; } static const char* get_mtsuserconf_pathname (void) { const char *cp = getenv ( "MHMTSUSERCONF" ); if (cp != NULL && *cp != '\0') { return cp; } return NULL; } static void mts_read_conf_file (FILE *fp) { unsigned char *bp; char *cp, buffer[BUFSIZ]; struct bind *b; while (fgets (buffer, sizeof(buffer), fp)) { if (!(cp = strchr(buffer, '\n'))) break; *cp = 0; if (*buffer == '#' || *buffer == '\0') continue; if (!(bp = strchr(buffer, ':'))) break; *bp++ = 0; while (isspace (*bp)) *bp++ = 0; for (b = binds; b->keyword; b++) if (!strcmp (buffer, b->keyword)) break; if (b->keyword && (cp = tailor_value (bp))) *b->value = cp; } } nmh-1.5/sbr/norm_charmap.c000644 007761 000765 00000006067 11476006206 015505 0ustar00kenhkenh000000 000000 /* * The Single Unix Specification function nl_langinfo(CODESET) * returns the name of the encoding used by the currently selected * locale: * * http://www.opengroup.org/onlinepubs/7908799/xsh/langinfo.h.html * * Unfortunately the encoding names are not yet standardized. * This function knows about the encoding names used on many * different systems and converts them where possible into * the corresponding MIME charset name registered in * * http://www.iana.org/assignments/character-sets * * Please extend it as needed and suggest improvements to the author. * * Markus.Kuhn@cl.cam.ac.uk -- 2002-03-11 * Permission to use, copy, modify, and distribute this software * for any purpose and without fee is hereby granted. The author * disclaims all warranties with regard to this software. * * Latest version: * * http://www.cl.cam.ac.uk/~mgk25/ucs/norm_charmap.c */ #include #define digit(x) ((x) >= '0' && (x) <= '9') static char buf[16]; char * norm_charmap(char *name) { char *p; if (!name) return name; /* Many need no remapping, but they are listed here so you * can see what output to expect, and modify for your needs * as necessary. */ if (!strcmp(name, "UTF-8")) return "UTF-8"; if (!strcmp(name, "EUC-JP")) return "EUC-JP"; if (!strcmp(name, "EUC-KR")) return "EUC-KR"; if (!strcmp(name, "EUC-TW")) return "EUC-TW"; if (!strcmp(name, "KOI8-R")) return "KOI8-R"; if (!strcmp(name, "KOI8-U")) return "KOI8-U"; if (!strcmp(name, "GBK")) return "GBK"; if (!strcmp(name, "GB2312")) return "GB2312"; if (!strcmp(name, "GB18030")) return "GB18030"; if (!strcmp(name, "VSCII")) return "VSCII"; /* ASCII comes in many names */ if (!strcmp(name, "ASCII") || !strcmp(name, "US-ASCII") || !strcmp(name, "ANSI_X3.4-1968") || !strcmp(name, "646") || !strcmp(name, "ISO646") || !strcmp(name, "ISO_646.IRV")) return "US-ASCII"; /* ISO 8859 will be converted to "ISO-8859-x" */ if ((p = strstr(name, "8859-"))) { memcpy(buf, "ISO-8859-\0\0", 12); p += 5; if (digit(*p)) { buf[9] = *p++; if (digit(*p)) buf[10] = *p++; return buf; } } /* Windows code pages will be converted to "WINDOWS-12xx" */ if ((p = strstr(name, "CP12"))) { memcpy(buf, "WINDOWS-12\0\0", 13); p += 4; if (digit(*p)) { buf[10] = *p++; if (digit(*p)) buf[11] = *p++; return buf; } } /* TIS-620 comes in at least the following two forms */ if (!strcmp(name, "TIS-620") || !strcmp(name, "TIS620.2533")) return "ISO-8859-11"; /* For some, uppercase/lowercase might differ */ if (!strcmp(name, "Big5") || !strcmp(name, "BIG5")) return "Big5"; if (!strcmp(name, "Big5HKSCS") || !strcmp(name, "BIG5HKSCS")) return "Big5HKSCS"; /* I don't know of any implementation of nl_langinfo(CODESET) out * there that returns anything else (and I'm not even certain all of * the above occur in the wild), but just in case, as a fallback, * return the unmodified name. */ return name; } nmh-1.5/sbr/path.c000644 007761 000765 00000005767 11713401274 013777 0ustar00kenhkenh000000 000000 /* * path.c -- return a pathname * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #define CWD "./" #define NCWD (sizeof(CWD) - 1) #define DOT "." #define DOTDOT ".." #define PWD "../" #define NPWD (sizeof(PWD) - 1) static char *pwds; /* * static prototypes */ static char *expath(char *,int); static void compath(char *); char * pluspath(char *name) { return path(name + 1, *name == '+' ? TFOLDER : TSUBCWF); } char * path(char *name, int flag) { register char *cp, *ep; if ((cp = expath (name, flag)) && (ep = cp + strlen (cp) - 1) > cp && *ep == '/') *ep = '\0'; return cp; } static char * expath (char *name, int flag) { register char *cp, *ep; char buffer[BUFSIZ]; if (flag == TSUBCWF) { snprintf (buffer, sizeof(buffer), "%s/%s", getfolder (1), name); name = m_mailpath (buffer); compath (name); snprintf (buffer, sizeof(buffer), "%s/", m_maildir ("")); if (ssequal (buffer, name)) { cp = name; name = getcpy (name + strlen (buffer)); free (cp); } flag = TFOLDER; } if (*name == '/' || (flag == TFOLDER && (strncmp (name, CWD, NCWD) && strcmp (name, DOT) && strcmp (name, DOTDOT) && strncmp (name, PWD, NPWD)))) return getcpy (name); if (pwds == NULL) pwds = pwd (); if (strcmp (name, DOT) == 0 || strcmp (name, CWD) == 0) return getcpy (pwds); ep = pwds + strlen (pwds); if ((cp = strrchr(pwds, '/')) == NULL) cp = ep; else if (cp == pwds) cp++; if (strncmp (name, CWD, NCWD) == 0) name += NCWD; if (strcmp (name, DOTDOT) == 0 || strcmp (name, PWD) == 0) { snprintf (buffer, sizeof(buffer), "%.*s", (int)(cp - pwds), pwds); return getcpy (buffer); } if (strncmp (name, PWD, NPWD) == 0) name += NPWD; else cp = ep; snprintf (buffer, sizeof(buffer), "%.*s/%s", (int)(cp - pwds), pwds, name); return getcpy (buffer); } static void compath (char *f) { register char *cp, *dp; if (*f != '/') return; for (cp = f; *cp;) if (*cp == '/') { switch (*++cp) { case 0: if (--cp > f) *cp = '\0'; break; case '/': for (dp = cp; *dp == '/'; dp++) continue; strcpy (cp--, dp); continue; case '.': if (strcmp (cp, DOT) == 0) { if (cp > f + 1) cp--; *cp = '\0'; break; } if (strcmp (cp, DOTDOT) == 0) { for (cp -= 2; cp > f; cp--) if (*cp == '/') break; if (cp <= f) cp = f + 1; *cp = '\0'; break; } if (strncmp (cp, PWD, NPWD) == 0) { for (dp = cp - 2; dp > f; dp--) if (*dp == '/') break; if (dp <= f) dp = f; strcpy (dp, cp + NPWD - 1); cp = dp; continue; } if (strncmp (cp, CWD, NCWD) == 0) { strcpy (cp - 1, cp + NCWD - 1); cp--; continue; } continue; default: cp++; continue; } break; } else cp++; } nmh-1.5/sbr/peekc.c000644 007761 000765 00000000540 11713401274 014112 0ustar00kenhkenh000000 000000 /* * peekc.c -- peek at the next character in a stream * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int peekc(FILE *fp) { register int c; c = getc(fp); ungetc(c, fp); return c; } nmh-1.5/sbr/pidstatus.c000644 007761 000765 00000002561 11762736346 015067 0ustar00kenhkenh000000 000000 /* * pidstatus.c -- report child's status * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* * auto-generated header */ #include #ifndef WTERMSIG # define WTERMSIG(s) ((int)((s) & 0x7F)) #endif #ifndef WCOREDUMP # define WCOREDUMP(s) ((s) & 0x80) #endif int pidstatus (int status, FILE *fp, char *cp) { int signum; /* * I have no idea what this is for (rc) * so I'm commenting it out for right now. * * if ((status & 0xff00) == 0xff00) * return status; */ /* If child process returned normally */ if (WIFEXITED(status)) { if ((signum = WEXITSTATUS(status))) { if (cp) fprintf (fp, "%s: ", cp); fprintf (fp, "exit %d\n", signum); } } else if (WIFSIGNALED(status)) { /* If child process terminated due to receipt of a signal */ signum = WTERMSIG(status); if (signum != SIGINT) { if (cp) fprintf (fp, "%s: ", cp); fprintf (fp, "signal %d", signum); if (signum >= 0 && signum < (int) sizeof(sigmsg) && sigmsg[signum] != NULL) fprintf (fp, " (%s%s)\n", sigmsg[signum], WCOREDUMP(status) ? ", core dumped" : ""); else fprintf (fp, "%s\n", WCOREDUMP(status) ? " (core dumped)" : ""); } } return status; } nmh-1.5/sbr/pidwait.c000644 007761 000765 00000001445 11762736346 014510 0ustar00kenhkenh000000 000000 /* * pidwait.c -- wait for child to exit * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include int pidwait (pid_t id, int sigsok) { pid_t pid; SIGNAL_HANDLER istat = NULL, qstat = NULL; int status; if (sigsok == -1) { /* ignore a couple of signals */ istat = SIGNAL (SIGINT, SIG_IGN); qstat = SIGNAL (SIGQUIT, SIG_IGN); } while ((pid = waitpid(id, &status, 0)) == -1 && errno == EINTR) ; if (sigsok == -1) { /* reset the signal handlers */ SIGNAL (SIGINT, istat); SIGNAL (SIGQUIT, qstat); } return (pid == -1 ? -1 : status); } nmh-1.5/sbr/print_help.c000644 007761 000765 00000001331 11713401274 015166 0ustar00kenhkenh000000 000000 /* * print_help.c -- print a help message, and possibly the * -- profile/context entries for this command * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void print_help (char *str, struct swit *swp, int print_context) { char *s; /* print Usage string */ printf ("Usage: %s\n", str); /* print all the switches */ printf (" switches are:\n"); print_sw (ALL, swp, "-", stdout); /* * check if we should print any profile entries */ if (print_context && (s = context_find (invo_name))) printf ("\nProfile: %s\n", s); } nmh-1.5/sbr/print_sw.c000644 007761 000765 00000002471 11713401274 014675 0ustar00kenhkenh000000 000000 /* * print_sw.c -- print switches * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void print_sw (char *substr, struct swit *swp, char *prefix, FILE *fp) { int len, optno; register int i; register char *cp, *cp1, *sp; char buf[128]; len = strlen(substr); for (; swp->sw; swp++) { /* null matches all strings */ if (!*substr || (ssequal (substr, swp->sw) && len >= swp->minchars)) { optno = 0; /* next switch */ if ((sp = (&swp[1])->sw)) { if (!*substr && sp[0] == 'n' && sp[1] == 'o' && strcmp (&sp[2], swp->sw) == 0 && ( ((&swp[1])->minchars == 0 && swp->minchars == 0) || ((&swp[1])->minchars == (swp->minchars) + 2))) optno++; } if (swp->minchars > 0) { cp = buf; *cp++ = '('; if (optno) { strcpy (cp, "[no]"); cp += strlen (cp); } for (cp1 = swp->sw, i = 0; i < swp->minchars; i++) *cp++ = *cp1++; *cp++ = ')'; while ((*cp++ = *cp1++)); fprintf (fp, " %s%s\n", prefix, buf); } else { if (!swp->minchars) fprintf(fp, optno ? " %s[no]%s\n" : " %s%s\n", prefix, swp->sw); } if (optno) swp++; /* skip -noswitch */ } } } nmh-1.5/sbr/print_version.c000644 007761 000765 00000000523 11713401274 015725 0ustar00kenhkenh000000 000000 /* * print_version.c -- print a version string * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void print_version (char *invo_name) { printf("%s -- %s\n", invo_name, version_str); } nmh-1.5/sbr/push.c000644 007761 000765 00000001726 11713401274 014011 0ustar00kenhkenh000000 000000 /* * push.c -- push a fork into the background * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include void push(void) { pid_t pid; int i; for (i = 0; (pid = fork()) == -1 && i < 5; i++) sleep (5); switch (pid) { case -1: /* fork error */ advise (NULL, "unable to fork, so can't push..."); break; case 0: /* child, block a few signals and continue */ SIGNAL (SIGHUP, SIG_IGN); SIGNAL (SIGINT, SIG_IGN); SIGNAL (SIGQUIT, SIG_IGN); SIGNAL (SIGTERM, SIG_IGN); #ifdef SIGTSTP SIGNAL (SIGTSTP, SIG_IGN); SIGNAL (SIGTTIN, SIG_IGN); SIGNAL (SIGTTOU, SIG_IGN); #endif freopen ("/dev/null", "r", stdin); freopen ("/dev/null", "w", stdout); break; default: /* parent, just exit */ done (0); } } nmh-1.5/sbr/putenv.c000644 007761 000765 00000002455 11713401274 014353 0ustar00kenhkenh000000 000000 /* * putenv.c -- (un)set an envariable * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include extern char **environ; /* * prototypes */ int m_putenv (char *, char *); int unputenv (char *); static int nvmatch (char *, char *); int m_putenv (char *name, char *value) { register int i; register char **ep, **nep, *cp; cp = mh_xmalloc ((size_t) (strlen (name) + strlen (value) + 2)); sprintf (cp, "%s=%s", name, value); for (ep = environ, i = 0; *ep; ep++, i++) if (nvmatch (name, *ep)) { *ep = cp; return 0; } nep = (char **) mh_xmalloc ((size_t) ((i + 2) * sizeof(*nep))); for (ep = environ, i = 0; *ep; nep[i++] = *ep++) continue; nep[i++] = cp; nep[i] = NULL; environ = nep; return 0; } int unputenv (char *name) { char **ep, **nep; for (ep = environ; *ep; ep++) if (nvmatch (name, *ep)) break; if (*ep == NULL) return 1; for (nep = ep + 1; *nep; nep++) continue; *ep = *--nep; *nep = NULL; return 0; } static int nvmatch (char *s1, char *s2) { while (*s1 == *s2++) if (*s1++ == '=') return 1; return (*s1 == '\0' && *--s2 == '='); } nmh-1.5/sbr/r1bindex.c000644 007761 000765 00000001473 11713401274 014545 0ustar00kenhkenh000000 000000 /* * r1bindex.c -- Given a string and a character, return a pointer * -- to the right of the rightmost occurrence of the * -- character. If the character doesn't occur, the * -- pointer will be at the beginning of the string. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char * r1bindex(char *str, int chr) { char *cp; /* find null at the end of the string */ for (cp = str; *cp; cp++) continue; /* backup to the rightmost character */ --cp; /* now search for the rightmost occurrence of the character */ while (cp >= str && *cp != chr) --cp; /* now move one to the right */ return (++cp); } nmh-1.5/sbr/readconfig.c000644 007761 000765 00000005306 11765267273 015151 0ustar00kenhkenh000000 000000 /* * readconfig.c -- base routine to read nmh configuration files * -- such as nmh profile, context file, or mhn.defaults. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include struct procstr { char *procname; char **procnaddr; }; static struct procstr procs[] = { { "context", &context }, { "mh-sequences", &mh_seq }, { "buildmimeproc", &buildmimeproc }, { "faceproc", &faceproc }, { "fileproc", &fileproc }, { "formatproc", &formatproc }, { "incproc", &incproc }, { "installproc", &installproc }, { "lproc", &lproc }, { "mailproc", &mailproc }, { "mhlproc", &mhlproc }, { "moreproc", &moreproc }, { "mshproc", &mshproc }, { "packproc", &packproc }, { "postproc", &postproc }, { "rmmproc", &rmmproc }, { "sendproc", &sendproc }, { "showmimeproc", &showmimeproc }, { "showproc", &showproc }, { "vmhproc", &vmhproc }, { "whatnowproc", &whatnowproc }, { "whomproc", &whomproc }, { NULL, NULL } }; static struct node **opp = NULL; void readconfig (struct node **npp, FILE *ib, char *file, int ctx) { register int state; register char *cp; char name[NAMESZ], field[BUFSIZ]; register struct node *np; register struct procstr *ps; if (npp == NULL && (npp = opp) == NULL) { admonish (NULL, "bug: readconfig called but pump not primed"); return; } for (state = FLD;;) { switch (state = m_getfld (state, name, field, sizeof(field), ib)) { case FLD: case FLDPLUS: case FLDEOF: np = (struct node *) mh_xmalloc (sizeof(*np)); *npp = np; *(npp = &np->n_next) = NULL; np->n_name = getcpy (name); if (state == FLDPLUS) { cp = getcpy (field); while (state == FLDPLUS) { state = m_getfld (state, name, field, sizeof(field), ib); cp = add (field, cp); } np->n_field = trimcpy (cp); free (cp); } else { np->n_field = trimcpy (field); } np->n_context = ctx; /* * Now scan the list of `procs' and link in the * field value to the global variable. */ for (ps = procs; ps->procname; ps++) if (strcmp (np->n_name, ps->procname) == 0) { *ps->procnaddr = np->n_field; break; } if (state == FLDEOF) break; continue; case BODY: case BODYEOF: adios (NULL, "no blank lines are permitted in %s", file); case FILEEOF: break; default: adios (NULL, "%s is poorly formatted", file); } break; } opp = npp; } nmh-1.5/sbr/refile.c000644 007761 000765 00000002012 11713401274 014265 0ustar00kenhkenh000000 000000 /* * refile.c -- call the "fileproc" to refile the * -- msg or draft into another folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int refile (char **arg, char *file) { pid_t pid; register int vecp; char *vec[MAXARGS]; vecp = 0; vec[vecp++] = r1bindex (fileproc, '/'); vec[vecp++] = "-nolink"; /* override bad .mh_profile defaults */ vec[vecp++] = "-nopreserve"; vec[vecp++] = "-file"; vec[vecp++] = file; if (arg) { while (*arg) vec[vecp++] = *arg++; } vec[vecp] = NULL; context_save(); /* save the context file */ fflush(stdout); switch (pid = vfork()) { case -1: advise ("fork", "unable to"); return -1; case 0: execvp (fileproc, vec); fprintf (stderr, "unable to exec "); perror (fileproc); _exit (-1); default: return (pidwait (pid, -1)); } } nmh-1.5/sbr/remdir.c000644 007761 000765 00000000667 11713401274 014317 0ustar00kenhkenh000000 000000 /* * remdir.c -- remove a directory * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int remdir (char *dir) { context_save(); /* save the context file */ fflush(stdout); if (rmdir(dir) == -1) { admonish (dir, "unable to remove directory"); return 0; } return 1; } nmh-1.5/sbr/ruserpass.c000644 007761 000765 00000010676 11713401274 015065 0ustar00kenhkenh000000 000000 /* * Portions of this code are * Copyright (c) 1985 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley. The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include #include #include #include static FILE *cfile; #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 64 #endif #define DEFAULT 1 #define LOGIN 2 #define PASSWD 3 #define ACCOUNT 4 #define MACDEF 5 #define ID 10 #define MACH 11 static char tokval[100]; struct toktab { char *tokstr; int tval; }; static struct toktab toktabs[] = { { "default", DEFAULT }, { "login", LOGIN }, { "password", PASSWD }, { "passwd", PASSWD }, { "account", ACCOUNT }, { "machine", MACH }, { "macdef", MACDEF }, { 0, 0 } }; /* * prototypes */ static int token(void); void ruserpass(char *host, char **aname, char **apass) { char *hdir, buf[BUFSIZ]; int t, usedefault = 0; struct stat stb; hdir = getenv("HOME"); if (hdir == NULL) hdir = "."; snprintf(buf, sizeof(buf), "%s/.netrc", hdir); cfile = fopen(buf, "r"); if (cfile == NULL) { if (errno != ENOENT) perror(buf); goto done; } while ((t = token())) { switch(t) { case DEFAULT: usedefault = 1; /* FALL THROUGH */ case MACH: if (!usedefault) { if (token() != ID) continue; /* * Allow match either for user's host name. */ if (mh_strcasecmp(host, tokval) == 0) goto match; continue; } match: while ((t = token()) && t != MACH && t != DEFAULT) { switch(t) { case LOGIN: if (token() && *aname == 0) { *aname = mh_xmalloc((size_t) strlen(tokval) + 1); strcpy(*aname, tokval); } break; case PASSWD: if (fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { /* We make this a fatal error to force the user to correct it */ advise(NULL, "Error - ~/.netrc file must not be world or group readable."); adios(NULL, "Remove password or correct file permissions."); } if (token() && *apass == 0) { *apass = mh_xmalloc((size_t) strlen(tokval) + 1); strcpy(*apass, tokval); } break; case ACCOUNT: break; case MACDEF: goto done_close; break; default: fprintf(stderr, "Unknown .netrc keyword %s\n", tokval); break; } } goto done; } } done_close: fclose(cfile); done: if (!*aname) { char tmp[80]; char *myname; if ((myname = getlogin()) == NULL) { struct passwd *pp; if ((pp = getpwuid (getuid())) != NULL) myname = pp->pw_name; } printf("Name (%s:%s): ", host, myname); fgets(tmp, sizeof(tmp) - 1, stdin); tmp[strlen(tmp) - 1] = '\0'; if (*tmp != '\0') { myname = tmp; } *aname = mh_xmalloc((size_t) strlen(myname) + 1); strcpy (*aname, myname); } if (!*apass) { char prompt[256]; char *mypass; snprintf(prompt, sizeof(prompt), "Password (%s:%s): ", host, *aname); mypass = nmh_getpass(prompt); if (*mypass == '\0') { mypass = *aname; } *apass = mh_xmalloc((size_t) strlen(mypass) + 1); strcpy (*apass, mypass); } } static int token(void) { char *cp; int c; struct toktab *t; if (feof(cfile)) return (0); while ((c = getc(cfile)) != EOF && (c == '\n' || c == '\t' || c == ' ' || c == ',')) continue; if (c == EOF) return (0); cp = tokval; if (c == '"') { while ((c = getc(cfile)) != EOF && c != '"') { if (c == '\\') c = getc(cfile); *cp++ = c; } } else { *cp++ = c; while ((c = getc(cfile)) != EOF && c != '\n' && c != '\t' && c != ' ' && c != ',') { if (c == '\\') c = getc(cfile); *cp++ = c; } } *cp = 0; if (tokval[0] == 0) return (0); for (t = toktabs; t->tokstr; t++) if (!strcmp(t->tokstr, tokval)) return (t->tval); return (ID); } nmh-1.5/sbr/seq_add.c000644 007761 000765 00000010465 11762736346 014451 0ustar00kenhkenh000000 000000 /* * seq_add.c -- add message(s) to a sequence * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * Add all the SELECTED messages to a (possibly new) sequence. * * If public == 1, make sequence public. * If public == 0, make sequence private. * If public == -1, leave the public/private bit alone for existing * sequences. For new sequences, set this bit based * on its readonly status. * * If error, return 0, else return 1. */ int seq_addsel (struct msgs *mp, char *cp, int public, int zero) { unsigned int i; int msgnum, new_seq = 1; if (!seq_nameok (cp)) return 0; /* * We keep mp->curmsg and "cur" sequence in sync. * See seq_list() and seq_init(). */ if (!strcmp (current,cp)) mp->curmsg = mp->hghsel; /* * Get the number for this sequence */ for (i = 0; mp->msgattrs[i]; i++) { if (!strcmp (mp->msgattrs[i], cp)) { new_seq = 0; break; } } /* * If this is a new sequence, add a slot for it */ if (new_seq) { if (i >= NUMATTRS) { advise (NULL, "only %d sequences allowed (no room for %s)!", NUMATTRS, cp); return 0; } if (!(mp->msgattrs[i] = strdup (cp))) { advise (NULL, "strdup failed"); return 0; } mp->msgattrs[i + 1] = NULL; } /* * If sequence is new, or zero flag is set, then first * clear the bit for this sequence from all messages. */ if ((new_seq || zero) && mp->nummsg > 0) { for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) clear_sequence (mp, i, msgnum); } /* * Now flip on the bit for this sequence * for all selected messages. */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) add_sequence (mp, i, msgnum); /* * Set the public/private bit for this sequence. */ if (public == 1) make_seq_public (mp, i); else if (public == 0) make_seq_private (mp, i); else if (new_seq) { /* * If public == -1, then only set the * public/private bit for new sequences. */ if (is_readonly (mp)) make_seq_private (mp, i); else make_seq_public (mp, i); } mp->msgflags |= SEQMOD; return 1; } /* * Add a message to a (possibly new) sequence. * * If public == 1, make sequence public. * If public == 0, make sequence private. * If public == -1, leave the public/private bit alone for existing * sequences. For new sequences, set this bit based * on its readonly status. * * If error, return 0, else return 1. */ int seq_addmsg (struct msgs *mp, char *cp, int msgnum, int public, int zero) { unsigned int i; int j, new_seq = 1; if (!seq_nameok (cp)) return 0; /* * keep mp->curmsg and msgattrs["cur"] in sync - see seq_list() */ if (!strcmp (current,cp)) mp->curmsg = msgnum; /* * Get the number for this sequence */ for (i = 0; mp->msgattrs[i]; i++) { if (!strcmp (mp->msgattrs[i], cp)) { new_seq = 0; break; } } /* * If this is a new sequence, add a slot for it */ if (new_seq) { if (i >= NUMATTRS) { advise (NULL, "only %d sequences allowed (no room for %s)!", NUMATTRS, cp); return 0; } if (!(mp->msgattrs[i] = strdup (cp))) { advise (NULL, "strdup failed"); return 0; } mp->msgattrs[i + 1] = NULL; } /* * If sequence is new, or zero flag is set, then first * clear the bit for this sequence from all messages. */ if ((new_seq || zero) && mp->nummsg > 0) { for (j = mp->lowmsg; j <= mp->hghmsg; j++) clear_sequence (mp, i, j); } /* * Now flip on the bit for this sequence * for this particular message. */ add_sequence (mp, i, msgnum); /* * Set the public/private bit for this sequence. */ if (public == 1) make_seq_public (mp, i); else if (public == 0) make_seq_private (mp, i); else if (new_seq) { /* * If public == -1, then only set the * public/private bit for new sequences. */ if (is_readonly (mp)) make_seq_private (mp, i); else make_seq_public (mp, i); } mp->msgflags |= SEQMOD; return 1; } nmh-1.5/sbr/seq_bits.c000644 007761 000765 00000001121 11713401274 014630 0ustar00kenhkenh000000 000000 /* * seq_bits.c -- return the snprintb() string for a sequence * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char * seq_bits (struct msgs *mp) { int i; size_t len; static char buffer[BUFSIZ]; strncpy (buffer, MBITS, sizeof(buffer)); for (i = 0; mp->msgattrs[i]; i++) { len = strlen (buffer); snprintf (buffer + len, sizeof(buffer) - len, "%c%s", FFATTRSLOT + 1 + i, mp->msgattrs[i]); } return buffer; } nmh-1.5/sbr/seq_del.c000644 007761 000765 00000005335 11762736346 014465 0ustar00kenhkenh000000 000000 /* * seq_del.c -- delete message(s) from a sequence * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * Delete all SELECTED messages from sequence * * If public == 1, make sequence public. * If public == 0, make sequence private. * If public == -1, leave the public/private bit alone for existing * sequences. For new sequences, set this bit based * on its readonly status. * * If error, return 0, else return 1. */ int seq_delsel (struct msgs *mp, char *cp, int public, int zero) { unsigned int i; int msgnum, new_seq = 1; if (!seq_nameok (cp)) return 0; /* * Get the number for this sequence */ for (i = 0; mp->msgattrs[i]; i++) { if (!strcmp (mp->msgattrs[i], cp)) { new_seq = 0; break; } } /* * If the zero flag is set, first add all existing * messages in this folder to the sequence. */ if (zero) { /* * create the sequence, if necessary */ if (new_seq) { if (i >= NUMATTRS) { advise (NULL, "only %d sequences allowed (no room for %s)!", NUMATTRS, cp); return 0; } if (!(mp->msgattrs[i] = strdup (cp))) { advise (NULL, "strdup failed"); return 0; } mp->msgattrs[i + 1] = NULL; } /* * now add sequence bit to all existing messages */ for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) { if (does_exist (mp, msgnum)) add_sequence (mp, i, msgnum); else clear_sequence (mp, i, msgnum); } } else { if (new_seq) { advise (NULL, "no such sequence as %s", cp); return 0; } } /* * Now clear the bit on all selected messages */ for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_selected (mp, msgnum)) clear_sequence (mp, i, msgnum); /* * Set the public/private bit for this sequence. */ if (public == 1) make_seq_public (mp, i); else if (public == 0) make_seq_private (mp, i); else if (new_seq) { /* * If public == -1, then only set the * public/private bit for new sequences. */ if (is_readonly (mp)) make_seq_private (mp, i); else make_seq_public (mp, i); } mp->msgflags |= SEQMOD; return 1; } /* * Delete message from sequence. * * If error, return 0, else return 1. */ int seq_delmsg (struct msgs *mp, char *cp, int msgnum) { int i; if (!seq_nameok (cp)) return 0; for (i = 0; mp->msgattrs[i]; i++) { if (!strcmp (mp->msgattrs[i], cp)) { clear_sequence (mp, i, msgnum); mp->msgflags |= SEQMOD; return 1; } } advise (NULL, "no such sequence as %s", cp); return 0; } nmh-1.5/sbr/seq_getnum.c000644 007761 000765 00000000741 11713401274 015175 0ustar00kenhkenh000000 000000 /* * seq_getnum.c -- find the index for a sequence * -- return -1 if sequence doesn't exist * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int seq_getnum (struct msgs *mp, char *seqname) { int i; for (i = 0; mp->msgattrs[i]; i++) if (!strcmp (mp->msgattrs[i], seqname)) return i; return -1; } nmh-1.5/sbr/seq_list.c000644 007761 000765 00000004650 11713401274 014654 0ustar00kenhkenh000000 000000 /* * seq_list.c -- Get all messages in a sequence and return them * -- as a space separated list of message ranges. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* allocate this much buffer space at a time */ #define MAXBUFFER 1024 /* static buffer to collect the sequence line */ static char *buffer = NULL; static int len = 0; char * seq_list(struct msgs *mp, char *seqname) { int i, j, seqnum; char *bp; /* On first invocation, allocate initial buffer space */ if (!buffer) { len = MAXBUFFER; buffer = mh_xmalloc ((size_t) len); } /* * Special processing for "cur" sequence. We assume that the * "cur" sequence and mp->curmsg are in sync (see seq_add.c). * This is returned, even if message doesn't exist or the * folder is empty. */ if (!strcmp (current, seqname)) { if (mp->curmsg) { sprintf(buffer, "%s", m_name(mp->curmsg)); return (buffer); } else return (NULL); } /* If the folder is empty, just return NULL */ if (mp->nummsg == 0) return NULL; /* Get the index of the sequence */ if ((seqnum = seq_getnum (mp, seqname)) == -1) return NULL; bp = buffer; for (i = mp->lowmsg; i <= mp->hghmsg; ++i) { /* * If message doesn't exist, or isn't in * the sequence, then continue. */ if (!does_exist(mp, i) || !in_sequence(mp, seqnum, i)) continue; /* * See if we need to enlarge buffer. Since we don't know * exactly how many character this particular message range * will need, we enlarge the buffer if we are within * 50 characters of the end. */ if (bp - buffer > len - 50) { char *newbuf; len += MAXBUFFER; newbuf = mh_xrealloc (buffer, (size_t) len); bp = newbuf + (bp - buffer); buffer = newbuf; } /* * If this is not the first message range in * the list, first add a space. */ if (bp > buffer) *bp++ = ' '; sprintf(bp, "%s", m_name(i)); bp += strlen(bp); j = i; /* Remember beginning of message range */ /* * Scan to the end of this message range */ for (++i; i <= mp->hghmsg && does_exist(mp, i) && in_sequence(mp, seqnum, i); ++i) ; if (i - j > 1) { sprintf(bp, "-%s", m_name(i - 1)); bp += strlen(bp); } } return (bp > buffer? buffer : NULL); } nmh-1.5/sbr/seq_nameok.c000644 007761 000765 00000002201 11713401274 015141 0ustar00kenhkenh000000 000000 /* * seq_nameok.c -- check if a sequence name is ok * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int seq_nameok (unsigned char *s) { unsigned char *pp; if (s == NULL || *s == '\0') { advise (NULL, "empty sequence name"); return 0; } /* * Make sure sequence name doesn't clash with one * of the `reserved' sequence names. */ if (!(strcmp (s, "new") && strcmp (s, "all") && strcmp (s, "first") && strcmp (s, "last") && strcmp (s, "prev") && strcmp (s, "next"))) { advise (NULL, "illegal sequence name: %s", s); return 0; } /* * First character in a sequence name must be * an alphabetic character ... */ if (!isalpha (*s)) { advise (NULL, "illegal sequence name: %s", s); return 0; } /* * and can be followed by zero or more alphanumeric characters */ for (pp = s + 1; *pp; pp++) if (!isalnum (*pp)) { advise (NULL, "illegal sequence name: %s", s); return 0; } return 1; } nmh-1.5/sbr/seq_print.c000644 007761 000765 00000001726 11713401274 015036 0ustar00kenhkenh000000 000000 /* * seq_print.c -- Routines to print sequence information. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #define empty(s) ((s) ? (s) : "") /* * Print all the sequences in a folder */ void seq_printall (struct msgs *mp) { int i; char *list; for (i = 0; mp->msgattrs[i]; i++) { list = seq_list (mp, mp->msgattrs[i]); printf ("%s%s: %s\n", mp->msgattrs[i], is_seq_private (mp, i) ? " (private)" : "", empty(list)); } } /* * Print a particular sequence in a folder */ void seq_print (struct msgs *mp, char *seqname) { int i; char *list; /* get the index of sequence */ i = seq_getnum (mp, seqname); /* get sequence information */ list = seq_list (mp, seqname); printf ("%s%s: %s\n", seqname, (i == -1) ? "" : is_seq_private(mp, i) ? " (private)" : "", empty(list)); } nmh-1.5/sbr/seq_read.c000644 007761 000765 00000013140 11762736346 014625 0ustar00kenhkenh000000 000000 /* * seq_read.c -- read the .mh_sequence file and * -- initialize sequence information * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* * static prototypes */ static int seq_init (struct msgs *, char *, char *); static void seq_public (struct msgs *); static void seq_private (struct msgs *); /* * Get the sequence information for this folder from * .mh_sequences (or equivalent specified in .mh_profile) * or context file (for private sequences). */ void seq_read (struct msgs *mp) { /* * Initialize the list of sequence names. Go ahead and * add the "cur" sequence to the list of sequences. */ mp->msgattrs[0] = getcpy (current); mp->msgattrs[1] = NULL; make_all_public (mp); /* initially, make all public */ /* If folder is empty, don't scan for sequence information */ if (mp->nummsg == 0) return; /* Initialize the public sequences */ seq_public (mp); /* Initialize the private sequences */ seq_private (mp); } /* * read folder's sequences file for public sequences */ static void seq_public (struct msgs *mp) { int state; char *cp, seqfile[PATH_MAX]; char name[NAMESZ], field[BUFSIZ]; FILE *fp; /* * If mh_seq == NULL (such as if nmh been compiled with * NOPUBLICSEQ), or if *mh_seq == '\0' (the user has defined * the "mh-sequences" profile entry, but left it empty), * then just return, and do not initialize any public sequences. */ if (mh_seq == NULL || *mh_seq == '\0') return; /* get filename of sequence file */ snprintf (seqfile, sizeof(seqfile), "%s/%s", mp->foldpath, mh_seq); if ((fp = lkfopen (seqfile, "r")) == NULL) return; /* Use m_getfld to scan sequence file */ for (state = FLD;;) { switch (state = m_getfld (state, name, field, sizeof(field), fp)) { case FLD: case FLDPLUS: case FLDEOF: if (state == FLDPLUS) { cp = getcpy (field); while (state == FLDPLUS) { state = m_getfld (state, name, field, sizeof(field), fp); cp = add (field, cp); } seq_init (mp, getcpy (name), trimcpy (cp)); free (cp); } else { seq_init (mp, getcpy (name), trimcpy (field)); } if (state == FLDEOF) break; continue; case BODY: case BODYEOF: adios (NULL, "no blank lines are permitted in %s", seqfile); /* fall */ case FILEEOF: break; default: adios (NULL, "%s is poorly formatted", seqfile); } break; /* break from for loop */ } lkfclose (fp, seqfile); } /* * Scan profile/context list for private sequences. * * We search the context list for all keys that look like * "atr-seqname-folderpath", and add them as private sequences. */ static void seq_private (struct msgs *mp) { int i, j, alen, plen; char *cp; struct node *np; alen = strlen ("atr-"); plen = strlen (mp->foldpath) + 1; for (np = m_defs; np; np = np->n_next) { if (ssequal ("atr-", np->n_name) && (j = strlen (np->n_name) - plen) > alen && *(np->n_name + j) == '-' && strcmp (mp->foldpath, np->n_name + j + 1) == 0) { cp = getcpy (np->n_name + alen); *(cp + j - alen) = '\0'; if ((i = seq_init (mp, cp, getcpy (np->n_field))) != -1) make_seq_private (mp, i); } } } /* * Add the name of sequence to the list of folder sequences. * Then parse the list of message ranges for this * sequence, and setup the various bit flags for each * message in the sequence. * * Return internal index for the sequence if successful. * Return -1 on error. */ static int seq_init (struct msgs *mp, char *name, char *field) { unsigned int i; int j, k, is_current; char *cp, **ap; /* * Check if this is "cur" sequence, * so we can do some special things. */ is_current = !strcmp (current, name); /* * Search for this sequence name to see if we've seen * it already. If we've seen this sequence before, * then clear the bit for this sequence from all the * mesages in this folder. */ for (i = 0; mp->msgattrs[i]; i++) { if (!strcmp (mp->msgattrs[i], name)) { for (j = mp->lowmsg; j <= mp->hghmsg; j++) clear_sequence (mp, i, j); break; } } /* Return error, if too many sequences */ if (i >= NUMATTRS) { free (name); free (field); return -1; } /* * If we've already seen this sequence name, just free the * name string. Else add it to the list of sequence names. */ if (mp->msgattrs[i]) { free (name); } else { mp->msgattrs[i] = name; mp->msgattrs[i + 1] = NULL; } /* * Split up the different message ranges at whitespace */ for (ap = brkstring (field, " ", "\n"); *ap; ap++) { if ((cp = strchr(*ap, '-'))) *cp++ = '\0'; if ((j = m_atoi (*ap)) > 0) { k = cp ? m_atoi (cp) : j; /* * Keep mp->curmsg and "cur" sequence in synch. Unlike * other sequences, this message doesn't need to exist. * Think about the series of command (rmm; next) to * understand why this can be the case. But if it does * exist, we will still set the bit flag for it like * other sequences. */ if (is_current) mp->curmsg = j; /* * We iterate through messages in this range * and flip on bit for this sequence. */ for (; j <= k; j++) { if (j >= mp->lowmsg && j <= mp->hghmsg && does_exist(mp, j)) add_sequence (mp, i, j); } } } free (field); /* free string containing message ranges */ return i; } nmh-1.5/sbr/seq_save.c000644 007761 000765 00000005536 11762736346 014662 0ustar00kenhkenh000000 000000 /* * seq_save.c -- 1) synchronize sequences * -- 2) save public sequences * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* * 1. If sequence is public and folder is readonly, * then change it to be private * 2a. If sequence is public, then add it to the sequences file * in folder (name specified by mh-sequences profile entry). * 2b. If sequence is private, then add it to the * context file. */ void seq_save (struct msgs *mp) { int i; char flags, *cp, attr[BUFSIZ], seqfile[PATH_MAX]; FILE *fp; sigset_t set, oset; /* check if sequence information has changed */ if (!(mp->msgflags & SEQMOD)) return; mp->msgflags &= ~SEQMOD; fp = NULL; flags = mp->msgflags; /* record folder flags */ /* * If no mh-sequences file is defined, or if a mh-sequences file * is defined but empty (*mh_seq == '\0'), then pretend folder * is readonly. This will force all sequences to be private. */ if (mh_seq == NULL || *mh_seq == '\0') set_readonly (mp); else snprintf (seqfile, sizeof(seqfile), "%s/%s", mp->foldpath, mh_seq); for (i = 0; mp->msgattrs[i]; i++) { snprintf (attr, sizeof(attr), "atr-%s-%s", mp->msgattrs[i], mp->foldpath); /* get space separated list of sequence ranges */ if (!(cp = seq_list(mp, mp->msgattrs[i]))) { context_del (attr); /* delete sequence from context */ continue; } if (is_readonly(mp) || is_seq_private(mp, i)) { priv: /* * sequence is private */ context_replace (attr, cp); /* update sequence in context */ } else { /* * sequence is public */ context_del (attr); /* delete sequence from context */ if (!fp) { /* * Attempt to open file for public sequences. * If that fails (probably because folder is * readonly), then make sequence private. */ if ((fp = lkfopen (seqfile, "w")) == NULL && (unlink (seqfile) == -1 || (fp = lkfopen (seqfile, "w")) == NULL)) { admonish (attr, "unable to write"); goto priv; } /* block a few signals */ sigemptyset (&set); sigaddset(&set, SIGHUP); sigaddset(&set, SIGINT); sigaddset(&set, SIGQUIT); sigaddset(&set, SIGTERM); sigprocmask (SIG_BLOCK, &set, &oset); } fprintf (fp, "%s: %s\n", mp->msgattrs[i], cp); } } if (fp) { lkfclose (fp, seqfile); sigprocmask (SIG_SETMASK, &oset, &set); /* reset signal mask */ } else { /* * If folder is not readonly, and we didn't save any * public sequences, then remove that file. */ if (!is_readonly(mp)) unlink (seqfile); } /* * Reset folder flag, since we may be * pretending that folder is readonly. */ mp->msgflags = flags; } nmh-1.5/sbr/seq_setcur.c000644 007761 000765 00000000705 11713401274 015203 0ustar00kenhkenh000000 000000 /* * seq_setcur.c -- set the current message ("cur" sequence) for a folder * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include void seq_setcur (struct msgs *mp, int msgnum) { /* * Just call seq_addmsg() to update the * "cur" sequence. */ seq_addmsg (mp, current, msgnum, -1, 1); } nmh-1.5/sbr/seq_setprev.c000644 007761 000765 00000001631 11713401274 015365 0ustar00kenhkenh000000 000000 /* * seq_setprev.c -- set the Previous-Sequence * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * Add all the messages currently SELECTED to * the Previous-Sequence. This way, when the next * command is given, there is a convenient way to * selected all the messages used in the previous * command. */ void seq_setprev (struct msgs *mp) { char **ap, *cp, *dp; /* * Get the list of sequences for Previous-Sequence * and split them. */ if ((cp = context_find (psequence))) { dp = getcpy (cp); if (!(ap = brkstring (dp, " ", "\n")) || !*ap) { free (dp); return; } } else { return; } /* Now add all SELECTED messages to each sequence */ for (; *ap; ap++) seq_addsel (mp, *ap, -1, 1); free (dp); } nmh-1.5/sbr/seq_setunseen.c000644 007761 000765 00000002653 11713401274 015713 0ustar00kenhkenh000000 000000 /* * seq_setunseen.c -- add/delete all messages which have the SELECT_UNSEEN * -- bit set to/from the Unseen-Sequence * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * We scan through the folder and act upon all messages * that are marked with the SELECT_UNSEEN bit. * * If seen == 1, delete messages from unseen sequence. * If seen == 0, add messages to unseen sequence. */ void seq_setunseen (struct msgs *mp, int seen) { int msgnum; char **ap, *cp, *dp; /* * Get the list of sequences for Unseen-Sequence * and split them. */ if ((cp = context_find (usequence))) { dp = getcpy (cp); if (!(ap = brkstring (dp, " ", "\n")) || !*ap) { free (dp); return; } } else { return; } /* * Now add/delete each message which has the SELECT_UNSEEN * bit set to/from each of these sequences. */ for (; *ap; ap++) { if (seen) { /* make sure sequence exists first */ if (seq_getnum(mp, *ap) != -1) for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) if (is_unseen (mp, msgnum)) seq_delmsg (mp, *ap, msgnum); } else { for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) if (is_unseen (mp, msgnum)) seq_addmsg (mp, *ap, msgnum, -1, 0); } } free (dp); } nmh-1.5/sbr/showfile.c000644 007761 000765 00000002350 11713401274 014644 0ustar00kenhkenh000000 000000 /* * showfile.c -- invoke the `lproc' command * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int showfile (char **arg, char *file) { pid_t pid; int isdraft, vecp; char *vec[MAXARGS]; context_save(); /* save the context file */ fflush(stdout); /* * If you have your lproc listed as "mhl", * then really invoked the mhlproc instead * (which is usually mhl anyway). */ if (!strcmp (r1bindex (lproc, '/'), "mhl")) lproc = mhlproc; switch (pid = vfork()) { case -1: /* fork error */ advise ("fork", "unable to"); return 1; case 0: /* child */ vecp = 0; vec[vecp++] = r1bindex (lproc, '/'); isdraft = 1; if (arg) { while (*arg) { if (**arg != '-') isdraft = 0; vec[vecp++] = *arg++; } } if (isdraft) { if (!strcmp (vec[0], "show")) vec[vecp++] = "-file"; vec[vecp++] = file; } vec[vecp] = NULL; execvp (lproc, vec); fprintf (stderr, "unable to exec "); perror (lproc); _exit (-1); default: /* parent */ return (pidwait (pid, -1) & 0377 ? 1 : 0); } return 1; /* NOT REACHED */ } nmh-1.5/sbr/sigmsg.awk000755 007761 000765 00000006530 11713401274 014664 0ustar00kenhkenh000000 000000 # # sigmsg.awk -- awk/nawk/gawk script to generate sigmsg.h # # provided by Geoff Wing # # On SunOS 4.1.3 - user-functions don't work properly, also \" problems # Without 0 + hacks some nawks compare numbers as strings # /^[\t ]*#[\t ]*define[\t _]*SIG[A-Z][A-Z0-9]*[\t ]*[1-9][0-9]*/ { sigindex = index($0, "SIG") sigtail = substr($0, sigindex, 80) split(sigtail, tmp) signam = substr(tmp[1], 4, 20) signum = tmp[2] if (sig[signum] == "") { sig[signum] = signam if (0 + max < 0 + signum && signum < 60) max = signum if (signam == "ABRT") { msg[signum] = "abort" } if (signam == "ALRM") { msg[signum] = "alarm" } if (signam == "BUS") { msg[signum] = "bus error" } if (signam == "CHLD") { msg[signum] = "death of child" } if (signam == "CLD") { msg[signum] = "death of child" } if (signam == "CONT") { msg[signum] = "continued" } if (signam == "EMT") { msg[signum] = "EMT instruction" } if (signam == "FPE") { msg[signum] = "floating point exception" } if (signam == "HUP") { msg[signum] = "hangup" } if (signam == "ILL") { msg[signum] = "illegal hardware instruction" } if (signam == "INFO") { msg[signum] = "status request from keyboard" } if (signam == "INT") { msg[signum] = "interrupt" } if (signam == "IO") { msg[signum] = "i/o ready" } if (signam == "IOT") { msg[signum] = "IOT instruction" } if (signam == "KILL") { msg[signum] = "killed" } if (signam == "LOST") { msg[signum] = "resource lost" } if (signam == "PIPE") { msg[signum] = "broken pipe" } if (signam == "POLL") { msg[signum] = "pollable event occurred" } if (signam == "PROF") { msg[signum] = "profile signal" } if (signam == "PWR") { msg[signum] = "power fail" } if (signam == "QUIT") { msg[signum] = "quit" } if (signam == "SEGV") { msg[signum] = "segmentation fault" } if (signam == "SYS") { msg[signum] = "invalid system call" } if (signam == "TERM") { msg[signum] = "terminated" } if (signam == "TRAP") { msg[signum] = "trace trap" } if (signam == "URG") { msg[signum] = "urgent condition" } if (signam == "USR1") { msg[signum] = "user-defined signal 1" } if (signam == "USR2") { msg[signum] = "user-defined signal 2" } if (signam == "VTALRM") { msg[signum] = "virtual time alarm" } if (signam == "WINCH") { msg[signum] = "window size changed" } if (signam == "XCPU") { msg[signum] = "cpu limit exceeded" } if (signam == "XFSZ") { msg[signum] = "file size limit exceeded" } } } END { ps = "%s" ifdstr = sprintf("\t%cstopped%s%c,\n", 34, ps, 34) print "\n/*" print " * sigmsg.h -- architecture-customized signal messages for nmh" print " *" print " * automatically generated by sigmsg.awk" print " */\n" printf("%s %d\n\n", "#define SIGCOUNT", max) print "char *sigmsg[SIGCOUNT+2] = {" print "\tNULL," for (i = 1; i <= 0 + max; i++) if (msg[i] == "") { if (sig[i] == "") printf("\tNULL,\n") else if (sig[i] == "STOP") printf ifdstr, " (signal)", " (signal)" else if (sig[i] == "TSTP") printf ifdstr, "", "" else if (sig[i] == "TTIN") printf ifdstr, " (tty input)", " (tty input)" else if (sig[i] == "TTOU") printf ifdstr, " (tty output)", " (tty output)" else printf("\t%cSIG%s%c,\n", 34, sig[i], 34) } else printf("\t%c%s%c,\n", 34, msg[i], 34) print "\tNULL" print "};" } nmh-1.5/sbr/signals.c000644 007761 000765 00000003411 11762736346 014502 0ustar00kenhkenh000000 000000 /* * signals.c -- general signals interface for nmh * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include /* * A version of the function `signal' that uses reliable * signals, if the machine supports them. Also, (assuming * OS support), it restarts interrupted system calls for all * signals except SIGALRM. * * Since we are now assuming POSIX signal support everywhere, we always * use reliable signals. */ SIGNAL_HANDLER SIGNAL (int sig, SIGNAL_HANDLER func) { struct sigaction act, oact; act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (sig == SIGALRM) { # ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; /* SunOS */ # endif } else { # ifdef SA_RESTART act.sa_flags |= SA_RESTART; /* SVR4, BSD4.4 */ # endif } if (sigaction(sig, &act, &oact) < 0) return (SIG_ERR); return (oact.sa_handler); } /* * A version of the function `signal' that will set * the handler of `sig' to `func' if the signal is * not currently set to SIG_IGN. Also uses reliable * signals if available. */ SIGNAL_HANDLER SIGNAL2 (int sig, SIGNAL_HANDLER func) { struct sigaction act, oact; if (sigaction(sig, NULL, &oact) < 0) return (SIG_ERR); if (oact.sa_handler != SIG_IGN) { act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (sig == SIGALRM) { # ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; /* SunOS */ # endif } else { # ifdef SA_RESTART act.sa_flags |= SA_RESTART; /* SVR4, BSD4.4 */ # endif } if (sigaction(sig, &act, &oact) < 0) return (SIG_ERR); } return (oact.sa_handler); } nmh-1.5/sbr/smatch.c000644 007761 000765 00000001601 11713401274 014301 0ustar00kenhkenh000000 000000 /* * smatch.c -- match a switch (option) * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int smatch(char *string, struct swit *swp) { char *sp, *tcp; int firstone, len; struct swit *tp; firstone = UNKWNSW; if (!string) return firstone; len = strlen(string); for (tp = swp; tp->sw; tp++) { tcp = tp->sw; if (len < abs(tp->minchars)) continue; /* no match */ for (sp = string; *sp == *tcp++;) { if (*sp++ == '\0') return (tp - swp); /* exact match */ } if (*sp) { if (*sp != ' ') continue; /* no match */ if (*--tcp == '\0') return (tp - swp); /* exact match */ } if (firstone == UNKWNSW) firstone = tp - swp; else firstone = AMBIGSW; } return (firstone); } nmh-1.5/sbr/snprintb.c000644 007761 000765 00000001370 11713401274 014664 0ustar00kenhkenh000000 000000 /* * snprintb.c -- snprintf a %b string * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char * snprintb (char *buffer, size_t n, unsigned v, char *bits) { register int i, j; register char c, *bp; snprintf (buffer, n, bits && *bits == 010 ? "0%o" : "0x%x", v); bp = buffer + strlen(buffer); if (bits && *++bits) { j = 0; *bp++ = '<'; while ((i = *bits++)) if (v & (1 << (i - 1))) { if (j++) *bp++ = ','; for (; (c = *bits) > 32; bits++) *bp++ = c; } else for (; *bits > 32; bits++) continue; *bp++ = '>'; *bp = 0; } return buffer; } nmh-1.5/sbr/ssequal.c000644 007761 000765 00000001365 11713401274 014506 0ustar00kenhkenh000000 000000 /* * ssequal.c -- check if a string is a substring of another * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * THIS CODE DOES NOT WORK AS ADVERTISED. * It is actually checking if s1 is a PREFIX of s2. * All calls to this function need to be checked to see * if that needs to be changed. Prefix checking is cheaper, so * should be kept if it's sufficient. */ /* * Check if s1 is a substring of s2. * If yes, then return 1, else return 0. */ int ssequal (char *s1, char *s2) { if (!s1) s1 = ""; if (!s2) s2 = ""; while (*s1) if (*s1++ != *s2++) return 0; return 1; } nmh-1.5/sbr/strcasecmp.c000644 007761 000765 00000002171 11713401274 015171 0ustar00kenhkenh000000 000000 /* * strcasecmp.c -- compare strings, ignoring case * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include /* * Our version of strcasecmp has to deal with NULL strings. * Once that is fixed in the rest of the code, we can use the * native version, instead of this one. */ int mh_strcasecmp (const char *s1, const char *s2) { const unsigned char *us1, *us2; us1 = (const unsigned char *) s1, us2 = (const unsigned char *) s2; if (!us1) us1 = ""; if (!us2) us2 = ""; while (tolower(*us1) == tolower(*us2++)) if (*us1++ == '\0') return (0); return (tolower(*us1) - tolower(*--us2)); } int mh_strncasecmp (const char *s1, const char *s2, size_t n) { const unsigned char *us1, *us2; if (n != 0) { us1 = (const unsigned char *) s1, us2 = (const unsigned char *) s2; do { if (tolower(*us1) != tolower(*us2++)) return (tolower(*us1) - tolower(*--us2)); if (*us1++ == '\0') break; } while (--n != 0); } return (0); } nmh-1.5/sbr/strindex.c000644 007761 000765 00000000653 11713401274 014670 0ustar00kenhkenh000000 000000 /* * strindex.c -- "unsigned" lexical index * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include int stringdex (char *p1, char *p2) { char *p; if (p1 == NULL || p2 == NULL) return -1; for (p = p2; *p; p++) if (uprf (p, p1)) return (p - p2); return -1; } nmh-1.5/sbr/trimcpy.c000644 007761 000765 00000001476 11713401274 014523 0ustar00kenhkenh000000 000000 /* * trimcpy.c -- strip leading and trailing whitespace, * -- replace internal whitespace with spaces, * -- then return a copy. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include char * trimcpy (unsigned char *cp) { unsigned char *sp; /* skip over leading whitespace */ while (isspace(*cp)) cp++; /* start at the end and zap trailing whitespace */ for (sp = cp + strlen(cp) - 1; sp >= cp; sp--) { if (isspace(*sp)) *sp = '\0'; else break; } /* replace remaining whitespace with spaces */ for (sp = cp; *sp; sp++) { if (isspace(*sp)) *sp = ' '; } /* now return a copy */ return getcpy(cp); } nmh-1.5/sbr/uprf.c000644 007761 000765 00000001367 11762736346 014026 0ustar00kenhkenh000000 000000 /* * uprf.c -- "unsigned" lexical prefix * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #ifndef LOCALE # define TO_LOWER 040 # define NO_MASK 000 #endif int uprf (char *c1, char *c2) { int c, mask; if (!(c1 && c2)) return 0; while ((c = *c2++)) { #ifdef LOCALE c &= 0xff; mask = *c1 & 0xff; c = (isalpha(c) && isupper(c)) ? tolower(c) : c; mask = (isalpha(mask) && isupper(mask)) ? tolower(mask) : mask; if (c != mask) #else mask = (isalpha(c) && isalpha(*c1)) ? TO_LOWER : NO_MASK; if ((c | mask) != (*c1 | mask)) #endif return 0; else c1++; } return 1; } nmh-1.5/sbr/utils.c000644 007761 000765 00000011614 11762736346 014206 0ustar00kenhkenh000000 000000 /* * utils.c -- various utility routines * * This code is Copyright (c) 2006, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #include #include /* * We allocate space for messages (msgs array) * this number of elements at a time. */ #define MAXMSGS 256 /* * Safely call malloc */ void * mh_xmalloc(size_t size) { void *memory; if (size == 0) adios(NULL, "Tried to malloc 0 bytes"); memory = malloc(size); if (!memory) adios(NULL, "Malloc failed"); return memory; } /* * Safely call realloc */ void * mh_xrealloc(void *ptr, size_t size) { void *memory; /* Some non-POSIX realloc()s don't cope with realloc(NULL,sz) */ if (!ptr) return mh_xmalloc(size); if (size == 0) adios(NULL, "Tried to realloc 0bytes"); memory = realloc(ptr, size); if (!memory) adios(NULL, "Realloc failed"); return memory; } /* * Return the present working directory, if the current directory does not * exist, or is too long, make / the pwd. */ char * pwd(void) { register char *cp; static char curwd[PATH_MAX]; if (!getcwd (curwd, PATH_MAX)) { admonish (NULL, "unable to determine working directory"); if (!mypath || !*mypath || (strcpy (curwd, mypath), chdir (curwd)) == -1) { strcpy (curwd, "/"); chdir (curwd); } return curwd; } if ((cp = curwd + strlen (curwd) - 1) > curwd && *cp == '/') *cp = '\0'; return curwd; } /* * add -- If "s1" is NULL, this routine just creates a * -- copy of "s2" into newly malloc'ed memory. * -- * -- If "s1" is not NULL, then copy the concatenation * -- of "s1" and "s2" (note the order) into newly * -- malloc'ed memory. Then free "s1". */ char * add (char *s2, char *s1) { char *cp; size_t len1 = 0, len2 = 0; if (s1) len1 = strlen (s1); if (s2) len2 = strlen (s2); cp = mh_xmalloc (len1 + len2 + 1); /* Copy s1 and free it */ if (s1) { memcpy (cp, s1, len1); free (s1); } /* Copy s2 */ if (s2) memcpy (cp + len1, s2, len2); /* Now NULL terminate the string */ cp[len1 + len2] = '\0'; return cp; } /* * addlist * Append an item to a comma separated list */ char * addlist (char *list, char *item) { if (list) list = add (", ", list); return add (item, list); } /* * folder_exists * Check to see if a folder exists. */ int folder_exists(char *folder) { struct stat st; int exists = 0; if (stat (folder, &st) == -1) { /* The folder either doesn't exist, or we hit an error. Either way * return a failure. */ exists = 0; } else { /* We can see a folder with the right name */ exists = 1; } return exists; } /* * create_folder * Check to see if a folder exists, if not, prompt the user to create * it. */ void create_folder(char *folder, int autocreate, void (*done_callback)(int)) { struct stat st; extern int errno; char *cp; if (stat (folder, &st) == -1) { if (errno != ENOENT) adios (folder, "error on folder"); if (autocreate == 0) { /* ask before creating folder */ cp = concat ("Create folder \"", folder, "\"? ", NULL); if (!getanswer (cp)) done_callback (1); free (cp); } else if (autocreate == -1) { /* do not create, so exit */ done_callback (1); } if (!makedir (folder)) adios (NULL, "unable to create folder %s", folder); } } /* * num_digits * Return the number of digits in a nonnegative integer. */ int num_digits (int n) { int ndigits = 0; /* Sanity check */ if (n < 0) adios (NULL, "oops, num_digits called with negative value"); if (n == 0) return 1; while (n) { n /= 10; ndigits++; } return ndigits; } /* * Append a message arg to an array of them, resizing it if necessary. * The function is written to suit the arg parsing code it was extracted * from, and will probably be changed when the other code is cleaned up. */ void app_msgarg(struct msgs_array *msgs, char *cp) { if(msgs->size >= msgs->max) msgs->msgs = mh_xrealloc(msgs->msgs, (msgs->max+=MAXMSGS)*sizeof(*msgs->msgs)); msgs->msgs[msgs->size++] = cp; } /* Open a form or components file */ int open_form(char **form, char *def) { int in; if (*form) { if ((in = open (etcpath (*form), O_RDONLY)) == NOTOK) adios (*form, "unable to open form file"); } else { if ((in = open (etcpath (def), O_RDONLY)) == NOTOK) adios (def, "unable to open default components file"); *form = def; } return in; } nmh-1.5/sbr/vfgets.c000644 007761 000765 00000002432 11713401274 014323 0ustar00kenhkenh000000 000000 /* * vfgets.c -- virtual fgets * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #define QUOTE '\\' int vfgets (FILE *in, char **bp) { int toggle; char *cp, *dp, *ep, *fp; static int len = 0; static char *pp = NULL; if (pp == NULL) pp = mh_xmalloc ((size_t) (len = BUFSIZ)); for (ep = (cp = pp) + len - 1;;) { if (fgets (cp, ep - cp + 1, in) == NULL) { if (cp != pp) { *bp = pp; return 0; } return (ferror (in) && !feof (in) ? -1 : 1); } if ((dp = cp + strlen (cp) - 2) < cp || *dp != QUOTE) { wrong_guess: if (cp > ++dp) adios (NULL, "vfgets() botch -- you lose big"); if (*dp == '\n') { *bp = pp; return 0; } else { cp = ++dp; } } else { for (fp = dp - 1, toggle = 0; fp >= cp; fp--) { if (*fp != QUOTE) break; else toggle = !toggle; } if (toggle) goto wrong_guess; if (*++dp == '\n') { *--dp = 0; cp = dp; } else { cp = ++dp; } } if (cp >= ep) { int curlen = cp - pp; dp = mh_xrealloc (pp, (size_t) (len += BUFSIZ)); cp = dp + curlen; ep = (pp = dp) + len - 1; } } } nmh-1.5/mts/smtp/000777 007761 000765 00000000000 11765271326 013676 5ustar00kenhkenh000000 000000 nmh-1.5/mts/smtp/smtp.c000644 007761 000765 00000111425 11762736346 015032 0ustar00kenhkenh000000 000000 /* * smtp.c -- nmh SMTP interface * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include "smtp.h" #include #include #include #ifdef CYRUS_SASL #include #include #include #include #include #include #include #endif /* CYRUS_SASL */ #ifdef TLS_SUPPORT #include #include #endif /* TLS_SUPPORT */ /* * This module implements an interface to SendMail very similar * to the MMDF mm_(3) routines. The sm_() routines herein talk * SMTP to a sendmail process, mapping SMTP reply codes into * RP_-style codes. */ /* * On older 4.2BSD machines without the POSIX function `sigaction', * the alarm handing stuff for time-outs will NOT work due to the way * syscalls get restarted. This is not really crucial, since SendMail * is generally well-behaved in this area. */ #ifdef SENDMAILBUG /* * It appears that some versions of Sendmail will return Code 451 * when they don't really want to indicate a failure. * "Code 451 almost always means sendmail has deferred; we don't * really want bomb out at this point since sendmail will rectify * things later." So, if you define SENDMAILBUG, Code 451 is * considered the same as Code 250. Yuck! */ #endif #define TRUE 1 #define FALSE 0 #define NBITS ((sizeof (int)) * 8) /* * these codes must all be different! */ #define SM_OPEN 300 /* Changed to 5 minutes to comply with a SHOULD in RFC 1123 */ #define SM_HELO 20 #define SM_RSET 15 #define SM_MAIL 301 /* changed to 5 minutes and a second (for uniqueness), see above */ #define SM_RCPT 302 /* see above */ #define SM_DATA 120 /* see above */ #define SM_TEXT 180 /* see above */ #define SM_DOT 600 /* see above */ #define SM_QUIT 30 #define SM_CLOS 10 #ifdef CYRUS_SASL #define SM_AUTH 45 #endif /* CYRUS_SASL */ static int sm_addrs = 0; static int sm_alarmed = 0; static int sm_child = NOTOK; static int sm_debug = 0; static int sm_nl = TRUE; static int sm_verbose = 0; static FILE *sm_rfp = NULL; static FILE *sm_wfp = NULL; #ifdef CYRUS_SASL /* * Some globals needed by SASL */ static sasl_conn_t *conn = NULL; /* SASL connection state */ static int sasl_complete = 0; /* Has authentication succeded? */ static sasl_ssf_t sasl_ssf; /* Our security strength factor */ static char *sasl_pw_context[2]; /* Context to pass into sm_get_pass */ static int maxoutbuf; /* Maximum crypto output buffer */ static char *sasl_outbuffer; /* SASL output buffer for encryption */ static int sasl_outbuflen; /* Current length of data in outbuf */ static int sm_get_user(void *, int, const char **, unsigned *); static int sm_get_pass(sasl_conn_t *, void *, int, sasl_secret_t **); static sasl_callback_t callbacks[] = { { SASL_CB_USER, sm_get_user, NULL }, #define SM_SASL_N_CB_USER 0 { SASL_CB_PASS, sm_get_pass, NULL }, #define SM_SASL_N_CB_PASS 1 { SASL_CB_AUTHNAME, sm_get_user, NULL }, #define SM_SASL_N_CB_AUTHNAME 2 { SASL_CB_LIST_END, NULL, NULL }, }; #else /* CYRUS_SASL */ int sasl_ssf = 0; #endif /* CYRUS_SASL */ #ifdef TLS_SUPPORT static SSL_CTX *sslctx = NULL; static SSL *ssl = NULL; static BIO *sbior = NULL; static BIO *sbiow = NULL; static BIO *io = NULL; #endif /* TLS_SUPPORT */ #if defined(CYRUS_SASL) || defined(TLS_SUPPORT) #define SASL_MAXRECVBUF 65536 static int sm_fgetc(FILE *); static char *sasl_inbuffer; /* SASL input buffer for encryption */ static char *sasl_inptr; /* Pointer to current inbuf position */ static int sasl_inbuflen; /* Current length of data in inbuf */ #else #define sm_fgetc fgetc #endif static int tls_active = 0; static char *sm_noreply = "No reply text given"; static char *sm_moreply = "; "; struct smtp sm_reply; /* global... */ #define MAXEHLO 20 static int doingEHLO; char *EHLOkeys[MAXEHLO + 1]; /* * static prototypes */ static int smtp_init (char *, char *, char *, int, int, int, int, int, int, int, char *, char *, int); static int sendmail_init (char *, char *, int, int, int, int, int, int, int, char *, char *); static int rclient (char *, char *); static int sm_ierror (char *fmt, ...); static int smtalk (int time, char *fmt, ...); static int sm_wrecord (char *, int); static int sm_wstream (char *, int); static int sm_werror (void); static int smhear (void); static int sm_rrecord (char *, int *); static int sm_rerror (int); static void alrmser (int); static char *EHLOset (char *); static int sm_fwrite(char *, int); static int sm_fputs(char *); static int sm_fputc(int); static void sm_fflush(void); static int sm_fgets(char *, int, FILE *); #ifdef CYRUS_SASL /* * Function prototypes needed for SASL */ static int sm_auth_sasl(char *, int, char *, char *); #endif /* CYRUS_SASL */ int sm_init (char *client, char *server, char *port, int watch, int verbose, int debug, int onex, int queued, int sasl, int saslssf, char *saslmech, char *user, int tls) { if (sm_mts == MTS_SMTP) return smtp_init (client, server, port, watch, verbose, debug, onex, queued, sasl, saslssf, saslmech, user, tls); else return sendmail_init (client, server, watch, verbose, debug, onex, queued, sasl, saslssf, saslmech, user); } static int smtp_init (char *client, char *server, char *port, int watch, int verbose, int debug, int onex, int queued, int sasl, int saslssf, char *saslmech, char *user, int tls) { int result, sd1, sd2; #ifdef CYRUS_SASL char *server_mechs; #else /* CYRUS_SASL */ NMH_UNUSED (sasl); NMH_UNUSED (saslssf); NMH_UNUSED (saslmech); NMH_UNUSED (user); #endif /* CYRUS_SASL */ if (watch) verbose = TRUE; sm_verbose = verbose; sm_debug = debug; if (sm_rfp != NULL && sm_wfp != NULL) goto send_options; if (client == NULL || *client == '\0') { if (clientname) { client = clientname; } else { client = LocalName(1); /* no clientname -> LocalName */ } } /* * Last-ditch check just in case client still isn't set to anything */ if (client == NULL || *client == '\0') client = "localhost"; #if defined(CYRUS_SASL) || defined(TLS_SUPPORT) sasl_inbuffer = malloc(SASL_MAXRECVBUF); if (!sasl_inbuffer) return sm_ierror("Unable to allocate %d bytes for read buffer", SASL_MAXRECVBUF); #endif /* CYRUS_SASL || TLS_SUPPORT */ if ((sd1 = rclient (server, port)) == NOTOK) return RP_BHST; if ((sd2 = dup (sd1)) == NOTOK) { close (sd1); return sm_ierror ("unable to dup"); } SIGNAL (SIGALRM, alrmser); SIGNAL (SIGPIPE, SIG_IGN); if ((sm_rfp = fdopen (sd1, "r")) == NULL || (sm_wfp = fdopen (sd2, "w")) == NULL) { close (sd1); close (sd2); sm_rfp = sm_wfp = NULL; return sm_ierror ("unable to fdopen"); } tls_active = 0; sm_alarmed = 0; alarm (SM_OPEN); result = smhear (); alarm (0); switch (result) { case 220: break; default: sm_end (NOTOK); return RP_RPLY; } /* * Give EHLO or HELO command */ doingEHLO = 1; result = smtalk (SM_HELO, "EHLO %s", client); doingEHLO = 0; if (result >= 500 && result <= 599) result = smtalk (SM_HELO, "HELO %s", client); if (result != 250) { sm_end (NOTOK); return RP_RPLY; } #ifdef TLS_SUPPORT /* * If the user requested TLS support, then try to do the STARTTLS command * as part of the initial dialog. Assuming this works, we then need to * restart the EHLO dialog after TLS negotiation is complete. */ if (tls) { BIO *ssl_bio; if (! EHLOset("STARTTLS")) { sm_end(NOTOK); return sm_ierror("SMTP server does not support TLS"); } result = smtalk(SM_HELO, "STARTTLS"); if (result != 220) { sm_end(NOTOK); return RP_RPLY; } /* * Okay, the other side should be waiting for us to start TLS * negotiation. Oblige them. */ if (! sslctx) { const SSL_METHOD *method; SSL_library_init(); SSL_load_error_strings(); method = TLSv1_client_method(); /* Not sure about this */ sslctx = SSL_CTX_new(method); if (! sslctx) { sm_end(NOTOK); return sm_ierror("Unable to initialize OpenSSL context: %s", ERR_error_string(ERR_get_error(), NULL)); } } ssl = SSL_new(sslctx); if (! ssl) { sm_end(NOTOK); return sm_ierror("Unable to create SSL connection: %s", ERR_error_string(ERR_get_error(), NULL)); } sbior = BIO_new_socket(fileno(sm_rfp), BIO_NOCLOSE); sbiow = BIO_new_socket(fileno(sm_wfp), BIO_NOCLOSE); if (sbior == NULL || sbiow == NULL) { sm_end(NOTOK); return sm_ierror("Unable to create BIO endpoints: %s", ERR_error_string(ERR_get_error(), NULL)); } SSL_set_bio(ssl, sbior, sbiow); SSL_set_connect_state(ssl); /* * Set up a BIO to handle buffering for us */ io = BIO_new(BIO_f_buffer()); if (! io) { sm_end(NOTOK); return sm_ierror("Unable to create a buffer BIO: %s", ERR_error_string(ERR_get_error(), NULL)); } ssl_bio = BIO_new(BIO_f_ssl()); if (! ssl_bio) { sm_end(NOTOK); return sm_ierror("Unable to create a SSL BIO: %s", ERR_error_string(ERR_get_error(), NULL)); } BIO_set_ssl(ssl_bio, ssl, BIO_CLOSE); BIO_push(io, ssl_bio); /* * Try doing the handshake now */ if (BIO_do_handshake(io) < 1) { sm_end(NOTOK); return sm_ierror("Unable to negotiate SSL connection: %s", ERR_error_string(ERR_get_error(), NULL)); } if (sm_debug) { const SSL_CIPHER *cipher = SSL_get_current_cipher(ssl); printf("SSL negotiation successful: %s(%d) %s\n", SSL_CIPHER_get_name(cipher), SSL_CIPHER_get_bits(cipher, NULL), SSL_CIPHER_get_version(cipher)); } tls_active = 1; doingEHLO = 1; result = smtalk (SM_HELO, "EHLO %s", client); doingEHLO = 0; if (result != 250) { sm_end (NOTOK); return RP_RPLY; } } #else /* TLS_SUPPORT */ NMH_UNUSED (tls); #endif /* TLS_SUPPORT */ #ifdef CYRUS_SASL /* * If the user asked for SASL, then check to see if the SMTP server * supports it. Otherwise, error out (because the SMTP server * might have been spoofed; we don't want to just silently not * do authentication */ if (sasl) { if (! (server_mechs = EHLOset("AUTH"))) { sm_end(NOTOK); return sm_ierror("SMTP server does not support SASL"); } if (saslmech && stringdex(saslmech, server_mechs) == -1) { sm_end(NOTOK); return sm_ierror("Requested SASL mech \"%s\" is not in the " "list of supported mechanisms:\n%s", saslmech, server_mechs); } if (sm_auth_sasl(user, saslssf, saslmech ? saslmech : server_mechs, server) != RP_OK) { sm_end(NOTOK); return NOTOK; } } #endif /* CYRUS_SASL */ send_options: ; if (watch && EHLOset ("XVRB")) smtalk (SM_HELO, "VERB on"); if (onex && EHLOset ("XONE")) smtalk (SM_HELO, "ONEX"); if (queued && EHLOset ("XQUE")) smtalk (SM_HELO, "QUED"); return RP_OK; } int sendmail_init (char *client, char *server, int watch, int verbose, int debug, int onex, int queued, int sasl, int saslssf, char *saslmech, char *user) { unsigned int i, result, vecp; int pdi[2], pdo[2]; char *vec[15]; #ifdef CYRUS_SASL char *server_mechs; #else /* CYRUS_SASL */ NMH_UNUSED (server); NMH_UNUSED (sasl); NMH_UNUSED (saslssf); NMH_UNUSED (saslmech); NMH_UNUSED (user); #endif /* CYRUS_SASL */ if (watch) verbose = TRUE; sm_verbose = verbose; sm_debug = debug; if (sm_rfp != NULL && sm_wfp != NULL) return RP_OK; if (client == NULL || *client == '\0') { if (clientname) client = clientname; else client = LocalName(1); /* no clientname -> LocalName */ } /* * Last-ditch check just in case client still isn't set to anything */ if (client == NULL || *client == '\0') client = "localhost"; #if defined(CYRUS_SASL) || defined(TLS_SUPPORT) sasl_inbuffer = malloc(SASL_MAXRECVBUF); if (!sasl_inbuffer) return sm_ierror("Unable to allocate %d bytes for read buffer", SASL_MAXRECVBUF); #endif /* CYRUS_SASL || TLS_SUPPORT */ if (pipe (pdi) == NOTOK) return sm_ierror ("no pipes"); if (pipe (pdo) == NOTOK) { close (pdi[0]); close (pdi[1]); return sm_ierror ("no pipes"); } for (i = 0; (sm_child = fork ()) == NOTOK && i < 5; i++) sleep (5); switch (sm_child) { case NOTOK: close (pdo[0]); close (pdo[1]); close (pdi[0]); close (pdi[1]); return sm_ierror ("unable to fork"); case OK: if (pdo[0] != fileno (stdin)) dup2 (pdo[0], fileno (stdin)); if (pdi[1] != fileno (stdout)) dup2 (pdi[1], fileno (stdout)); if (pdi[1] != fileno (stderr)) dup2 (pdi[1], fileno (stderr)); for (i = fileno (stderr) + 1; i < NBITS; i++) close (i); vecp = 0; vec[vecp++] = r1bindex (sendmail, '/'); vec[vecp++] = "-bs"; vec[vecp++] = watch ? "-odi" : queued ? "-odq" : "-odb"; vec[vecp++] = "-oem"; vec[vecp++] = "-om"; # ifndef RAND if (verbose) vec[vecp++] = "-ov"; # endif /* not RAND */ vec[vecp++] = NULL; setgid (getegid ()); setuid (geteuid ()); execvp (sendmail, vec); fprintf (stderr, "unable to exec "); perror (sendmail); _exit (-1); /* NOTREACHED */ default: SIGNAL (SIGALRM, alrmser); SIGNAL (SIGPIPE, SIG_IGN); close (pdi[1]); close (pdo[0]); if ((sm_rfp = fdopen (pdi[0], "r")) == NULL || (sm_wfp = fdopen (pdo[1], "w")) == NULL) { close (pdi[0]); close (pdo[1]); sm_rfp = sm_wfp = NULL; return sm_ierror ("unable to fdopen"); } sm_alarmed = 0; alarm (SM_OPEN); result = smhear (); alarm (0); switch (result) { case 220: break; default: sm_end (NOTOK); return RP_RPLY; } doingEHLO = 1; result = smtalk (SM_HELO, "EHLO %s", client); doingEHLO = 0; if (500 <= result && result <= 599) result = smtalk (SM_HELO, "HELO %s", client); switch (result) { case 250: break; default: sm_end (NOTOK); return RP_RPLY; } #ifdef CYRUS_SASL /* * If the user asked for SASL, then check to see if the SMTP server * supports it. Otherwise, error out (because the SMTP server * might have been spoofed; we don't want to just silently not * do authentication */ if (sasl) { if (! (server_mechs = EHLOset("AUTH"))) { sm_end(NOTOK); return sm_ierror("SMTP server does not support SASL"); } if (saslmech && stringdex(saslmech, server_mechs) == -1) { sm_end(NOTOK); return sm_ierror("Requested SASL mech \"%s\" is not in the " "list of supported mechanisms:\n%s", saslmech, server_mechs); } if (sm_auth_sasl(user, saslssf, saslmech ? saslmech : server_mechs, server) != RP_OK) { sm_end(NOTOK); return NOTOK; } } #endif /* CYRUS_SASL */ if (onex) smtalk (SM_HELO, "ONEX"); if (watch) smtalk (SM_HELO, "VERB on"); return RP_OK; } } static int rclient (char *server, char *service) { int sd; char response[BUFSIZ]; if ((sd = client (server, service, response, sizeof(response), sm_debug)) != NOTOK) return sd; sm_ierror ("%s", response); return NOTOK; } int sm_winit (char *from) { switch (smtalk (SM_MAIL, "MAIL FROM:<%s>", from)) { case 250: sm_addrs = 0; return RP_OK; case 500: case 501: case 552: return RP_PARM; default: return RP_RPLY; } } int sm_wadr (char *mbox, char *host, char *path) { switch (smtalk (SM_RCPT, host && *host ? "RCPT TO:<%s%s@%s>" : "RCPT TO:<%s%s>", path ? path : "", mbox, host)) { case 250: case 251: sm_addrs++; return RP_OK; case 451: #ifdef SENDMAILBUG sm_addrs++; return RP_OK; #endif /* SENDMAILBUG */ case 421: case 450: case 452: return RP_NO; case 500: case 501: return RP_PARM; case 550: case 551: case 552: case 553: return RP_USER; default: return RP_RPLY; } } int sm_waend (void) { switch (smtalk (SM_DATA, "DATA")) { case 354: sm_nl = TRUE; return RP_OK; case 451: #ifdef SENDMAILBUG sm_nl = TRUE; return RP_OK; #endif /* SENDMAILBUG */ case 421: return RP_NO; case 500: case 501: case 503: case 554: return RP_NDEL; default: return RP_RPLY; } } int sm_wtxt (char *buffer, int len) { int result; sm_alarmed = 0; alarm (SM_TEXT); result = sm_wstream (buffer, len); alarm (0); return (result == NOTOK ? RP_BHST : RP_OK); } int sm_wtend (void) { if (sm_wstream ((char *) NULL, 0) == NOTOK) return RP_BHST; switch (smtalk (SM_DOT + 3 * sm_addrs, ".")) { case 250: case 251: return RP_OK; case 451: #ifdef SENDMAILBUG return RP_OK; #endif /* SENDMAILBUG */ case 452: default: return RP_NO; case 552: case 554: return RP_NDEL; } } int sm_end (int type) { int status; struct smtp sm_note; if (sm_mts == MTS_SENDMAIL) { switch (sm_child) { case NOTOK: case OK: return RP_OK; default: break; } } if (sm_rfp == NULL && sm_wfp == NULL) return RP_OK; switch (type) { case OK: smtalk (SM_QUIT, "QUIT"); break; case NOTOK: sm_note.code = sm_reply.code; sm_note.length = sm_reply.length; memcpy (sm_note.text, sm_reply.text, sm_reply.length + 1);/* fall */ case DONE: if (smtalk (SM_RSET, "RSET") == 250 && type == DONE) return RP_OK; if (sm_mts == MTS_SMTP) smtalk (SM_QUIT, "QUIT"); else { kill (sm_child, SIGKILL); discard (sm_rfp); discard (sm_wfp); } if (type == NOTOK) { sm_reply.code = sm_note.code; sm_reply.length = sm_note.length; memcpy (sm_reply.text, sm_note.text, sm_note.length + 1); } break; } #ifdef TLS_SUPPORT if (tls_active) { BIO_ssl_shutdown(io); BIO_free_all(io); } #endif /* TLS_SUPPORT */ if (sm_rfp != NULL) { alarm (SM_CLOS); fclose (sm_rfp); alarm (0); } if (sm_wfp != NULL) { alarm (SM_CLOS); fclose (sm_wfp); alarm (0); } if (sm_mts == MTS_SMTP) { status = 0; #ifdef CYRUS_SASL if (conn) { sasl_dispose(&conn); if (sasl_outbuffer) { free(sasl_outbuffer); } } if (sasl_inbuffer) free(sasl_inbuffer); #endif /* CYRUS_SASL */ } else { status = pidwait (sm_child, OK); sm_child = NOTOK; } sm_rfp = sm_wfp = NULL; return (status ? RP_BHST : RP_OK); } #ifdef CYRUS_SASL /* * This function implements SASL authentication for SMTP. If this function * completes successfully, then authentication is successful and we've * (optionally) negotiated a security layer. */ static int sm_auth_sasl(char *user, int saslssf, char *mechlist, char *inhost) { int result, status; unsigned int buflen, outlen; char *buf, outbuf[BUFSIZ], host[NI_MAXHOST]; const char *chosen_mech; sasl_security_properties_t secprops; sasl_ssf_t *ssf; int *outbufmax; /* * Initialize the callback contexts */ if (user == NULL) user = getusername(); callbacks[SM_SASL_N_CB_USER].context = user; callbacks[SM_SASL_N_CB_AUTHNAME].context = user; /* * This is a _bit_ of a hack ... but if the hostname wasn't supplied * to us on the command line, then call getpeername and do a * reverse-address lookup on the IP address to get the name. */ memset(host, 0, sizeof(host)); if (!inhost) { struct sockaddr_storage sin; socklen_t len = sizeof(sin); int result; if (getpeername(fileno(sm_wfp), (struct sockaddr *) &sin, &len) < 0) { sm_ierror("getpeername on SMTP socket failed: %s", strerror(errno)); return NOTOK; } result = getnameinfo((struct sockaddr *) &sin, len, host, sizeof(host), NULL, 0, NI_NAMEREQD); if (result != 0) { sm_ierror("Unable to look up name of connected host: %s", gai_strerror(result)); return NOTOK; } } else { strncpy(host, inhost, sizeof(host) - 1); } sasl_pw_context[0] = host; sasl_pw_context[1] = user; callbacks[SM_SASL_N_CB_PASS].context = sasl_pw_context; result = sasl_client_init(callbacks); if (result != SASL_OK) { sm_ierror("SASL library initialization failed: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } result = sasl_client_new("smtp", host, NULL, NULL, NULL, 0, &conn); if (result != SASL_OK) { sm_ierror("SASL client initialization failed: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } /* * Initialize the security properties. But if TLS is active, then * don't negotiate encryption here. */ memset(&secprops, 0, sizeof(secprops)); secprops.maxbufsize = SASL_MAXRECVBUF; secprops.max_ssf = tls_active ? 0 : (saslssf != -1 ? (unsigned int) saslssf : UINT_MAX); result = sasl_setprop(conn, SASL_SEC_PROPS, &secprops); if (result != SASL_OK) { sm_ierror("SASL security property initialization failed: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } /* * Start the actual protocol. Feed the mech list into the library * and get out a possible initial challenge */ result = sasl_client_start(conn, mechlist, NULL, (const char **) &buf, &buflen, (const char **) &chosen_mech); if (result != SASL_OK && result != SASL_CONTINUE) { sm_ierror("SASL client start failed: %s", sasl_errdetail(conn)); return NOTOK; } /* * If we got an initial challenge, send it as part of the AUTH * command; otherwise, just send a plain AUTH command. */ if (buflen) { status = sasl_encode64(buf, buflen, outbuf, sizeof(outbuf), NULL); if (status != SASL_OK) { sm_ierror("SASL base64 encode failed: %s", sasl_errstring(status, NULL, NULL)); return NOTOK; } status = smtalk(SM_AUTH, "AUTH %s %s", chosen_mech, outbuf); } else status = smtalk(SM_AUTH, "AUTH %s", chosen_mech); /* * Now we loop until we either fail, get a SASL_OK, or a 235 * response code. Receive the challenges and process them until * we're all done. */ while (result == SASL_CONTINUE) { /* * If we get a 235 response, that means authentication has * succeeded and we need to break out of the loop (yes, even if * we still get SASL_CONTINUE from sasl_client_step()). * * Otherwise, if we get a message that doesn't seem to be a * valid response, then abort */ if (status == 235) break; else if (status < 300 || status > 399) return RP_BHST; /* * Special case; a zero-length response from the SMTP server * is returned as a single =. If we get that, then set buflen * to be zero. Otherwise, just decode the response. */ if (strcmp("=", sm_reply.text) == 0) { outlen = 0; } else { result = sasl_decode64(sm_reply.text, sm_reply.length, outbuf, sizeof(outbuf), &outlen); if (result != SASL_OK) { smtalk(SM_AUTH, "*"); sm_ierror("SASL base64 decode failed: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } } result = sasl_client_step(conn, outbuf, outlen, NULL, (const char **) &buf, &buflen); if (result != SASL_OK && result != SASL_CONTINUE) { smtalk(SM_AUTH, "*"); sm_ierror("SASL client negotiation failed: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } status = sasl_encode64(buf, buflen, outbuf, sizeof(outbuf), NULL); if (status != SASL_OK) { smtalk(SM_AUTH, "*"); sm_ierror("SASL base64 encode failed: %s", sasl_errstring(status, NULL, NULL)); return NOTOK; } status = smtalk(SM_AUTH, outbuf); } /* * Make sure that we got the correct response */ if (status < 200 || status > 299) return RP_BHST; /* * We _should_ have completed the authentication successfully. * Get a few properties from the authentication exchange. */ result = sasl_getprop(conn, SASL_MAXOUTBUF, (const void **) &outbufmax); if (result != SASL_OK) { sm_ierror("Cannot retrieve SASL negotiated output buffer size: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } maxoutbuf = *outbufmax; result = sasl_getprop(conn, SASL_SSF, (const void **) &ssf); sasl_ssf = *ssf; if (result != SASL_OK) { sm_ierror("Cannot retrieve SASL negotiated security strength " "factor: %s", sasl_errstring(result, NULL, NULL)); return NOTOK; } if (sasl_ssf > 0) { sasl_outbuffer = malloc(maxoutbuf); if (sasl_outbuffer == NULL) { sm_ierror("Unable to allocate %d bytes for SASL output " "buffer", maxoutbuf); return NOTOK; } sasl_outbuflen = 0; sasl_inbuflen = 0; sasl_inptr = sasl_inbuffer; } else { sasl_outbuffer = NULL; /* Don't NULL out sasl_inbuffer because it could be used in sm_fgetc (). */ } sasl_complete = 1; return RP_OK; } /* * Our callback functions to feed data to the SASL library */ static int sm_get_user(void *context, int id, const char **result, unsigned *len) { char *user = (char *) context; if (! result || ((id != SASL_CB_USER) && (id != SASL_CB_AUTHNAME))) return SASL_BADPARAM; *result = user; if (len) *len = strlen(user); return SASL_OK; } static int sm_get_pass(sasl_conn_t *conn, void *context, int id, sasl_secret_t **psecret) { char **pw_context = (char **) context; char *pass = NULL; int len; NMH_UNUSED (conn); if (! psecret || id != SASL_CB_PASS) return SASL_BADPARAM; ruserpass(pw_context[0], &(pw_context[1]), &pass); len = strlen(pass); *psecret = (sasl_secret_t *) malloc(sizeof(sasl_secret_t) + len); if (! *psecret) { free(pass); return SASL_NOMEM; } (*psecret)->len = len; strcpy((char *) (*psecret)->data, pass); /* free(pass); */ return SASL_OK; } #endif /* CYRUS_SASL */ static int sm_ierror (char *fmt, ...) { va_list ap; va_start(ap, fmt); vsnprintf (sm_reply.text, sizeof(sm_reply.text), fmt, ap); va_end(ap); sm_reply.length = strlen (sm_reply.text); sm_reply.code = NOTOK; return RP_BHST; } static int smtalk (int time, char *fmt, ...) { va_list ap; int result; char buffer[BUFSIZ]; va_start(ap, fmt); vsnprintf (buffer, sizeof(buffer), fmt, ap); va_end(ap); if (sm_debug) { if (sasl_ssf) printf("(sasl-encrypted) "); if (tls_active) printf("(tls-encrypted) "); printf ("=> %s\n", buffer); fflush (stdout); } sm_alarmed = 0; alarm ((unsigned) time); if ((result = sm_wrecord (buffer, strlen (buffer))) != NOTOK) result = smhear (); alarm (0); return result; } /* * write the buffer to the open SMTP channel */ static int sm_wrecord (char *buffer, int len) { if (sm_wfp == NULL) return sm_werror (); sm_fwrite (buffer, len); sm_fputs ("\r\n"); sm_fflush (); return (ferror (sm_wfp) ? sm_werror () : OK); } static int sm_wstream (char *buffer, int len) { char *bp; static char lc = '\0'; if (sm_wfp == NULL) return sm_werror (); if (buffer == NULL && len == 0) { if (lc != '\n') sm_fputs ("\r\n"); lc = '\0'; return (ferror (sm_wfp) ? sm_werror () : OK); } for (bp = buffer; len > 0; bp++, len--) { switch (*bp) { case '\n': sm_nl = TRUE; sm_fputc ('\r'); break; case '.': if (sm_nl) sm_fputc ('.');/* FALL THROUGH */ default: sm_nl = FALSE; } sm_fputc (*bp); if (ferror (sm_wfp)) return sm_werror (); } if (bp > buffer) lc = *--bp; return (ferror (sm_wfp) ? sm_werror () : OK); } /* * Write out to the network, but do buffering for SASL (if enabled) */ static int sm_fwrite(char *buffer, int len) { #ifdef CYRUS_SASL const char *output; unsigned int outputlen; if (sasl_complete == 0 || sasl_ssf == 0) { #endif /* CYRUS_SASL */ #ifdef TLS_SUPPORT if (tls_active) { int ret; ret = BIO_write(io, buffer, len); if (ret <= 0) { sm_ierror("TLS error during write: %s", ERR_error_string(ERR_get_error(), NULL)); return NOTOK; } } else #endif /* TLS_SUPPORT */ fwrite(buffer, sizeof(*buffer), len, sm_wfp); #ifdef CYRUS_SASL } else { while (len >= maxoutbuf - sasl_outbuflen) { memcpy(sasl_outbuffer + sasl_outbuflen, buffer, maxoutbuf - sasl_outbuflen); len -= maxoutbuf - sasl_outbuflen; sasl_outbuflen = 0; if (sasl_encode(conn, sasl_outbuffer, maxoutbuf, &output, &outputlen) != SASL_OK) { sm_ierror("Unable to SASL encode connection data: %s", sasl_errdetail(conn)); return NOTOK; } fwrite(output, sizeof(*output), outputlen, sm_wfp); } if (len > 0) { memcpy(sasl_outbuffer + sasl_outbuflen, buffer, len); sasl_outbuflen += len; } } #endif /* CYRUS_SASL */ return ferror(sm_wfp) ? NOTOK : RP_OK; } /* * Convenience functions to replace occurences of fputs() and fputc() */ static int sm_fputs(char *buffer) { return sm_fwrite(buffer, strlen(buffer)); } static int sm_fputc(int c) { char h = c; return sm_fwrite(&h, 1); } /* * Flush out any pending data on the connection */ static void sm_fflush(void) { #ifdef CYRUS_SASL const char *output; unsigned int outputlen; int result; if (sasl_complete == 1 && sasl_ssf > 0 && sasl_outbuflen > 0) { result = sasl_encode(conn, sasl_outbuffer, sasl_outbuflen, &output, &outputlen); if (result != SASL_OK) { sm_ierror("Unable to SASL encode connection data: %s", sasl_errdetail(conn)); return; } fwrite(output, sizeof(*output), outputlen, sm_wfp); sasl_outbuflen = 0; } #endif /* CYRUS_SASL */ #ifdef TLS_SUPPORT if (tls_active) { (void) BIO_flush(io); } #endif /* TLS_SUPPORT */ fflush(sm_wfp); } static int sm_werror (void) { sm_reply.length = strlen (strcpy (sm_reply.text, sm_wfp == NULL ? "no socket opened" : sm_alarmed ? "write to socket timed out" : "error writing to socket")); return (sm_reply.code = NOTOK); } static int smhear (void) { int i, code, cont, bc = 0, rc, more; unsigned char *bp; char *rp; char **ehlo = NULL, buffer[BUFSIZ]; if (doingEHLO) { static int at_least_once = 0; if (at_least_once) { char *ep; for (ehlo = EHLOkeys; *ehlo; ehlo++) { ep = *ehlo; free (ep); } } else { at_least_once = 1; } ehlo = EHLOkeys; *ehlo = NULL; } again: ; sm_reply.length = 0; sm_reply.text[0] = 0; rp = sm_reply.text; rc = sizeof(sm_reply.text) - 1; for (more = FALSE; sm_rrecord ((char *) (bp = (unsigned char *) buffer), &bc) != NOTOK ; ) { if (sm_debug) { if (sasl_ssf > 0) printf("(sasl-decrypted) "); if (tls_active) printf("(tls-decrypted) "); printf ("<= %s\n", buffer); fflush (stdout); } if (doingEHLO && strncmp (buffer, "250", sizeof("250") - 1) == 0 && (buffer[3] == '-' || doingEHLO == 2) && buffer[4]) { if (doingEHLO == 2) { if ((*ehlo = malloc ((size_t) (strlen (buffer + 4) + 1)))) { strcpy (*ehlo++, buffer + 4); *ehlo = NULL; if (ehlo >= EHLOkeys + MAXEHLO) doingEHLO = 0; } else doingEHLO = 0; } else doingEHLO = 2; } for (; bc > 0 && (!isascii (*bp) || !isdigit (*bp)); bp++, bc--) continue; cont = FALSE; code = atoi ((char *) bp); bp += 3, bc -= 3; for (; bc > 0 && isspace (*bp); bp++, bc--) continue; if (bc > 0 && *bp == '-') { cont = TRUE; bp++, bc--; for (; bc > 0 && isspace (*bp); bp++, bc--) continue; } if (more) { if (code != sm_reply.code || cont) continue; more = FALSE; } else { sm_reply.code = code; more = cont; if (bc <= 0) { /* can never fail to 0-terminate because of size of buffer vs fixed string */ strncpy (buffer, sm_noreply, sizeof(buffer)); bp = (unsigned char *) buffer; bc = strlen (sm_noreply); } } if ((i = min (bc, rc)) > 0) { memcpy (rp, bp, i); rp += i; rc -= i; i = strlen(sm_moreply); if (more && rc > i + 1) { memcpy (rp, sm_moreply, i); /* safe because of check in if() */ rp += i; rc -= i; } } if (more) continue; if (sm_reply.code < 100) { if (sm_verbose) { printf ("%s\n", sm_reply.text); fflush (stdout); } goto again; } sm_reply.length = rp - sm_reply.text; sm_reply.text[sm_reply.length] = 0; return sm_reply.code; } return NOTOK; } static int sm_rrecord (char *buffer, int *len) { int retval; if (sm_rfp == NULL) return sm_rerror(0); buffer[*len = 0] = 0; if ((retval = sm_fgets (buffer, BUFSIZ, sm_rfp)) != RP_OK) return sm_rerror (retval); *len = strlen (buffer); /* *len should be >0 except on EOF, but check for safety's sake */ if (*len == 0) return sm_rerror (RP_EOF); if (buffer[*len - 1] != '\n') while ((retval = sm_fgetc (sm_rfp)) != '\n' && retval != EOF && retval != -2) continue; else if ((*len > 1) && (buffer[*len - 2] == '\r')) *len -= 1; *len -= 1; buffer[*len] = 0; return OK; } /* * Our version of fgets, which calls our private fgetc function */ static int sm_fgets(char *buffer, int size, FILE *f) { int c; do { c = sm_fgetc(f); if (c == EOF) return RP_EOF; if (c == -2) return NOTOK; *buffer++ = c; } while (size > 1 && c != '\n'); *buffer = '\0'; return RP_OK; } #if defined(CYRUS_SASL) || defined(TLS_SUPPORT) /* * Read from the network, but do SASL or TLS encryption */ static int sm_fgetc(FILE *f) { char tmpbuf[BUFSIZ], *retbuf; unsigned int retbufsize = 0; int cc, result; /* * If we have leftover data, return it */ if (sasl_inbuflen) { sasl_inbuflen--; return (int) *sasl_inptr++; } /* * If not, read from the network until we have some data to return */ while (retbufsize == 0) { #ifdef TLS_SUPPORT if (tls_active) { cc = SSL_read(ssl, tmpbuf, sizeof(tmpbuf)); if (cc == 0) { result = SSL_get_error(ssl, cc); if (result != SSL_ERROR_ZERO_RETURN) { sm_ierror("TLS peer aborted connection"); } return EOF; } if (cc < 0) { sm_ierror("SSL_read failed: %s", ERR_error_string(ERR_get_error(), NULL)); return -2; } } else #endif /* TLS_SUPPORT */ cc = read(fileno(f), tmpbuf, sizeof(tmpbuf)); if (cc == 0) return EOF; if (cc < 0) { sm_ierror("Unable to read from network: %s", strerror(errno)); return -2; } /* * Don't call sasl_decode unless sasl is complete and we have * encryption working */ #ifdef CYRUS_SASL if (sasl_complete == 0 || sasl_ssf == 0) { retbuf = tmpbuf; retbufsize = cc; } else { result = sasl_decode(conn, tmpbuf, cc, (const char **) &retbuf, &retbufsize); if (result != SASL_OK) { sm_ierror("Unable to decode SASL network data: %s", sasl_errdetail(conn)); return -2; } } #else /* ! CYRUS_SASL */ retbuf = tmpbuf; retbufsize = cc; #endif /* CYRUS_SASL */ } if (retbufsize > SASL_MAXRECVBUF) { sm_ierror("Received data (%d bytes) is larger than the buffer " "size (%d bytes)", retbufsize, SASL_MAXRECVBUF); return -2; } memcpy(sasl_inbuffer, retbuf, retbufsize); sasl_inptr = sasl_inbuffer + 1; sasl_inbuflen = retbufsize - 1; return (int) sasl_inbuffer[0]; } #endif /* CYRUS_SASL || TLS_SUPPORT */ static int sm_rerror (int rc) { if (sm_mts == MTS_SMTP) sm_reply.length = strlen (strcpy (sm_reply.text, sm_rfp == NULL ? "no socket opened" : sm_alarmed ? "read from socket timed out" : rc == RP_EOF ? "premature end-of-file on socket" : "error reading from socket")); else sm_reply.length = strlen (strcpy (sm_reply.text, sm_rfp == NULL ? "no pipe opened" : sm_alarmed ? "read from pipe timed out" : rc == RP_EOF ? "premature end-of-file on pipe" : "error reading from pipe")); return (sm_reply.code = NOTOK); } static void alrmser (int i) { NMH_UNUSED (i); #ifndef RELIABLE_SIGNALS SIGNAL (SIGALRM, alrmser); #endif sm_alarmed++; if (sm_debug) { printf ("timed out...\n"); fflush (stdout); } } char * rp_string (int code) { char *text; static char buffer[BUFSIZ]; switch (sm_reply.code != NOTOK ? code : NOTOK) { case RP_AOK: text = "AOK"; break; case RP_MOK: text = "MOK"; break; case RP_OK: text = "OK"; break; case RP_RPLY: text = "RPLY"; break; case RP_BHST: default: text = "BHST"; snprintf (buffer, sizeof(buffer), "[%s] %s", text, sm_reply.text); return buffer; case RP_PARM: text = "PARM"; break; case RP_NO: text = "NO"; break; case RP_USER: text = "USER"; break; case RP_NDEL: text = "NDEL"; break; } snprintf (buffer, sizeof(buffer), "[%s] %3d %s", text, sm_reply.code, sm_reply.text); return buffer; } static char * EHLOset (char *s) { size_t len; char *ep, **ehlo; len = strlen (s); for (ehlo = EHLOkeys; *ehlo; ehlo++) { ep = *ehlo; if (strncmp (ep, s, len) == 0) { for (ep += len; *ep == ' '; ep++) continue; return ep; } } return 0; } nmh-1.5/mts/smtp/smtp.h000644 007761 000765 00000016343 11762736346 015042 0ustar00kenhkenh000000 000000 /* * smtp.h -- definitions for the nmh SMTP Interface */ /* length is the length of the string in text[], which is also NUL * terminated, so s.text[s.length] should always be 0. */ struct smtp { int code; int length; char text[BUFSIZ]; }; /* * prototypes */ /* int client (); */ int sm_init (char *, char *, char *, int, int, int, int, int, int, int, char *, char *, int); int sm_winit (char *); int sm_wadr (char *, char *, char *); int sm_waend (void); int sm_wtxt (char *, int); int sm_wtend (void); int sm_end (int); char *rp_string (int); /* The remainder of this file is derived from "mmdf.h" */ /* * Copyright (C) 1979,1980,1981,1982,1983 University of Delaware * Used by permission, May, 1984. */ /* * MULTI-CHANNEL MEMO DISTRIBUTION FACILITY (MMDF) * * * Copyright (C) 1979,1980,1981,1982,1983 University of Delaware * * Department of Electrical Engineering * University of Delaware * Newark, Delaware 19711 * * Phone: (302) 738-1163 * * * This program module was developed as part of the University * of Delaware's Multi-Channel Memo Distribution Facility (MMDF). * * Acquisition, use, and distribution of this module and its listings * are subject restricted to the terms of a license agreement. * Documents describing systems using this module must cite its source. * * The above statements must be retained with all copies of this * program and may not be removed without the consent of the * University of Delaware. * */ /* Reply Codes for MMDF * * Based on: "Revised FTP Reply Codes", by Jon Postel & Nancy Neigus Arpanet * RFC 640 / NIC 30843, in the "Arpanet Protocol Handbook", E. Feinler * and J. Postel (eds.), NIC 7104, Network Information Center, SRI * International: Menlo Park, CA. (NTIS AD-A0038901) * * Actual values are different, but scheme is same. Codes must fit into * 8-bits (to pass on exit() calls); fields are packed 2-3-3 and interpreted * as octal numbers. * * Basic format: * * 0yz: positive completion; entire action done * 1yz: positive intermediate; only part done * 2yz: Transient negative completion; may work later * 3yz: Permanent negative completion; you lose forever * * x0z: syntax * x1z: general; doesn't fit any other category * x2z: connections; truly transfer-related * x3z: user/authentication/account * x4x: mail * x5z: file system * * 3-bit z field is unique to the reply. In the following, * the RP_xVAL defines are available for masking to obtain a field. */ /* * FIELD DEFINITIONS & BASIC VALUES */ /* FIELD 1: Basic degree of success (2-bits) */ #define RP_BTYP '\200' /* good vs. bad; on => bad */ #define RP_BVAL '\300' /* basic degree of success */ #define RP_BOK '\000' /* went fine; all done */ #define RP_BPOK '\100' /* only the first part got done */ #define RP_BTNO '\200' /* temporary failure; try later */ #define RP_BNO '\300' /* not now, nor never; you lose */ /* FIELD 2: Basic domain of discourse (3-bits) */ #define RP_CVAL '\070' /* basic category (domain) of reply */ #define RP_CSYN '\000' /* purely a matter of form */ #define RP_CGEN '\010' /* couldn't find anywhere else for it */ #define RP_CCON '\020' /* data-transfer-related issue */ #define RP_CUSR '\030' /* pertaining to the user */ #define RP_CMAI '\040' /* specific to mail semantics */ #define RP_CFIL '\050' /* file system */ #define RP_CLIO '\060' /* local i/o system */ /* FIELD 3: Specific value for this reply (3-bits) */ #define RP_SVAL '\007' /* specific value of reply */ /* * SPECIFIC SUCCESS VALUES */ /* * Complete Success */ /* done (e.g., w/transaction) */ #define RP_DONE (RP_BOK | RP_CGEN | '\000') /* general-purpose OK */ #define RP_OK (RP_BOK | RP_CGEN | '\001') /* message is accepted (w/text) */ #define RP_MOK (RP_BOK | RP_CMAI | '\000') /* * Partial Success */ /* you are the requestor */ #define RP_MAST (RP_BPOK| RP_CGEN | '\000') /* you are the requestee */ #define RP_SLAV (RP_BPOK| RP_CGEN | '\001') /* message address is accepted */ #define RP_AOK (RP_BPOK| RP_CMAI | '\000') /* * SPECIFIC FALURE VALUES */ /* * Partial Failure */ /* not now; maybe later */ #define RP_AGN (RP_BTNO | RP_CGEN | '\000') /* timeout */ #define RP_TIME (RP_BTNO | RP_CGEN | '\001') /* no-op; nothing done, this time */ #define RP_NOOP (RP_BTNO | RP_CGEN | '\002') /* encountered an end of file */ #define RP_EOF (RP_BTNO | RP_CGEN | '\003') /* channel went bad */ #define RP_NET (RP_BTNO | RP_CCON | '\000') /* foreign host screwed up */ #define RP_BHST (RP_BTNO | RP_CCON | '\001') /* host went away */ #define RP_DHST (RP_BTNO | RP_CCON | '\002') /* general net i/o problem */ #define RP_NIO (RP_BTNO | RP_CCON | '\004') /* error reading/writing file */ #define RP_FIO (RP_BTNO | RP_CFIL | '\000') /* unable to create file */ #define RP_FCRT (RP_BTNO | RP_CFIL | '\001') /* unable to open file */ #define RP_FOPN (RP_BTNO | RP_CFIL | '\002') /* general local i/o problem */ #define RP_LIO (RP_BTNO | RP_CLIO | '\000') /* resource currently locked */ #define RP_LOCK (RP_BTNO | RP_CLIO | '\001') /* * Complete Failure */ /* bad mechanism/path; try alternate? */ #define RP_MECH (RP_BNO | RP_CGEN | '\000') /* general-purpose NO */ #define RP_NO (RP_BNO | RP_CGEN | '\001') /* general prototocol error */ #define RP_PROT (RP_BNO | RP_CCON | '\000') /* bad reply code (PERMANENT ERROR) */ #define RP_RPLY (RP_BNO | RP_CCON | '\001') /* couldn't deliver */ #define RP_NDEL (RP_BNO | RP_CMAI | '\000') /* couldn't parse the request */ #define RP_HUH (RP_BNO | RP_CSYN | '\000') /* no such command defined */ #define RP_NCMD (RP_BNO | RP_CSYN | '\001') /* bad parameter */ #define RP_PARM (RP_BNO | RP_CSYN | '\002') /* command not implemented */ #define RP_UCMD (RP_BNO | RP_CSYN | '\003') /* unknown user */ #define RP_USER (RP_BNO | RP_CUSR | '\000') /* * Macros to access reply info */ /* get the entire return value */ #define rp_gval(val) ((signed char) (val)) /* * The next three give the field's bits, within the whole value */ /* get the basic part of return value */ #define rp_gbval(val) (rp_gval (val) & RP_BVAL) /* get the domain part of value */ #define rp_gcval(val) (rp_gval (val) & RP_CVAL) /* get the specific part of value */ #define rp_gsval(val) (rp_gval (val) & RP_SVAL) /* * The next three give the numeric value withing the field */ /* get the basic part right-shifted */ #define rp_gbbit(val) ((rp_gval (val) >> 6) & 03) /* get the domain part right-shifted */ #define rp_gcbit(val) ((rp_gval (val) >> 3) & 07) /* get the specific part right-shifted */ #define rp_gsbit(val) (rp_gval (val) & 07) /* * MACHINE DEPENDENCY * * The following treat the value as strictly numeric. * It relies on the negative values being numerically * negative. */ /* is return value positive? */ #define rp_isgood(val) (rp_gval (val) >= 0) /* is return value negative? */ #define rp_isbad(val) (rp_gval (val) < 0) nmh-1.5/man/ali.man000644 007761 000765 00000004041 11713401273 014105 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH ALI %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME ali \- list mail aliases .SH SYNOPSIS .HP 5 .na .B ali .RB [ \-alias .IR aliasfile ] .RB [ \-list " | " \-nolist ] .RB [ \-normalize " | " \-nonormalize ] .RB [ \-user " | " \-nouser ] .RB [ \-version ] .RB [ \-help ] .RI [ aliases " ...]" .ad .SH DESCRIPTION .B Ali searches the named mail alias files for each of the given .IR aliases . It creates a list of addresses for those .IR aliases , and writes that list on standard output. If no arguments are given, .B ali outputs all alias entries. .PP By default, when an aliases expands to multiple addresses, the addresses are separated by commas and printed on as few lines as possible. If the .B \-list option is specified, then when an address expands to multiple addresses, each address will appear on a separate line. .PP The switch .B \-user directs .B ali to perform its processing in an inverted fashion: instead of listing the addresses that each given alias expands to, .B ali will list the aliases that expand to each given address. If the .B \-normalize switch is given, .B ali will try to track down the official hostname of the address. .PP The files specified by the profile entry .RI \*(lq Aliasfile \*(rq and any additional alias files given by the .B \-alias .I aliasfile switch will be read. Each .I alias is processed as described in .BR mh\-alias (5). .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^/etc/passwd~^List of users ^/etc/group~^List of groups .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Aliasfile:~^For a default alias file .fi .SH "SEE ALSO" mh\-alias(5) .SH DEFAULTS .nf .RB ` aliasfiles "' defaults to %etcdir%/MailAliases" .RB ` \-nolist ' .RB ` \-nonormalize ' .RB ` \-nouser ' .fi .SH CONTEXT None .SH BUGS The .B \-user option with .B \-nonormalize is not entirely accurate, as it does not replace local nicknames for hosts with their official site names. nmh-1.5/man/anno.man000644 007761 000765 00000010145 11713401273 014275 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH ANNO %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME anno \- annotate messages .SH SYNOPSIS .HP 5 .na .B anno .RI [ +folder ] .RI [ msgs ] .RB [ \-component .IR field ] .RB [ \-inplace " | " \-noinplace ] .RB [ \-date " | " \-nodate ] .RB [ \-draft ] .RB [ \-append ] .RB [ \-list ] .RB [ \-delete ] .RB [ \-number .IR [ num|all ]] .RB [ \-preserve " | " \-nopreserve ] .RB [ \-version ] .RB [ \-help ] .RB [ \-text .IR body ] .ad .SH DESCRIPTION .B Anno manipulates header fields or .I annotations in messages. Header fields consist of a field name and an optional field body as defined by RFC-2822. The .B -component option specifies the field name, and the .B -text option specifies the field body. .PP The messages are either the .I msgs in the named folder, or the draft if invoked with the .B -draft option. .PP Usually, annotation is performed by the commands .BR dist , .BR forw , and .BR repl , if they are given the .B \-anno switch. This allows you to keep track of your distribution of, forwarding of, and replies to a message. .PP By using .BR anno , you can perform arbitrary annotations of your own. Each message selected will be annotated with the lines .PP field:\ date field:\ body .PP The .B \-nodate switch inhibits the date annotation, leaving only the body annotation. .PP By default, .B anno prepends the annotations to the message. Annotations are instead appended if the .B -append option is specified. .PP If a .B \-component .I field is not specified when .B anno is invoked, .B anno will prompt the user for the name of field for the annotation. .PP The field specified must be a valid 2822-style message field name, which means that it may only consist of alphanumerics and dashes, The body specified is arbitrary text. .PP Normally .B anno does the annotation inplace in order to preserve any links to the message. You may change this by using the .B \-noinplace switch. .PP The .B -list option produces a listing of the field bodies for header fields with names matching the specified component, one per line. The listing is numbered, starting at 1, if the .B -number option is also used. A tab character separates the number and the field body. The field body is treated as if it is a file name, and only the final path name component is listed. The complete field body is listed if the .B -text option is used, the contents of the text are ignored. .PP The .B -delete option removes header fields from messages. The first header field whose name matches the component is deleted if no other options are specified. If the .B -text option is used in conjunction with the .B -delete option, the first header field whose name matches the component and whose body matches the text is deleted. The text is treated as if it was a file name; if it begins with a slash, the entire field body must match the text, otherwise just the last path name component of the field body must match. If the .B -number option is used in conjuction with the .B -delete option, header field .I num whose name matches the component is deleted. The number matches that which is produced by the .B -list option. The special value .B all can be used for the number, and causes all components that match the name to be deleted. .PP By default, .B anno changes the last-accessed and last-modified times on annotate messages to the time at which the annotation occurs. .B Anno preserves the original times if the .B -preserve option is used. A matching .B -nopreserve option exists that allows time preservation to be turned off if enabled in the profile. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder .fi .SH "SEE ALSO" dist(1), forw(1), repl(1) .SH DEFAULTS .nf .RI ` +folder "' defaults to the current folder" .RI ` msgs "' defaults to cur" .RB ` \-inplace ' .RB ` \-date ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The first message annotated will become the current message. nmh-1.5/man/ap.man000644 007761 000765 00000004415 11762736345 013764 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH AP %manext8% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME ap \- parse addresses 822-style .SH SYNOPSIS .HP 5 .na .B %libdir%/ap .RB [ \-form .IR formatfile ] .RB [ \-format .IR string ] .RB [ \-normalize " | " \-nonormalize ] .RB [ \-width .IR columns ] .RB [ \-version ] .RB [ \-help ] .I addrs \&... .ad .SH DESCRIPTION .B Ap is a program that parses addresses according to the ARPA Internet standard. It also understands many non\-standard formats. It is useful for seeing how .B nmh will interpret an address. .PP The .B ap program treats each argument as one or more addresses, and prints those addresses out in the official 822\-format. Hence, it is usually best to enclose each argument in quotes for the shell. .PP To override the output format used by .BR ap , the .B \-format .I string or .B \-format .I file switches are used. This permits individual fields of the address to be extracted with ease. The string is simply a format string, and the file is simply a format file. See .BR mh\-format (5) for the details. .PP In addition to the standard escapes, .B ap also recognizes the following additional escape: .PP .RS 5 .nf .ta \w'Escape 'u +\w'Returns 'u .I "Escape Returns Description" error string A diagnostic if the parse failed .RE .fi .PP If the .B \-normalize switch is given, .B ap will try to track down the official hostname of the address. .PP Here is the default format string used by .BR ap : .PP .RS 5 %<{error}%{error}: %{text}%|%(putstr(proper{text}))%> .RE .PP which says that if an error was detected, print the error, a `:', and the address in error. Otherwise, output the 822\-proper format of the address. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^%etcdir%/mts.conf~^nmh mts configuration file .fi .SH "PROFILE COMPONENTS" None .SH "SEE ALSO" dp(8), .I "Standard for the Format of ARPA Internet Text Messages" (RFC\-822) .SH DEFAULTS .nf .RB ` \-format "' defaults as described above" .RB ` \-normalize ' .RB ` \-width "' defaults to the width of the terminal" .fi .SH CONTEXT None .SH BUGS The argument to the .B \-format switch must be interpreted as a single token by the shell that invokes .BR ap . Therefore, one must usually place the argument to this switch inside quotes. nmh-1.5/man/burst.man000644 007761 000765 00000007351 11713401273 014506 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH BURST %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME burst \- explode digests into messages .SH SYNOPSIS .HP 5 .na .B burst .RI [ +folder ] .RI [ msgs ] .RB [ \-inplace " | " \-noinplace ] .RB [ \-quiet " | " \-noquiet ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Burst considers the specified messages in the named folder to be Internet digests, and explodes them in that folder. .PP If .B \-inplace is given, each digest is replaced by the \*(lqtable of contents\*(rq for the digest (the original digest is removed). .B Burst then renumbers all of the messages following the digest in the folder to make room for each of the messages contained within the digest. These messages are placed immediately after the digest. .PP If .B \-noinplace is given, each digest is preserved, no table of contents is produced, and the messages contained within the digest are placed at the end of the folder. Other messages are not tampered with in any way. .PP The .B \-quiet switch directs .B burst to be silent about reporting messages that are not in digest format. .PP The .B \-verbose switch directs .B burst to tell the user the general actions that it is taking to explode the digest. .PP It turns out that .B burst works equally well on forwarded messages and blind\-carbon\-copies as on Internet digests, provided that the former two were generated by .B forw or .BR send . .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Msg\-Protect:~^To set mode when creating a new message .fi .SH "SEE ALSO" inc(1), msh(1), pack(1), .I "Proposed Standard for Message Encapsulation" (RFC\-934) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` \-noinplace ' .RB ` \-noquiet ' .RB ` \-noverbose ' .fi .SH CONTEXT If a folder is given, it will become the current folder. If .B \-inplace is given, then the first message burst becomes the current message. This leaves the context ready for a .B show of the table of contents of the digest, and a .B next to see the first message of the digest. If .B \-noinplace is given, then the first message extracted from the first digest burst becomes the current message. This leaves the context in a similar, but not identical, state to the context achieved when using .BR \-inplace . .SH BUGS The .B burst program enforces a limit on the number of messages which may be .B burst from a single message. This number is on the order of 1000 messages. There is usually no limit on the number of messages which may reside in the folder after the .BR burst ing. .PP Although .B burst uses a sophisticated algorithm to determine where one encapsulated message ends and another begins, not all digestifying programs use an encapsulation algorithm. In degenerate cases, this usually results in .B burst finding an encapsulation boundary prematurely and splitting a single encapsulated message into two or more messages. These erroneous digestifying programs should be fixed. .PP Furthermore, any text which appears after the last encapsulated message is not placed in a separate message by .BR burst . In the case of digestified messages, this text is usually an \*(lqEnd of digest\*(rq string. As a result of this possibly un\-friendly behavior on the part of .BR burst , note that when the .B \-inplace option is used, this trailing information is lost. In practice, this is not a problem since correspondents usually place remarks in text prior to the first encapsulated message, and this information is not lost. nmh-1.5/man/comp.man000644 007761 000765 00000013465 11762736345 014327 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH COMP %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME comp \- compose a message .SH SYNOPSIS .HP 5 .na .B comp .RI [ +folder ] .RI [ msg ] .RB [ \-form .IR formfile ] .RB [ \-use " | " \-nouse ] .RB [ \-file .IR file ] .RB [ \-draftfolder .IR +folder ] .RB [ \-draftmessage .IR msg ] .RB [ \-nodraftfolder ] .RB [ \-editor .IR editor ] .RB [ \-noedit ] .RB [ \-width .IR columns ] .RB [ \-from .IR address ] .RB [ \-to .IR address ] .RB [ \-cc .IR address ] .RB [ \-fcc .IR +folder ] .RB [ \-subject .IR text ] .RB [ \-whatnowproc .IR program ] .RB [ \-nowhatnowproc ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Comp is used to create a new message to be mailed. It copies a message form to the draft being composed and then invokes an editor on the draft (unless .B \-noedit is given, in which case the initial edit is suppressed). .PP The default message template \*(lqcomponents\*(rq will direct .B comp to construct the message draft as follows: .PP .RS 5 .nf From: {from switch} or or To: {to switch} or blank cc: {cc switch} or blank Fcc: {fcc switch} or +outbox Subject: {subject switch} or blank -------- .fi .RE .PP If a file named .RI \*(lq components \*(rq exists in the user's nmh directory, it will be used instead of this form. You may specify an alternate forms file with the switch .B \-form .IR formfile . .PP You may also start .B comp using the contents of an existing message as the form. If you supply either a .I +folder or .I msg argument, that message will be used as the message form. You may not supply both a .B \-form .I formfile and a .I +folder or .I msg argument. The line of dashes or a blank line must be left between the header and the body of the message for the message to be identified properly when it is sent (see .BR send (1)). .PP The switch .B \-use directs .B comp to continue editing an already started message. That is, if a .B comp (or .BR dist , .BR repl , or .BR forw ) is terminated without sending the draft, the draft can be edited again via .RB \*(lq comp .BR \-use \*(rq. .PP The .B \-file .I file switch says to use the named file as the message draft. .PP Forms that are selected via the .B \-form switch are processed via the .B nmh template system; see .BR mh\-format (5) for details. Drafts constructed from another message or with the .B \-use or .B \-file switchs will NOT be processed with .BR mh\-format (5). .PP In addition to the standard .BR mh\-format (5) escapes, the following .I component escapes are either new or have an alternate meaning: .PP .RS 5 .nf .ta \w'Escape 'u +\w'Returns 'u .I "Escape Returns Description" fcc string Any folders specified with `\-fcc\ folder' from string Any addresses specified with `\-from\ address' to string Any addresses specified with `\-to\ address' cc string Any addresses specified with `\-cc\ address' subject string Any text specified with `\-subject\ text' .fi .RE .PP By default the \*(lqTo:\*(rq and \*(lqcc:\*(rq fields are empty. You may add addresses to these fields with the .B \-to .I address and .B \-cc .I address switches. You may give these switches multiple times to add multiple addresses. .PP By default the \*(lqFrom:\*(rq field has either the value of the .B Local\-Mailbox profile entry or a system default email address. This default can be overridden by using the .B \-from .I address switch. The default mailbox in the \*(lqFcc:\*(rq field is .IR +outbox . This can be overridden by the .B \-fcc switch. .PP Any text you give to the .B \-subject switch will be placed in the \*(lqSubject:\*(rq field in the draft. .PP If the draft already exists, .B comp will ask you as to the disposition of the draft. A reply of .B quit will abort .BR comp , leaving the draft intact; .B replace will replace the existing draft with the appropriate form; .B list will display the draft; .B use will use the draft for further composition; and .B refile .I +folder will file the draft in the given folder, and give you a new draft with the appropriate form. (The .I +folder argument to .B refile is required.) .PP The .B \-draftfolder .I +folder and .B \-draftmessage .I msg switches invoke the .B nmh draft folder facility. This is an advanced (and highly useful) feature. Consult the .BR mh-draft (5) man page for more information. .PP The .B \-editor .I editor switch indicates the editor to use for the initial edit. Upon exiting from the editor, .B comp will invoke the .B whatnow program. See .BR whatnow (1) for a discussion of available options. The invocation of this program can be inhibited by using the .B \-nowhatnowproc switch. (In truth of fact, it is the .I whatnow program which starts the initial edit. Hence, .B \-nowhatnowproc will prevent any edit from occurring.) .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/components~^The standard message skeleton ^or /components~^Rather than the standard skeleton ^$HOME/\&.mh\(ruprofile~^The user profile ^/draft~^The draft file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Draft\-Folder:~^To find the default draft\-folder ^Editor:~^To override the default editor ^Msg\-Protect:~^To set mode when creating a new message (draft) ^fileproc:~^Program to refile the message ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions .fi .SH "SEE ALSO" dist(1), forw(1), repl(1), send(1), whatnow(1), mh-profile(5) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msg "' defaults to the current message" .RB ` \-nodraftfolder ' .RB ` \-nouse ' .fi .SH CONTEXT None .SH BUGS If .I whatnowproc is .BR whatnow , then .B comp uses a built\-in .BR whatnow , it does not actually run the .B whatnow program. Hence, if you define your own .IR whatnowproc , don't call it .B whatnow since .B comp won't run it. nmh-1.5/man/conflict.man000644 007761 000765 00000003300 11713401273 015136 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH CONFLICT %manext8% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME conflict \- search for alias/password conflicts .SH SYNOPSIS .HP 5 .na .B %libdir%/conflict .RB [ \-search .IR directory ] .RB [ \-mail .IR name ] .RB [ \-version ] .RB [ \-help ] .RI [ aliasfiles \&...] .ad .SH DESCRIPTION .B Conflict is a program that checks to see if the interface between .B nmh and the transport system is in good shape .PP .B Conflict also checks for maildrops in %mailspool% which do not belong to a valid user. It assumes that no user name will start with `.', and thus ignores files in %mailspool% which begin with `.'. It also checks for entries in the .BR group (5) file which do not belong to a valid user, and for users who do not have a valid group number. In addition duplicate users and groups are noted. .PP If the .B \-mail .I name switch is used, then the results will be sent to the specified .IR name . Otherwise, the results are sent to the standard output. .PP The .B \-search .I directory switch can be used to search directories other than %mailspool% and to report anomalies in those directories. The .B \-search .I directory switch can appear more than one time in an invocation to .BR conflict . .PP .B Conflict should be run under .BR cron (8), or whenever system accounting takes place. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/mts.conf~^nmh mts configuration file ^/etc/passwd~^List of users ^/etc/group~^List of groups ^%bindir%/mhmail~^Program to send mail ^%mailspool%/~^Directory of mail drop .fi .SH "PROFILE COMPONENTS" None .SH "SEE ALSO" mh\-alias(5) .SH "DEFAULTS" .nf .RB ` aliasfiles "' defaults to %etcdir%/MailAliases" .fi .SH CONTEXT None nmh-1.5/man/dist.man000644 007761 000765 00000014670 11765267273 014335 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH DIST %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME dist \- redistribute a message to additional addresses .SH SYNOPSIS .HP 5 .na .B dist .RI [ +folder ] .RI [ msg ] .RB [ \-form .IR formfile ] .RB [ \-annotate " | " \-noannotate ] .RB [ \-inplace " | " \-noinplace ] .RB [ \-draftfolder .IR +folder ] .RB [ \-draftmessage .IR msg ] .RB [ \-nodraftfolder ] .RB [ \-editor .IR editor ] .RB [ \-noedit ] .RB [ \-width .IR columns ] .RB [ \-from .IR address ] .RB [ \-to .IR address ] .RB [ \-cc .IR address ] .RB [ \-fcc .IR +folder ] .RB [ \-whatnowproc .IR program ] .RB [ \-nowhatnowproc ] .RB [ \-atfile ] .RB [ \-noatfile ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Dist is similar to .BR forw . It prepares the specified message for redistribution to addresses that (presumably) are not on the original address list. .PP The default message form contains the following elements: .PP .RS 5 .nf Resent-From: {from switch} or or Resent-To: {to switch} or blank Resent-cc: {cc switch} or blank Resent-fcc: {fcc switch} or blank .fi .RE .PP If a file named .RI \*(lq distcomps \*(rq exists in the user's nmh directory, it will be used instead of this default form. You may specify an alternate forms file with the switch .B \-form .IR formfile . Forms are processed via the .B nmh template system; see .BR mh\-format (5) for details. Components from the redistributed message are available as standard component escapes in the forms file. .PP In addition to the standard .BR mh\-format (5) escapes, the following .I component escapes are also supported: .PP .RS 5 .nf .ta \w'Escape 'u +\w'Returns 'u .I "Escape Returns Description" fcc string Any folders specified with `\-fcc\ folder' nmh\-from string Addresses specified with `\-from\ address' nmh\-to string Addresses specified with `\-to\ address' nmh\-cc string Addresses specified with `\-cc\ address' .fi .RE .PP See the .BR forw (1) man page for descriptions of the .BR \-from , .BR \-to , .BR \-cc , and .B \-fcc switches. .PP If the draft already exists, .B dist will ask you as to the disposition of the draft. A reply of .B quit will abort .BR dist , leaving the draft intact; .B replace will replace the existing draft with a blank skeleton; and .B list will display the draft. .PP Only those addresses in .RI \*(lq Resent\-To: \*(rq, .RI \*(lq Resent\-cc: \*(rq, and .RI \*(lq Resent\-Bcc: \*(rq will be sent. Also, a .RI \*(lq "Resent\-Fcc: folder" \*(rq will be honored (see .BR send (1)). Note that with .BR dist , the draft should contain only .RI \*(lq Resent\-xxx: \*(rq fields and no body. The headers and the body of the original message are copied to the draft when the message is sent. Use care in constructing the headers for the redistribution. .PP If the .B \-annotate switch is given, the message being distributed will be annotated with the lines: Resent:\ date Resent:\ addrs where each address list contains as many lines as required. This annotation will be done only if the message is sent directly from .BR dist . If the message is not sent immediately from .BR dist , .RB \*(lq comp .BR \-use \*(rq may be used to re\-edit and send the constructed message, but the annotations won't take place. Normally annotations are done inplace in order to preserve any links to the message. You may use the .B \-noinplace switch to change this. .PP See .BR comp (1) for a description of the .B \-editor and .B \-noedit switches. Note that while in the editor, the message being resent is available through a link named \*(lq@\*(rq (assuming the default .IR whatnowproc ). In addition, the actual pathname of the message is stored in the environment variable .BR $editalt , and the pathname of the folder containing the message is stored in the environment variable .BR $mhfolder . The creation of the \*(lq@\*(rq file and associated environment variables can be controlled via the .B \-atfile and .B \-noatfile options. .PP The .B \-draftfolder .I +folder and .B \-draftmessage .I msg switches invoke the .B nmh draft folder facility. This is an advanced (and highly useful) feature. Consult the .BR mh-draft (5) man page for more information. .PP Upon exiting from the editor, .B dist will invoke the .B whatnow program. See .BR whatnow (1) for a discussion of available options. The invocation of this program can be inhibited by using the .B \-nowhatnowproc switch. (In truth of fact, it is the .B whatnow program which starts the initial edit. Hence, .B \-nowhatnowproc will prevent any edit from occurring.) .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/distcomps~^The standard message skeleton ^or /distcomps~^Rather than the standard skeleton ^$HOME/\&.mh\(ruprofile~^The user profile ^/draft~^The draft file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Draft\-Folder:~^To find the default draft\-folder ^Editor:~^To override the default editor ^fileproc:~^Program to refile the message ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions .fi .SH "SEE ALSO" comp(1), forw(1), repl(1), send(1), whatnow(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msg "' defaults to cur" .RB ` \-noannotate ' .RB ` \-nodraftfolder ' .RB ` \-inplace ' .RB ` \-atfile ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The message distributed will become the current message. .SH HISTORY .B Dist originally used headers of the form .RI \*(lq Distribute\-xxx: \*(rq instead of .RI \*(lq Resent\-xxx: \*(rq. In order to conform with the ARPA Internet standard, RFC\-822, the .RI \*(lq Resent\-xxx: \*(rq form is now used. .B Dist will recognize .RI \*(lq Distribute\-xxx: \*(rq type headers and automatically convert them to .RI \*(lq Resent\-xxx: \*(rq. .SH BUGS .B Dist does not rigorously check the message being distributed for adherence to the transport standard, but .B post called by .B send does. The .B post program will balk (and rightly so) at poorly formatted messages, and .B dist won't correct things for you. .PP If .I whatnowproc is .BR whatnow , then .B comp uses a built\-in .BR whatnow , it does not actually run the .B whatnow program. Hence, if you define your own .IR whatnowproc , don't call it .B whatnow since .B comp won't run it. .PP If your current working directory is not writable, the link named \*(lq@\*(rq is not available. nmh-1.5/man/dp.man000644 007761 000765 00000003572 11762736345 013772 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH DP %manext8% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME dp \- parse dates 822-style .SH SYNOPSIS .HP 5 .na .B %libdir%/dp .RB [ \-form .IR formatfile ] .RB [ \-format .IR string ] .RB [ \-width .IR columns ] .RB [ \-version ] .RB [ \-help ] .I dates \&... .ad .SH DESCRIPTION .B Dp is a program that parses dates according to the ARPA Internet standard. It also understands many non\-standard formats, such as those produced by TOPS\-20 sites and some UNIX sites using .BR ctime (3). It is useful for seeing how .B nmh will interpret a date. .PP The .B dp program treats each argument as a single date, and prints the date out in the official 822\-format. Hence, it is usually best to enclose each argument in quotes for the shell. .PP To override the output format used by .BR dp , the .B \-format .I string or .B \-format .I file switches are used. This permits individual fields of the address to be extracted with ease. The string is simply a format string and the file is simply a format file. See .BR mh\-format (5) for the details. .PP Here is the default format string used by .BR dp : .PP .RS 5 %<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%> .RE .PP which says that if an error was detected, print the error, a `:', and the date in error. Otherwise, output the 822\-proper format of the date. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" None .SH "SEE ALSO" ap(8), .I "Standard for the Format of ARPA Internet Text Messages" (RFC\-822) .SH DEFAULTS .nf .RB ` \-format "' default as described above" .RB ` \-width "' default to the width of the terminal" .fi .SH CONTEXT None .SH BUGS The argument to the .B \-format switch must be interpreted as a single token by the shell that invokes .BR dp . Therefore, one must usually place the argument to this switch inside quotes. nmh-1.5/man/flist.man000644 007761 000765 00000012366 11713401273 014472 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH FLIST %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME flist, flists \- list the number of messages in given sequence(s) .SH SYNOPSIS .HP 5 .na .B flist .RI [ +folder1 .RI [ +folder2 \&...]] .RB [ \-sequence .I name1 .RB [ \-sequence .I name2 \&...]] .RB [ \-all " | " \-noall ] .RB [ \-showzero " | " \-noshowzero ] .RB [ \-recurse " | " \-norecurse ] .RB [ \-fast " | " \-nofast ] .RB [ \-alpha " | " \-noalpha ] .RB [ \-version ] .RB [ \-help ] .PP .HP 5 .B flists is equivalent to .B flist .B \-all .ad .SH DESCRIPTION .B Flist is used to search a list of folders and display the number of messages in these folders that are in a given sequence or set of sequences (for example the .RI \*(lq unseen \*(rq sequence). This is especially useful if you use some mechanism such as .B slocal or .B procmail (typically in conjunction with .BR rcvstore ) to pre-sort your mail into different folders before you view it. .PP By default, the command .B flist will search the current folder for the given sequence or sequences (usually .RI \*(lq unseen \*(rq). If (possibly multiple) folders are specified on the command line with .IR +folder , then all these folders are searched for the given sequence(s). .B Flist will display for each folder searched, the number of messages in each of the specified sequences, and the total number of messages. .PP The option .B \-sequence is used to specify the name of a sequence in which to search for. This option may be used multiple times to specify multiple sequences. If this is not given, then the default is to search for all the sequences specified by the .RI \*(lq Unseen-Sequence \*(rq profile component. For more details about sequences, read the .BR mh\-sequence (5) man page. .PP Typically, .B flist will produce a line for each sequence, for every folder that is searched, even those which do not contain any messages in the given sequence. Specifying .B \-noshowzero will cause .B flist to print only those folder/sequence combinations such the folder has a non-zero number of messages in the given specified sequence. .PP If .B \-recurse is given, then for each folder that is search, .B flist will also recursively descend into those folders to search subfolders for the given sequence. .PP If .B \-fast is given, only the names of the folders searched will be displayed, and .B flist will suppress all other output. If this option is used in conjunction with .BR \-noshowzero , then .B flist will only print the names of those folders searched that contain messages in in at least one of the specified sequences. .SS "Multiple Folders" If the option .B \-all is given (and no folders are specified with .IR +folder ), then .B flist will search all the folders in the top level of the users nmh directory. These folders are all preceded by the read\-only folders, which occur as .RI \*(lq atr\-cur\- \*(rq entries in the user's .B nmh context. .PP An example of the output of .B flist .B \-all is: .PP .RS 5 .nf /work/Mail has 5 in sequence unseen (private); out of 46 inbox+ has 10 in sequence unseen ; out of 153 junklist has 0 in sequence unseen ; out of 63 postmaster has 1 in sequence unseen ; out of 3 .fi .RE .PP The \*(lq+\*(rq after .I inbox indicates that it is the current folder. .PP The \*(lqprivate\*(rq flag indicates that the given sequence for that folder is private. See the .BR mh\-sequence (5) man page for details about private sequences. .PP If the option .B \-all and .I +folder are both specified, then .B flist will search this folder, and all its first level subfolders for the given sequence. You may specify multiple folders in this way. .PP If .B flist is invoked by a name ending with \*(lqs\*(rq (e.g. .BR flists ), then the switch .B \-all is assumed by default. .PP The sorting order for the listing is alphabetical (with .BR \-alpha ), or in a priority order defined by the .RI \*(lq Flist-Order \*(rq profile entry (with .BR \-noalpha ). Each item in the .RI \*(lq Flist-Order \*(rq is a folder name or a folder name pattern that uses * to match zero or more characters. Longer matching patterns have precedence over shorter matching patterns. For example: .PP .RS 5 .nf Flist-Order: personal petproject mh* * admin *junk .fi .RE .PP This order puts a few interesting folders first, such as those with mail addressed to you personally, those about a pet project, and those about mh-related things. It places uninteresting folders at the end, and it puts everything else in the middle in alphabetical order. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^mh-sequences:~^File that contains public sequences ^Unseen-Sequence:~^The name of the unseen message sequence ^Flist-Order:~^To sort folders by priority .fi .SH "SEE ALSO" folder(1), rcvstore(1), slocal(1), mh\-sequence(5) .SH DEFAULTS .nf .RB ` -sequence "' defaults to Unseen-Sequence profile entry" .RB ` \-showzero ' .RB ` \-noall ' .RB ` \-norecurse ' .RB ` \-noalpha ' .RB ` \-nofast ' .fi .SH CONTEXT If .I +folder is given, it will become the current folder. If multiple folders are given, the last one specified will become the current folder. nmh-1.5/man/flists.man000644 007761 000765 00000000021 11476006206 014641 0ustar00kenhkenh000000 000000 .so man1/flist.1 nmh-1.5/man/fmtdump.man000644 007761 000765 00000002231 11713401273 015013 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH FMTDUMP %manext8% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME fmtdump \- decode nmh format files .SH SYNOPSIS .HP 5 .na .B %libdir%/fmtdump .RB [ \-form .IR formatfile ] .RB [ \-format .IR string ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Fmtdump is a program that parses an .B nmh format file and produces a pseudo-language listing of the how .B nmh interprets the file. This is useful when debugging a complicated format file. .PP The .B \-format .I string and .B \-form .I formatfile switches may be used to specify a format string or format file to read. The string is simply a format string and the file is simply a format file. See .BR mh-format (5) for the details. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^%etcdir%/scan.default~^The default format file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory .fi .SH "SEE ALSO" mh-format(5), mh-sequences(8) .SH CONTEXT None .SH BUGS The output may not be useful unless you are familiar with the internals of the mh-format subroutines. nmh-1.5/man/fnext.man000644 007761 000765 00000000017 11713401273 014463 0ustar00kenhkenh000000 000000 .so man1/new.1 nmh-1.5/man/folder.man000644 007761 000765 00000016052 11713401273 014620 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH FOLDER %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME folder, folders \- set/list current folder/message .SH SYNOPSIS .HP 5 .na .B folder .RI [ +folder ] .RI [ msg ] .RB [ \-all " | " \-noall ] .RB [ \-create " | " \-nocreate ] .RB [ \-fast " | " \-nofast ] .RB [ \-header " | " \-noheader ] .RB [ \-recurse " | " \-norecurse ] .RB [ \-total " | " \-nototal ] .RB [ \-list " | " \-nolist ] .RB [ \-push " | " \-pop ] .RB [ \-pack " | " \-nopack ] .RB [ \-print ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-version ] .RB [ \-help ] .PP .HP 5 .B folders is equivalent to .B folder .B \-all .ad .SH DESCRIPTION Since the .B nmh environment is the shell, it is easy to lose track of the current folder from day to day. When .B folder is given the .B \-print switch (the default), .B folder will list the current folder, the number of messages in it, the range of the messages (low\-high), and the current message within the folder, and will flag extra files if they exist. An example of this summary is: .PP .RS 5 .nf .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u inbox+ has \016 messages (\0\03\-\022); cur=\0\05. .fi .RE .PP If a .I +folder and/or .I msg are specified, they will become the current folder and/or message. By comparison, when a .I +folder argument is given, this corresponds to a \*(lqcd\*(rq operation in the shell; when no .I +folder argument is given, this corresponds roughly to a \*(lqpwd\*(rq operation in the shell. .PP If the specified (or default) folder doesn't exist, the default action is to query the user as to whether the folder should be created; when standard input is not a tty, the answer to the query is assumed to be \*(lqyes\*(rq. .PP Specifying .B \-create will cause .B folder to create new folders without any query. (This is the easy way to create an empty folder for use later.) Specifying .B \-nocreate will cause .B folder to exit without creating a non-existant folder. .\" .\" note - this doesn't work at present .\" If `\-noprint' is specified, .\" a `+folder' and/or `msg' may still be specified .\" to set the current folder and/or message, .\" but the folder summary will not be printed. .SS "Multiple Folders" Specifying .B \-all will produce a summary line for each top-level folder in the user's nmh directory, sorted alphabetically. (If .B folder is invoked by a name ending with \*(lqs\*(rq (e.g. .BR folders ), .B \-all is assumed). Specifying .B \-recurse with .B \-all will also produce a line for all sub-folders. These folders are all preceded by the read\-only folders, which occur as .RI \*(lq atr\-cur\- \*(rq entries in the user's .B nmh context. For example: .PP .RS 5 .nf .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u FOLDER \0\0\0\0\0\0# MESSAGES RANGE CUR (OTHERS) /var/work/folder has \035 messages (\01\-\035); cur=23. /usr/bugs/Mail has \082 messages (\01\-108); cur=82. ff has \0no messages. inbox+ has \016 messages (\03\-\022); cur=\05. mh has \076 messages (15\-\076); cur=70. notes has \0\02 messages (\01\-\0\02); cur=\01. ucom has 124 messages (\01\-124); cur=\06; (others). .ta \w'/rnd/phyl/Mail/EP has 'u TOTAL = 339 messages in 7 folders .fi .RE .PP The \*(lq+\*(rq after .I inbox indicates that it is the current folder. The \*(lq(others)\*(rq indicates that the folder .I ucom has files which aren't messages. These files may either be sub\-folders, or files that don't belong under the nmh file naming scheme. .PP The header is output if either a .B \-all or a .B \-header switch is specified. It is suppressed by .BR \-noheader . .PP The folder and message totals are output if either a .B \-all or a .B \-total switch is specified. It is suppressed by .BR \-nototal . .PP If .B \-fast is given, only the folder name (or names in the case of .BR \-all ) will be listed. (This is faster because the folders need not be read.) .PP If a .I +folder is given along with the .B \-all switch, .B folder will, in addition to setting the current folder, list the top\-level subfolders for the current folder (with .BR \-norecurse ) or list all sub-folders under the current folder recursively (with .BR \-recurse ). .PP If .I msg is supplied, together with .IR +folder or without .BR \-all , it will become the current message of .IR +folder (if it had been supplied) or the current folder. .PP The .B \-recurse switch lists each folder recursively, so use of this option effectively defeats the speed enhancement of the .B \-fast option, since each folder must be searched for subfolders. Nevertheless, the combination of these options is useful. .PP .SS "Compacting a Folder" The .B \-pack switch will compress the message names in the designated folders, removing holes in message numbering. The .B \-verbose switch directs .B folder to tell the user the general actions that it is taking to compress the folder. .PP .SS "The Folder Stack" The .B \-push switch directs .B folder to push the current folder onto the .IR folder\-stack , and make the .I +folder argument the current folder. If .I +folder is not given, the current folder and the top of the .I folder\-stack are exchanged. This corresponds to the \*(lqpushd\*(rq operation in the shell. .PP The .B \-pop switch directs .B folder to discard the top of the .IR folder\-stack , after setting the current folder to that value. No .I +folder argument is allowed. This corresponds to the \*(lqpopd\*(rq operation in the shell. The .B \-push switch and the .B \-pop switch are mutually exclusive: the last occurrence of either one overrides any previous occurrence of the other. Both of these switches also set .B \-list by default. .PP The .B \-list switch directs .B folder to list the contents of the .IR folder\-stack . No .I +folder argument is allowed. After a successful .B \-push or .BR \-pop , the .B \-list action is taken, unless a .B \-nolist switch follows them on the command line. This corresponds to the \*(lqdirs\*(rq operation in the shell. The .BR \-push , .BR \-pop , and .B \-list switches turn off .BR \-print . .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Folder\-Protect:~^To set mode when creating a new folder ^Folder\-Stack:~^To determine the folder stack .\" ^lsproc:~^Program to list the contents of a folder .fi .SH "SEE ALSO" refile(1), mhpath(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msg "' defaults to none" .RB ` \-nofast ' .RB ` \-noheader ' .RB ` \-nototal ' .RB ` \-nopack ' .RB ` \-norecurse ' .RB ` \-noverbose ' .RB ` \-print "' is the default if no " \-list ", " \-push ", or " \-pop " is specified" .RB ` \-list "' is the default if " \-push ", or " \-pop " is specified" .fi .SH CONTEXT If .I +folder and/or .I msg are given, they will become the current folder and/or message. .SH BUGS There is no way to restore the default behavior (to ask the user whether to create a non-existant folder) after .B \-create or .B \-nocreate is given. nmh-1.5/man/folders.man000644 007761 000765 00000000022 11476006206 014774 0ustar00kenhkenh000000 000000 .so man1/folder.1 nmh-1.5/man/forw.man000644 007761 000765 00000024541 11762736345 014343 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH FORW %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME forw \- forward messages .SH SYNOPSIS .HP 5 .na .B forw .RI [ +folder ] .RI [ msgs ] .RB [ \-annotate " | " \-noannotate ] .RB [ \-form .IR formfile ] .RB [ \-format " | " \-noformat ] .RB [ \-filter .IR filterfile ] .RB [ \-inplace " | " \-noinplace ] .RB [ \-mime " | " \-nomime ] .RB [ \-draftfolder .IR +folder ] .RB [ \-draftmessage .IR msg ] .RB [ \-nodraftfolder ] .RB [ \-editor .IR editor ] .RB [ \-noedit ] .RB [ \-width .IR colums ] .RB [ \-from .IR address ] .RB [ \-to .IR address ] .RB [ \-cc .IR address ] .RB [ \-fcc .IR +folder ] .RB [ \-subject .IR text ] .RB [ \-whatnowproc .IR program ] .RB [ \-nowhatnowproc ] .RB [ \-dashstuffing " | " \-nodashstuffing ] .RB [ \-build ] .RB [ \-file .IR msgfile ] .RB [ \-version ] .RB [ \-help ] .PP .HP 5 .B forw .RI [ +folder ] .RI [ msgs ] .RB [ \-digest .IR list ] .RB [ \-issue .IR number ] .RB [ \-volume .IR number ] [other\ switches\ for\ .BR forw ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Forw may be used to prepare a message containing other messages. .PP It constructs the new message from a forms (components) file, with a body composed of the message(s) to be forwarded. An editor is invoked as in .BR comp , and after editing is complete, the user is prompted before the message is sent. .PP The default message template will direct .B forw to construct the draft as follows: .PP .RS 5 .nf From: {from switch} or or To: {to switch} or blank Fcc: {fcc switch} or +outbox Subject: {subject switch} or "{original subject} (fwd)" -------- .fi .RE .PP If a file named .RI \*(lq forwcomps \*(rq exists in the user's nmh directory, it will be used instead of this default form. You may also specify an alternate forms file with the switch .B \-form .IR formfile . Forms are processed via the .B nmh template system; see .BR mh\-format (5) for details. Components from the first forwarded message are available as standard component escapes in the forms file. .PP In addition to the standard .BR mh\-format (5) escapes, the following .I component escapes are also supported: .PP .RS 5 .nf .ta \w'nmh\-subject 'u +\w'Returns 'u .I "Escape Returns Description" fcc string Any folders specified with `\-fcc\ folder' nmh\-from string Addresses specified with `\-from\ address' nmh\-to string Addresses specified with `\-to\ address' nmh\-cc string Addresses specified with `\-cc\ address' nmh\-subject string Any text specified with `\-subject\ text' .fi .RE .PP By default the \*(lqTo:\*(rq and \*(lqcc:\*(rq fields are empty. You may add addresses to these fields with the .B \-to .I address and .B \-cc .I address switches. You may give these switches multiple times to add multiple addresses. .PP By default the \*(lqFrom:\*(rq field has either the value of the .B Local\-Mailbox profile entry a system default email address. This default can be overridden by using the .B \-from .I address switch. The default mailbox in the \*(lqFcc:\*(rq field is .IR +outbox . This can be overridden by the .B \-fcc switch. .PP Any text you give to the .B \-subject switch will be placed in the \*(lqSubject:\*(rq field in the draft. .PP If the draft already exists, .B forw will ask you as to the disposition of the draft. A reply of .B quit will abort .BR forw , leaving the draft intact; .B replace will replace the existing draft with a blank skeleton; and .B list will display the draft. .PP If the .B \-annotate switch is given, each message being forwarded will be annotated with the lines: .PP .RS 5 .nf Forwarded:\ date Forwarded:\ addrs .fi .RE .PP where each address list contains as many lines as required. This annotation will be done only if the message is sent directly from .BR forw . If the message is not sent immediately from .BR forw , .RB \*(lq comp .BR \-use \*(rq may be used to re\-edit and send the constructed message, but the annotations won't take place. Normally annotations are done inplace in order to preserve any links to the message. You may change this by using the .B \-noinplace switch. .PP See .BR comp (1) for a description of the .B \-editor and .B \-noedit switches. .PP Although .B forw uses a forms (components) file to direct it how to construct the beginning of the draft, it uses a message filter file to direct it as to how each forwarded message should be formatted in the body of the draft. The filter file for \fIforw\fR should be a standard form file for .BR mhl , as .B forw will invoke .B mhl to filter (re\-format) the forwarded messages prior to being output to the body of the draft. .PP The switches .BR \-noformat , .BR \-format , and .B \-filter .I filterfile specify which message filter file to use. .PP If .B \-noformat is specified (this is the default), then each forwarded message is output into the draft exactly as it appears with no .B mhl filtering. .PP If .B \-format is specified, then a default message filter file is used. This default message filter should be adequate for most users. This default filter .RI \*(lq mhl.forward \*(rq is: .PP .RS 5 .nf %mhl_forward% .fi .RE .PP If a file named .RI \*(lq mhl.forward \*(rq exists in the user's nmh directory, it will be used instead of this form. You may specify an alternate message filter file with the switch .B \-filter .IR filterfile . .PP Each forwarded message is separated with an encapsulation delimiter. By default, any dashes in the first column of the forwarded messages will be prepended with `\-\ ' so that when received, the message is suitable for bursting by .BR burst . This follows the Internet RFC\-934 guidelines. You may use the flag .B \-nodashstuffing in order to suppress this form of quoting to the forwarded messages. .PP For users of .BR prompter , by specifying .BR prompter 's .B \-prepend switch in the .I \&.mh\(ruprofile file, any commentary text is entered before the forwarded messages. (A major win!) .PP To use the MIME rules for encapsulation, specify the .B \-mime switch. This directs .B forw to generate an .B mhbuild composition file. Note that .B nmh will not invoke .B mhbuild automatically, unless you add this line to your .I \&.mh\(ruprofile file: .PP .RS 5 .nf automimeproc: 1 .fi .RE .PP Otherwise, you must specifically give the command .PP .RS 5 .nf What now? mime .fi .RE .PP prior to sending the draft. .PP The .B \-draftfolder .I +folder and .B \-draftmessage .I msg switches invoke the .B nmh draft folder facility. This is an advanced (and highly useful) feature. Consult the .BR mh-draft (5) man page for more information. .PP The .B \-editor .I editor switch indicates the editor to use for the initial edit. Upon exiting from the editor, .B comp will invoke the .B whatnow program. See .BR whatnow (1) for a discussion of available options. The invocation of this program can be inhibited by using the .B \-nowhatnowproc switch. (In truth of fact, it is the .I whatnow program which starts the initial edit. Hence, .B \-nowhatnowproc will prevent any edit from occurring.) .PP The .B \-build switch is intended to be used by the Emacs mh-e interface to .BR nmh . It implies .BR \-nowhatnowproc . It causes a file /draft to be created, containing the draft message that would normally be presented to the user for editing. No mail is actually sent. .PP The .B \-file .I msgfile switch specifies the message to be forwarded as an exact filename rather than as an .B nmh folder and message number. It is intended to be used by the .B msh interface to .BR nmh . This switch implies .BR \-noannotate . The forwarded message is simply copied verbatim into the draft; the processing implied by the .BR \-filter , .BR \-mime , and .B \-digest switches is bypassed, and the usual leading and trailing 'Forwarded Message' delimiters are not added. The same caveats apply to this option as to the .B \-build switch. .PP The .B \-digest .IR list , .B \-issue .IR number , and .B \-volume .I number switches implement a digest facility for .BR nmh . Specifying these switches enables and/or overloads the following escapes: .PP .RS 5 .nf .ta \w'Component 'u +\w'Escape 'u +\w'Returns 'u .I "Type Escape Returns Description" component digest string Argument to `\-digest' function cur integer Argument to `\-volume' function msg integer Argument to `\-issue' .fi .RE .PP Consult the .I "Advanced Features" section of the .B nmh User's Manual for more information on making digests. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/forwcomps~^The standard message skeleton ^or /forwcomps~^Rather than the standard skeleton ^%etcdir%/digestcomps~^The message skeleton if `\-digest' is given ^or /digestcomps~^Rather than the standard skeleton ^%etcdir%/mhl.forward~^The standard message filter ^or /mhl.forward~^Rather than the standard filter ^$HOME/\&.mh\(ruprofile~^The user profile ^/draft~^The draft file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Draft\-Folder:~^To find the default draft\-folder ^Editor:~^To override the default editor ^Msg\-Protect:~^To set mode when creating a new message (draft) ^fileproc:~^Program to refile the message ^mhlproc:~^Program to filter messages being forwarded ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions .fi .SH "SEE ALSO" mhbuild(1), comp(1), repl(1), send(1), whatnow(1), mh\-format(5), .I "Proposed Standard for Message Encapsulation" (RFC\-934) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` \-noannotate ' .RB ` \-nodraftfolder ' .RB ` \-noformat ' .RB ` \-inplace ' .RB ` \-dashstuffing ' .RB ` \-nomime ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The first message forwarded will become the current message. .SH BUGS If .I whatnowproc is .BR whatnow , then .B forw uses a built\-in .BR whatnow , it does not actually run the .B whatnow program. Hence, if you define your own .IR whatnowproc , don't call it .B whatnow since .B forw won't run it. .PP When .B forw is told to annotate the messages it forwards, it doesn't actually annotate them until the draft is successfully sent. If from the .IR whatnowproc , you .B push instead of .BR send , it's possible to confuse .B forw by re\-ordering the file (e.g. by using .RB \*(lq folder .BR \-pack \*(rq) before the message is successfully sent. .B Dist and .B repl don't have this problem. nmh-1.5/man/fprev.man000644 007761 000765 00000000017 11713401273 014461 0ustar00kenhkenh000000 000000 .so man1/new.1 nmh-1.5/man/inc.man000644 007761 000765 00000017733 11762736345 014144 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH INC %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] XXX .SH NAME inc \- incorporate new mail .SH SYNOPSIS .HP 5 .na .B inc .RI [ +folder ] .RB [ \-audit .IR audit\-file ] .RB [ \-noaudit ] .RB [ \-changecur " | " \-nochangecur ] .RB [ \-form .IR formfile ] .RB [ \-format .IR string ] .RB [ \-file .IR name ] .RB [ \-silent " | " \-nosilent ] .RB [ \-truncate " | " \-notruncate ] .RB [ \-width .IR columns ] .RB [ \-host .IR hostname ] .RB [ \-user .IR username ] .RB [ \-pack .IR file ] .RB [ \-nopack ] .RB [ \-proxy .IR command ] .RB [ \-sasl ] .RB [ \-saslmech .IR mechanism ] .RB [ \-snoop ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Inc incorporates mail from the user's incoming mail drop into an .B nmh folder. If the mail drop is a file, it can be in .B mbox or .B MMDF format. If the mail drop is a directory it will considered to be a .B Maildir format mail drop. .PP You may specify which folder to use with .IR +folder . If no folder is specified, then .B inc will use either the folder given by a (non\-empty) .RI \*(lq Inbox \*(rq entry in the user's profile, or the folder named .RI \*(lq inbox \*(rq. If the specified (or default) folder doesn't exist, the user will be queried prior to its creation. .PP When the new messages are incorporated into the folder, they are assigned numbers starting with the next highest number for the folder. As the messages are processed, a .B scan listing of the new mail is produced. .PP If the user's profile contains a .RI \*(lq "Msg\-Protect: nnn" \*(rq entry, it will be used as the protection on the newly created messages, otherwise the .B nmh default of 0644 will be used. For all subsequent operations on these messages, this initially assigned protection will be preserved. .PP If the switch .B \-audit .I audit\-file is specified (usually as a default switch in the profile), then .B inc will append a header line and a line per message to the end of the specified audit\-file with the format: .PP .RS 5 .nf <> date .fi .RE .PP This is useful for keeping track of volume and source of incoming mail. Eventually, .BR repl , .BR forw , .BR comp , and .B dist may also produce audits to this (or another) file, perhaps with .RI \*(lq Message\-Id \*(rq information to keep an exact correspondence history. .RI \*(lq Audit\-file \*(rq will be in the user's nmh directory unless a full path is specified. .PP .B Inc will incorporate even improperly formatted messages into the user's nmh folder, inserting a blank line prior to the offending component and printing a comment identifying the bad message. .PP In all cases, the user's mail drop will be zeroed, unless the .B \-notruncate switch is given. .PP If the profile entry .RI \*(lq Unseen\-Sequence \*(rq is present and non\-empty, then .B inc will add each of the newly incorporated messages to each sequence named by the profile entry. .B Inc will not zero each sequence prior to adding messages. .PP The interpretation of the .B \-form .IR formatfile , .B \-format .IR string , and .B \-width .I columns switches is the same as in .BR scan . .PP By using the .B \-file .I name switch, one can direct .B inc to incorporate messages from a file other than the user's maildrop. Note that the name file will NOT be zeroed, unless the .B \-truncate switch is given. .PP If the environment variable .B $MAILDROP is set, then .B inc uses it as the location of the user's maildrop instead of the default (the .B -file .I name switch still overrides this, however). If this environment variable is not set, then .B inc will consult the profile entry .RI \*(lq MailDrop \*(rq for this information. If the value found is not absolute, then it is interpreted relative to the user's .B nmh directory. If the value is not found, then .B inc will look in the standard system location for the user's maildrop. .PP The .B \-silent switch directs .B inc to be quiet and not ask any questions at all. This is useful for putting .B inc in the background and going on to other things. .PP .SS "Using POP" .B inc will normally check local mail drops for mail, as covered above. But if the option .RI \*(lq pophost \*(rq is set in .RI \*(lq mts.conf \*(rq, or if the .B \-host .I hostname switch is given, or if the .B $MAILHOST environment variable is set, then .B inc will query this POP service host for mail to incorporate. If .B $MAILHOST is set and .B \-host is specified as well, the commandline switch will override the environment variable. .PP The default is for .B inc to assume that your account name on the POP server is the same as your current username. To specify a different username, use the .B \-user .I username switch. .PP When using POP, you will normally need to type the password for your account on the POP server, in order to retrieve your messages. It is possible to automate this process by creating a .RI \*(lq .netrc \*(rq file containing your login account information for this POP server. For each POP server, this file should have a line of the following form. Replace the words .IR mypopserver , .IR mylogin , and .I mypassword with your own account information. .PP .RS 5 .B machine .I mypopserver .B login .I mylogin .B password .I mypassword .RE .PP This .RI \*(lq .netrc \*(rq file should be owned and readable only by you. .PP If passed the .B \-proxy .I command switch, .B inc will use the specified command to establish the connection to the POP server. The string .IR %h in the command will be substituted by the hostname to connect to. .PP If .B inc uses POP, then the .B \-pack .I file switch is considered. If given, then .B inc simply uses the POP to .B packf the user's maildrop from the POP service host to the named file. This switch is provided for those users who prefer to use .B msh to read their maildrops. .PP For debugging purposes, you may give the switch .BR \-snoop , which will allow you to watch the POP transaction take place between you and the POP server. .PP If .B nmh has been compiled with SASL support, the .B \-sasl switch will enable the use of SASL authentication. Depending on the SASL mechanism used, this may require an additional password prompt from the user (but the .RI \*(lq .netrc \*(rq file can be used to store this password). The .B \-saslmech switch can be used to select a particular SASL mechanism. .PP If SASL authentication is successful, .B inc will attempt to negotiate a security layer for session encryption. Encrypted traffic is labelled with `(encrypted)' and `(decrypted)' when viewing the POP transaction with the .B \-snoop switch. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^%etcdir%/mts.conf~^nmh mts configuration file ^%mailspool%/$USER~^Location of mail drop .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Alternate\-Mailboxes:~^To determine the user's mailboxes ^Inbox:~^To determine the inbox, default \*(lqinbox\*(rq ^Folder\-Protect:~^To set mode when creating a new folder ^Msg\-Protect:~^To set mode when creating a new message and audit\-file ^Unseen\-Sequence:~^To name sequences denoting unseen messages .fi .SH "SEE ALSO" mhmail(1), scan(1), mh\-mail(5), post(8) .SH DEFAULTS .nf .RB ` +folder "' defaulted by \*(lqInbox\*(rq above" .RB ` \-noaudit ' .RB ` \-changecur ' .RB ` \-format "' defaulted as described above" .RB ` \-nosilent ' .RB ` \-truncate "' if `" \-file " name' not given, `" \-notruncate "' otherwise" .RB ` \-width "' defaulted to the width of the terminal" .RB ` \-nopack ' .fi .SH CONTEXT The folder into which messages are being incorporated will become the current folder. The first message incorporated will become the current message, unless the .B \-nochangecur option is specified. This leaves the context ready for a .B show of the first new message. .SH BUGS The argument to the .B \-format switch must be interpreted as a single token by the shell that invokes .BR inc . Therefore, one must usually place the argument to this switch inside quotes. nmh-1.5/man/install-mh.man000644 007761 000765 00000003777 11765131762 015441 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH INSTALL-MH %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME install-mh \- initialize the nmh environment .SH SYNOPSIS .HP 5 .na .B %libdir%/install\-mh .RB [ \-auto ] .RB [ \-check ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Install\-mh is the .B nmh program to create the initial setup for a first\-time .B nmh user. .B Install\-mh lives in two places for historical reasons. .PP The \fB\-auto\fP option does things as automatically as possible and makes \fBinstall\-mh\fP less chatty. .PP The user is asked for the name of the directory that will be designated as the user's .B nmh directory. If this directory does not exist, the user is asked if it should be created. Normally, this directory should be under the user's home directory, and has the default name of \fI``Mail''\fP. .B Install\-mh writes an initial .I \&.mh\(ruprofile for the user. .PP As with all .B nmh commands, .B install\-mh first checks for the existence of the \fB$MH\fP environment variable since that gives the profile path if set. If it isn't set, the .B $HOME environment variable is consulted to determine the user's home directory. If .B $HOME is not set, then the .I /etc/passwd file is consulted. .PP When creating the users initial .IR \&.mh\(ruprofile , .B install\-mh will check for the existence of a global profile .IR %etcdir%/mh.profile . If found, this will be used to initialize the new .IR \&.mh\(ruprofile . .PP The \fB\-check\fP option can be used to check whether or not nmh has been installed. This can be used by other programs to determine whether or not nmh has been installed without their having to know the internals of nmh. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^%etcdir%/mh.profile~^Used to initialize user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To set the user's nmh directory .fi .SH CONTEXT With .BR \-auto , the current folder is changed to .RI \*(lq inbox \*(rq. nmh-1.5/man/mark.man000644 007761 000765 00000013304 11762736345 014313 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MARK %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mark \- manipulate message sequences .SH SYNOPSIS .HP 5 .na .B mark .RI [ +folder ] .RI [ msgs ] .RB [ \-sequence .I name \&...] .RB [ \-add " | " \-delete ] .RB [ \-list ] .RB [ \-public " | " \-nopublic ] .RB [ \-zero " | " \-nozero ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B mark command manipulates message sequences by adding or deleting message numbers from folder\-specific message sequences, or by listing those sequences and messages. .PP A message sequence is a keyword, just like one of the \*(lqreserved\*(rq message names, such as \*(lqfirst\*(rq or \*(lqnext\*(rq. Unlike the \*(lqreserved\*(rq message names, which have a fixed semantics on a per\-folder basis, the semantics of a message sequence may be defined, modified, and removed by the user. Message sequences are folder\-specific, e.g., the sequence name \*(lqseen\*(rq in the context of folder .RI \*(lq +inbox \*(rq need not have any relation whatsoever to the sequence of the same name in a folder of a different name. .PP Three action switches direct the operation of .BR mark . These switches are mutually exclusive: the last occurrence of any of them overrides any previous occurrence of the other two. .PP The .B \-add switch tells .B mark to add messages to sequences or to create a new sequence. For each sequence named via the .B \-sequence .I name argument (which must occur at least once) the messages named via .I msgs (which defaults to \*(lqcur\*(rq if no .I msgs are given), are added to the sequence. The messages to be added need not be absent from the sequence. If the .B \-zero switch is specified, the sequence will be emptied prior to adding the messages. Hence, .B \-add .B \-zero means that each sequence should be initialized to the indicated messages, while .B \-add .B \-nozero means that each sequence should be appended to by the indicated messages. .PP The .B \-delete switch tells .B mark to delete messages from sequences, and is the dual of .BR \-add . For each of the named sequences, the named messages are removed from the sequence. These messages need not be already present in the sequence. If the .B \-zero switch is specified, then all messages in the folder are added to the sequence (first creating the sequence, if necessary) before removing the messages. Hence, .B \-delete .B \-zero means that each sequence should contain all messages except those indicated, while .B \-delete .B \-nozero means that only the indicated messages should be removed from each sequence. As expected, the command .RB \*(lq mark .B \-sequence .I foo .B \-delete all\*(rq deletes the sequence \*(lqfoo\*(rq from the current folder. .PP When creating or modifying sequences, you can specify the switches .B \-public or .B \-nopublic to force the new or modified sequences to be \*(lqpublic\*(rq or \*(lqprivate\*(rq. The switch .B \-public indicates that the sequences should be made \*(lqpublic\*(rq. These sequences will then be readable by all .B nmh users with permission to read the relevant folders. In contrast, the .B \-nopublic switch indicates that the sequences should be made \*(lqprivate\*(rq, and will only be accessible by you. If neither of these switches is specified, then existing sequences will maintain their current status, and new sequences will default to \*(lqpublic\*(rq if you have write permission for the relevant folder. Check the .BR mh\-sequence (5) man page for more details about the difference between \*(lqpublic\*(rq and \*(lqprivate\*(rq sequences. .PP The .B \-list switch tells .B mark to list both the sequences defined for the folder and the messages associated with those sequences. .B Mark will list the name of each sequence given by .B \-sequence .I name and the messages associated with that sequence. If the sequence is private, this will also be indicated. If no sequence is specified by the .B \-sequence switch, then all sequences for this folder will be listed. The .B \-zero switch does not affect the operation of .BR \-list . .PP The current restrictions on sequences are: .PP .IP \(bu 2 The name used to denote a message sequence must consist of an alphabetic character followed by zero or more alphanumeric characters, and cannot be one of the (reserved) message names \*(lqnew\*(rq, \*(lqfirst\*(rq, \*(lqlast\*(rq, \*(lqall\*(rq, \*(lqnext\*(rq, or \*(lqprev\*(rq. .PP .IP \(bu 2 Only a certain number of sequences may be defined for a given folder. This number is usually limited to 27 (11 on small systems). (The internal implementation relies on bitmasks, with some bits set aside for internal use.) .PP .IP \(bu 2 Message ranges with user\-defined sequence names are restricted to the form \*(lqname:n\*(rq, \*(lqname:+n\*(rq, or \*(lqname:-n\*(rq, and refer to the first or last `n' messages of the sequence `name', respectively. Constructs of the form \*(lqname1\-name2\*(rq are forbidden for user defined sequences. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder .fi .SH "SEE ALSO" flist(1), pick(1), mh-sequence(5) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` \-add "' if " \-sequence " is specified, " \-list " otherwise" .RB ` msgs "' defaults to cur (or all if " \-list " is specified)" .RB ` \-nozero ' .SH CONTEXT If a folder is given, it will become the current folder. .SH "HELPFUL HINTS" Use .B flist to find folders with a given sequence, and .RB \*(lq pick .I sequence .BR \-list \*(rq to enumerate those messages in the sequence (such as for use by a shell script). nmh-1.5/man/mh-alias.man000644 007761 000765 00000015041 11713401273 015035 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MH-ALIAS %manext5% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mh-alias \- alias file for nmh message system .SH SYNOPSIS any .B nmh command .SH DESCRIPTION This describes both .B nmh personal alias files and the global alias file for .B nmh mail delivery, the file .PP .RS 5 %etcdir%/MailAliases .RE .PP It does .B not describe aliases files used by the message transport system. Each line of the alias file has the format: .PP .RS 5 .I alias .B : .I address\-group .RE or .RS 5 .I alias .B ; .I address\-group .RE or .RS 5 .B < .I alias\-file .RE or .RS 5 .B ; .I comment .RE .PP where: .PP .RS 5 .nf .IR address\-group " := " address\-list .RI " | < " file .RI " | = " UNIX\-group .RI " | + " UNIX\-group | * .IR address\-list " := " address .RI " | " address\-list ", " address .fi .RE .PP Continuation lines in alias files end with `\\' followed by the newline character. .PP .RI \*(lq Alias\-file \*(rq and .RI \*(lq file \*(rq are UNIX file names. .I UNIX\-group is a group name (or number) from .IR /etc/group . An address is a \*(lqsimple\*(rq Internet\-style address. Througout this file, case is ignored, except for file names. .PP If the line starts with a `<', then the file named after the `<' is read for more alias definitions. The reading is done recursively, so a `<' may occur in the beginning of an alias file with the expected results. .PP If the .I address\-group starts with a `<', then the file named after the `<' is read and its contents are added to the .I address\-list for the alias. .PP If the .I address\-group starts with an `=', then the file .I /etc/group is consulted for the UNIX\-group named after the `='. Each login name occurring as a member of the group is added to the .I address\-list for the alias. .PP In contrast, if the .I address\-group starts with a `+', then the file .I /etc/group is consulted to determine the group\-id of the UNIX\-group named after the `+'. Each login name occurring in the .I /etc/passwd file whose group\-id is indicated by this group is added to the .I address\-list for the alias. .PP If the .I address\-group is simply `*', then the file .I /etc/passwd is consulted and all login names with a userid greater than some magic number (usually 200) are added to the .I address\-list for the alias. .PP In match, a trailing \*(lq*\*(rq on an alias will match just about anything appropriate. (See example below.) .PP An approximation of the way aliases are resolved at posting time is (it's not really done this way): .PP .RS 2 .IP 1) 3 Build a list of all addresses from the message to be delivered, eliminating duplicate addresses. .PP .IP 2) 3 If this draft originated on the local host, then for those addresses in the message that have no host specified, perform alias resolution. .PP .IP 3) 3 For each line in the alias file, compare \*(lqalias\*(rq against all of the existing addresses. If a match, remove the matched \*(lqalias\*(rq from the address list, and add each new address in the address\-group to the address list if it is not already on the list. The alias itself is not usually output, rather the address\-group that the alias maps to is output instead. If \*(lqalias\*(rq is terminated with a `;' instead of a `:', then both the \*(lqalias\*(rq and the address are output in the correct format. (This makes replies possible since .B nmh aliases and personal aliases are unknown to the mail transport system.) .RE .PP Since the alias file is read line by line, forward references work, but backward references are not recognized, thus, there is no recursion. .PP Example Alias File: .PP .RS 5 .nf <%etcdir%/BBoardAliases sgroup: fred, fear, freida b-people: Blind List: bill, betty; fred: frated@UCI UNIX\-committee: \*(rq are defined to be \*(lqnews\*(rq. .PP The key thing to understand about aliasing in .B nmh is that aliases in .B nmh alias files are expanded into the headers of messages posted. This aliasing occurs first, at posting time, without the knowledge of the message transport system. In contrast, once the message transport system is given a message to deliver to a list of addresses, for each address that appears to be local, a system\-wide alias file is consulted. These aliases are .B NOT expanded into the headers of messages delivered. .SH "HELPFUL HINTS" To use aliasing in .B nmh quickly, do the following: .PP .RS 2 .IP 1) 3 In your .IR \&.mh\(ruprofile , choose a name for your alias file, say .RI \*(lq aliases \*(rq, and add the line: .PP .RS 5 .nf Aliasfile: aliases .\" ali: \-alias aliases .\" send: \-alias aliases .\" whom: \-alias aliases .fi .RE .PP .IP 2) 3 Create the file .RI \*(lq aliases \*(rq in your .B nmh directory. .PP .IP 3) 3 Start adding aliases to your .RI \*(lq aliases \*(rq file as appropriate. .RE .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/MailAliases~^global nmh alias file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Aliasfile:~^For a default alias file .fi .SH "SEE ALSO" ali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8) .SH CONTEXT None .SH BUGS Although the forward-referencing semantics of .B mh\-alias files prevent recursion, the .RI \*(lq< " alias\-file" \*(rq command may defeat this. Since the number of file descriptors is finite (and very limited), such infinite recursion will terminate with a meaningless diagnostic when all the fds are used up. .PP Forward references do not work correctly inside blind lists. nmh-1.5/man/mh-chart-gen.sh000755 007761 000765 00000001401 11765267273 015472 0ustar00kenhkenh000000 000000 #! /bin/sh # # Generates mh-chart.man from other .man files that have a SYNOPSIS # section. nmhmandir=`dirname $0` cat <<'EOF' .\" .\" %nmhwarning% .\" .TH MH-CHART %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mh-chart \- Chart of nmh Commands .SH SYNOPSIS .na EOF for i in $nmhmandir/*.man; do case $i in */mh-chart.man) ;; *) if grep '^\.ad' "$i" >/dev/null; then #### Extract lines from just after .SH SYNOPSIS to just before .ad. #### Filter out the "typical usage:" section in pick.man. awk '/.SH SYNOPSIS/,/^(\.ad|typical usage:)/ { if ($0 !~ /^(\.SH SYNOPSIS|\.na|\.ad|typical usage:)/) print }' "$i" echo fi ;; esac done cat <<'EOF' .ad .SH "SEE ALSO" nmh(1) EOF nmh-1.5/man/mh-draft.man000644 007761 000765 00000014627 11762736345 015074 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MH-DRAFT %manext5% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mh-draft \- draft folder facility for nmh message system .SH SYNOPSIS any .B nmh command .SH DESCRIPTION There are a number of interesting advanced facilities for the composition of outgoing mail. .PP .SS "The Draft Folder" The .BR comp , .BR dist , .BR forw , .BR repl , and .B whom commands have two additional switches, .B \-draftfolder .I +folder and .B \-draftmessage .I msg which allow you to manipulate the various draft messages you are composing. .PP If .B \-draftfolder .I +folder is used, these commands are directed to construct a draft message in the indicated folder. (The .RI \*(lq Draft\-Folder \*(rq profile entry may be used to declare a default draft folder for use with .BR comp , .BR dist , .BR forw , .BR repl , and .B whom ). .PP If the swith .B \-draftmessage .I msg is given, the specified draft is used to compose the message. If .B \-draftmessage .I msg is not used, then the draft defaults to `new' (create a new draft) unless the user invokes .B comp with .BR \-use , in which case the default is `cur'. .PP Hence, the user may have several message compositions in progress simultaneously. Now, all of the .B nmh tools are available on each of the user's message drafts (e.g. .BR show , .BR scan , .BR pick , and so on). If the folder does not exist, the user is asked if it should be created (just like with .BR refile ). Also, the last draft message the user was composing is known as `cur' in the draft folder. .PP Furthermore, the .B send command has these switches as well. Hence, from the shell, the user can send off whatever drafts desired using the standard .B nmh `msgs' convention with .B \-draftmessage .IR msgs . If no `msgs' are given, it defaults to `cur'. .PP In addition, all five programs have a .B \-nodraftfolder switch, which undoes the last occurrence of .B \-draftfolder .I folder (useful if the latter occurs in the user's .B nmh profile). .PP If the user does not give the .B \-draftfolder .I +folder switch, then all these commands act \*(lqnormally\*(rq. Note that the .B \-draft switch to .B send and .B show still refers to the file called `draft' in the user's .B nmh directory. In the interests of economy of expression, when using .B comp or .BR send , the user needn't prefix the draft `msg' or `msgs' with .BR \-draftmessage . Both of these commands accept a `file' or `files' argument, and they will, if given .B \-draftfolder .I +folder treat these arguments as `msg' or `msgs'. (This may appear to be inconsistent, at first, but it saves a lot of typing) Hence, .PP .RS .nf send -draftfolder +drafts first .fi .RE .PP is the same as .PP .RS .nf send -draftfolder +drafts -draftmessage first .fi .RE .PP To make all this a bit more clear, here are some examples. Let's assume that the following entries are in the .B nmh profile: .PP .RS 5 .nf Draft\-Folder: +drafts sendf: \-draftfolder +drafts .fi .RE .PP Furthermore, let's assume that the program .B sendf is a (symbolic) link in the user's .I $HOME/bin/ directory to .BR send . Then, any of the commands .PP .RS 5 .nf comp dist forw repl .fi .RE .PP constructs the message draft in the `draft' folder using the `new' message number. Furthermore, they each define `cur' in this folder to be that message draft. If the user were to use the .B quit option at `What now?' level, then later on, if no other draft composition was done, the draft could be sent with simply .PP .RS 5 .nf sendf .fi .RE .PP Or, if more editing was required, the draft could be edited with .PP .RS 5 .nf comp -use .fi .RE .PP Instead, if other drafts had been composed in the meantime, so that this message draft was no longer known as `cur' in the `draft' folder, then the user could .B scan the folder to see which message draft in the folder should be used for editing or sending. Clever users could even employ a back-quoted .B pick to do the work: .PP .RS 5 .nf comp -use `pick +drafts -to nmh-workers` .fi .RE .PP or .PP .RS 5 .nf sendf `pick +drafts -to nmh-workers` .fi .RE .PP Note that in the .B comp example, the output from .B pick must resolve to a single message draft (it makes no sense to talk about composing two or more drafts with one invocation of .BR comp ). In contrast, in the .B send example, as many message drafts as desired can appear, since .B send doesn't mind sending more than one draft at a time. .PP Note that the argument .B \-draftfolder .I +folder is not included in the profile entry for .BR send , since when .BR comp , et. al., invoke .B send directly, they supply .B send with the UNIX pathname of the message draft, and .B not a .B \-draftmessage .I msg argument. As far as .B send is concerned, a draft folder is not being used. .PP It is important to realize that .B nmh treats the draft folder like a standard .B nmh folder in nearly all respects. There are two exceptions: .PP First, under no circumstancs will the .B \-draftfolder .I folder switch cause the named folder to become the current folder. .PP Obviously, if the folder appeared in the context of a standard .I +folder argument to an .B nmh program, as in .PP .RS 5 .nf scan +drafts .fi .RE .PP it might become the current folder, depending on the context changes of the .B nmh program in question. .PP Second, although conceptually .B send deletes the `msgs' named in the draft folder, it does not call .I delete\-prog to perform the deletion. .SS "What Happens if the Draft Exists" When the .BR comp , .BR dist , .BR forw , and .B repl commands are invoked and the draft you indicated already exists, these programs will prompt the user for a reponse directing the program's action. The prompt is .PP .RS 5 .nf Draft ``/home/foobar/nmhbox/draft'' exists (xx bytes). Disposition? .fi .RE .PP The appropriate responses and their meanings are: .PP .RS 5 .fc ^ ~ .nf .ta \w'replace 'u .BR ^replace~^ "- deletes the draft and starts afresh" .BR ^list~^ "- lists the draft" .BR ^refile~^ "- files the draft into a folder and starts afresh" .BR ^quit~^ "- leaves the draft intact and exits" .fi .RE .PP In addition, if you specified .B \-draftfolder .I folder to the command, then one other response will be accepted: .PP .RS 5 .fc ^ ~ .nf .ta \w'replace 'u .BR ^new~^ "- finds a new draft" .fi .RE .PP just as if .B \-draftmessage .I new had been given. Finally, the .B comp command will accept one more response: .PP .RS 5 .fc ^ ~ .nf .ta \w'replace 'u .BR ^use~^ "- re-uses the draft" .fi .RE .PP just as if .B \-use had been given. .SH CONTEXT None nmh-1.5/man/mh-format.man000644 007761 000765 00000054554 11762736345 015267 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MH-FORMAT %manext5% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mh-format \- format file for nmh message system .SH DESCRIPTION Several .B nmh commands utilize either a .I format string or a .I format file during their execution. For example, .B scan uses a format string which directs it how to generate the scan listing for each message; .B repl uses a format file which directs it how to generate the reply to a message, and so on. .PP There are a few alternate scan listing formats available in .IR nmh/etc/scan.time , .IR nmh/etc/scan.size , and .IR nmh/etc/scan.timely . Look in .I nmh/etc for other .B scan and .B repl format files which may have been written at your site. .PP It suffices to have your local .B nmh expert actually write new format commands or modify existing ones. This manual section explains how to do that. Note: familiarity with the C .B printf routine is assumed. .PP A format string consists of ordinary text, and special multi-character escape sequences which begin with `%'. When specifying a format string, the usual C backslash characters are honored: `\\b', `\\f', `\\n', `\\r', and `\\t'. Continuation lines in format files end with `\\' followed by the newline character. .\" TALK ABOUT SYNTAX FIRST, THEN SEMANTICS .SS SYNTAX Format strings are built around .IR "escape sequences" . There are three types of escape sequences: header .IR components , built-in .IR functions , and flow .IR control . Comments may be inserted in most places where a function argument is not expected. A comment begins with `%;' and ends with a (non-escaped) newline. .PP A .I component escape is specified as .RI `%{ component }', and exists for each header found in the message being processed. For example .RI `%{ date }' refers to the \*(lqDate:\*(rq field of the appropriate message. All component escapes have a string value. Normally, component values are compressed by converting any control characters (tab and newline included) to spaces, then eliding any leading or multiple spaces. However, commands may give different interpretations to some component escapes; be sure to refer to each command's manual entry for complete details. Some commands (such as .B ap and .BR mhl ) use a special component .RI `%{ text }' to refer to the text being processed; see their respective man pages for details and examples. .PP A .I function escape is specified as .RI `%( function )'. All functions are built-in, and most have a string or numeric value. A function escape may have an .IR argument . The argument follows the function escape: separating whitespace is discarded: .RI `%( function " " argument )'. .PP In addition to literal numbers or strings, the argument to a function escape can be another function, a component, or a control escape. When the argument is a function or a component, they are listed without a leading `%'. When control escapes are used as function arguments, they written as normally, with a leading `%'; .SS "Control escapes" .PP A .I control escape is one of: `%<', `%?', `%|', or `%>'. These are combined into the conditional execution construct: .PP .RS 5 .nf .RI "%< " condition " " "format-text" .RI "%? " condition " " "format-text" \&... .RI "%| " "format-text" %> .fi .RE .PP Extra white space is shown here only for clarity. These constructs may be nested without ambiguity. They form a general .B if\-elseif\-else\-endif block where only one of the format-texts is interpreted. In other words, `%<' is like the "if", `%?' is like the "elseif", `%|' is like "else", and `%>' is like "endif". .PP A `%<' or `%?' control escape causes its condition to be evaluated. This condition is a .I component or .IR function . For integer valued functions or components, the condition is true if the function return or component value is non-zero, and false if zero. For string valued functions or components, the condition is true if the function return or component value is a non-empty string, and false for an empty string. .PP The `%?' control escape is optional, and may there may be more than one `%?' control escape in a conditional block. The `%|' control escape is also optional, but may be included at most once. .SS "Function escapes" Functions expecting an argument generally require an argument of a particular type. In addition to the number and string types, these include: .PP .RS 5 .nf .ta +\w'Argument 'u +\w'An optional component, 'u .I "Argument Description Example Syntax" literal A literal number %(\fIfunc\fR 1234) or string %(\fIfunc\fR text string) comp Any component %(\fIfunc\fR\^{\fIin-reply-to\fR\^}) date A date component %(\fIfunc\fR\^{\fIdate\fR\^}) addr An address component %(\fIfunc\fR\^{\fIfrom\fR\^}) expr Nothing %(\fIfunc\fR) or a subexpression %(\fIfunc\fR\^(\fIfunc2\fR\^)) or control escape %(\fIfunc\fR %<{\fIreply-to\fR\^}%|%{\fIfrom\fR\^}%>) .fi .RE .PP The types .I date and .I addr have the same syntax as .IR comp , but require that the header component be a date string, or address string, respectively. .PP Most arguments not of type .IR expr are required. When escapes are nested (via expr arguments), evaluation is done from inner-most to outer-most. As noted above, for the expr argument type, functions and components are written without a leading `%'. Control escape arguments must use a leading `%', preceded by a space. .PP For example, .PP .RS 5 .nf %<(mymbox{from}) To: %{to}%> .fi .RE .PP writes the value of the header component \*(lqFrom:\*(rq to the internal register named str; then (\fImymbox\fR\^) reads str and writes its result to the internal register named .IR num ; then the control escape evaluates .IR num . If .IR num is non-zero, the string \*(lqTo:\*(rq is printed followed by the value of the header component \*(lqTo:\*(rq. .SS Evaluation The evaluation of format strings is performed by a small virtual machine. The machine is capable of evaluating nested expressions as described above, and in addition has an integer register .IR num , and a text string register .IR str . When a function escape that accepts an optional argument is processed, and the argument is not present, the current value of either .I num or .I str is used as the argument: which register is used depends on the function, as listed below. .PP Component escapes write the value of their message header in .IR str . Function escapes write their return value in .I num for functions returning integer or boolean values, and in .I str for functions returning string values. (The boolean type is a subset of integers with usual values 0=false and 1=true.) Control escapes return a boolean value, setting .I num to 1 if the last explicit condition evaluated by a `%<' or `%?' control succeeded, and 0 otherwise. .PP All component escapes, and those function escapes which return an integer or string value, evaluate to their value as well as setting .I str or .IR num . Outermost escape expressions in these forms will print their value, but outermost escapes which return a boolean value do not result in printed output. .SS Functions The function escapes may be roughly grouped into a few categories. .PP .RS 5 .nf .ta \w'Fformataddr 'u +\w'Aboolean 'u +\w'Rboolean 'u .I "Function Argument Result Description" msg integer message number cur integer message is current (0 or 1) unseen integer message is unseen (0 or 1) size integer size of message strlen integer length of \fIstr\fR width integer output buffer size in bytes charleft integer bytes left in output buffer timenow integer seconds since the UNIX epoch me string the user's mailbox (username) myhost string the user's local hostname myname string the user's name localmbox string the complete local mailbox eq literal boolean \fInum\fR == \fIarg\fR ne literal boolean \fInum\fR != \fIarg\fR gt literal boolean \fInum\fR > \fIarg\fR match literal boolean \fIstr\fR contains \fIarg\fR amatch literal boolean \fIstr\fR starts with \fIarg\fR plus literal integer \fIarg\fR plus \fInum\fR minus literal integer \fIarg\fR minus \fInum\fR divide literal integer \fInum\fR divided by \fIarg\fR modulo literal integer \fInum\fR modulo \fIarg\fR num literal integer Set \fInum\fR to \fIarg\fR. num integer Set \fInum\fR to zero. lit literal string Set \fIstr\fR to \fIarg\fR. lit string Clear \fIstr\fR. getenv literal string Set \fIstr\fR to environment value of \fIarg\fR profile literal string Set \fIstr\fR to profile component \fIarg\fR value .\" dat literal int return value of dat[arg] nonzero expr boolean \fInum\fR is non-zero zero expr boolean \fInum\fR is zero null expr boolean \fIstr\fR is empty nonnull expr boolean \fIstr\fR is non-empty void expr Set \fIstr\fR or \fInum\fR comp comp string Set \fIstr\fR to component text compval comp integer Set \fInum\fR to \*(lq\fBatoi\fR(\fIcomp\fR\^)\*(rq .\" compflag comp integer Set \fInum\fR to component flags bits (internal) .\" decodecomp comp string Set \fIstr\fR to RFC-2047 decoded component text decode expr string decode \fIstr\fR as RFC-2047 (MIME-encoded) component unquote expr string remove RFC-2822 quotes from \fIstr\fR trim expr trim trailing white-space from \fIstr\fR putstr expr print \fIstr\fR putstrf expr print \fIstr\fR in a fixed width putnum expr print \fInum\fR putnumf expr print \fInum\fR in a fixed width .\" addtoseq literal add msg to sequence (LBL option) putlit expr print \fIstr\fR without space compression nodate string integer Argument not a date string (0 or 1) formataddr expr append \fIarg\fR to \fIstr\fR as a (comma separated) address list concataddr expr append \fIarg\fR to \fIstr\fR as a (comma separated) address list, including duplicates, see Special Handling putaddr literal print \fIstr\fR address list with \fIarg\fR as optional label; get line width from \fInum\fR .fi .RE .PP The (\fIme\fR\^) function returns the username of the current user. The (\fImyhost\fR\^) function returns the .B localname entry in .IR mts.conf , or the local hostname if .B localname is not configured. The (\fImyname\fR\^) function will return the value of the .B SIGNATURE environment variable if set, otherwise will return the passwd GECOS field (truncated at the first comma if it contains one) for the current user. The (\fIlocalmbox\fR\^) function will return the complete form of the local mailbox, suitable for use in a \*(lqFrom\*(rq header. It will return the .RI \*(lq Local-Mailbox \*(rq profile entry if it is set; if it is not, it will be equivalent to: .PP .RS 5 .nf %(myname) <%(me)@%(myhost)> .fi .RE .PP The following functions require a date component as an argument: .PP .RS 5 .nf .ta \w'Fformataddr 'u +\w'Aboolean 'u +\w'Rboolean 'u .I "Function Argument Return Description" sec date integer seconds of the minute min date integer minutes of the hour hour date integer hours of the day (0-23) wday date integer day of the week (Sun=0) day date string day of the week (abbrev.) weekday date string day of the week sday date integer day of the week known? (1=explicit,0=implicit,\-1=unknown) mday date integer day of the month yday date integer day of the year mon date integer month of the year month date string month of the year (abbrev.) lmonth date string month of the year year date integer year (may be > 100) zone date integer timezone in hours tzone date string timezone string szone date integer timezone explicit? (1=explicit,0=implicit,\-1=unknown) date2local date coerce date to local timezone date2gmt date coerce date to GMT dst date integer daylight savings in effect? (0 or 1) clock date integer seconds since the UNIX epoch rclock date integer seconds prior to current time tws date string official 822 rendering pretty date string user-friendly rendering .fi .RE .PP These functions require an address component as an argument. The return value of functions noted with `*' is computed from the first address present in the header component. .PP .RS 5 .nf .ta \w'Fformataddr 'u +\w'Aboolean 'u +\w'Rboolean 'u .I "Function Argument Return Description" proper addr string official 822 rendering friendly addr string user-friendly rendering addr addr string mbox@host or host!mbox rendering* pers addr string the personal name* note addr string commentary text* mbox addr string the local mailbox* mymbox addr integer List has the user's address? (0 or 1) host addr string the host domain* nohost addr integer no host was present (0 or 1)* type addr integer host type* (0=local,1=network, \-1=uucp,2=unknown) path addr string any leading host route* ingrp addr integer address was inside a group (0 or 1)* gname addr string name of group* .fi .RE .PP (A clarification on (\fImymbox\fR\^{\fIcomp\fR\^}) is in order. This function checks each of the addresses in the header component \*(lq\fIcomp\fR\*(rq against the user's mailbox name and any .RI \*(lq Alternate-Mailboxes \*(rq. It returns true if any address matches, however, it also returns true if the \*(lq\fIcomp\fR\*(rq header is not present in the message. If needed, the (\fInull\fR\^) function can be used to explicitly test for this case.) .SS Formatting When a function or component escape is interpreted and the result will be immediately printed, an optional field width can be specified to print the field in exactly a given number of characters. For example, a numeric escape like %4(\fIsize\fR\^) will print at most 4 digits of the message size; overflow will be indicated by a `?' in the first position (like `?234'). A string escape like %4(\fIme\fR\^) will print the first 4 characters and truncate at the end. Short fields are padded at the right with the fill character (normally, a blank). If the field width argument begins with a leading zero, then the fill character is set to a zero. .PP The functions (\fIputnumf\fR\^) and (\fIputstrf\fR\^) print their result in exactly the number of characters specified by their leading field width argument. For example, %06(\fIputnumf\fR\^(\fIsize\fR\^)) will print the message size in a field six characters wide filled with leading zeros; %14(\fIputstrf\^\fR{\fIfrom\^\fR}) will print the \*(lqFrom:\*(rq header component in fourteen characters with trailing spaces added as needed. For \fIputstrf\fR, using a negative value for the field width causes right-justification of the string within the field, with padding on the left up to the field width. The functions (\fIputnum\fR\^) and (\fIputstr\fR\^) are somewhat special: they print their result in the minimum number of characters required, and ignore any leading field width argument. The (\fIputlit\fR\^) function outputs the exact contents of str register without any changes such as duplicate space removal or control character conversion. .PP The available output width is kept in an internal register; any output past this width will be truncated. .SS Special Handling A few functions have different behavior depending on what command they are being invoked from. .PP In .BR repl the (\fIformataddr\fR\^) function stores all email addresses encountered into an internal cache and will use this cache to suppress duplicate addresses. If you need to create an address list that includes previously-seen addresses you may use the (\fIconcataddr\fR\^) function, which is identical to (\fIformataddr\fR\^) in all other respects. Note that (\fIconcataddr\fR\^) will NOT add addresses to the duplicate-suppression cache. .SS Other Hints and Tips Sometimes to format function writers it is confusing as to why output is duplicated. The general rule to remember is simple: If a function or component escape is used where it starts with a %, then it will generate text in the output file. Otherwise, it will not. .PP A good example is a simple attempt to generate a To: header based on the From: and Reply-To: headers: .PP .RS 5 .nf %(formataddr %<{reply-to}%|%{from})%(putaddr To: ) .fi .RE .PP Unfortuantely if the Reply-to: header is NOT present, the output line that is generated will be something like: .PP .RS 5 .nf My From User To: My From User .fi .RE .PP What went wrong? When performing the test for the .B if clause (%<), the component is not output because it is considered an argument to the .B if statement (hence the rule about the lack of % applies). But the component escape in our .B else statement (everything after the `%|') is NOT an argument to anything; the syntax is that it is written with a %, and thus the value of that component is output. This also has the side effect of setting the .I str register, which is later picked up by the (\fIformataddr\fR\^) function and then output by (\fIputaddr\fR\^). This format string has another bug as well; there should always be a valid width value in the .I num register when (\fIputaddr\fR\^) is called, otherwise bad formatting can take place. .PP The solution is to use the (\fIvoid\fR\^) function; this will prevent the function or component from outputting any text. With this in place (and using (\fIwidth\fR\^) to set the .I num register for the width, a better implementation would look like: .PP .RS 3 .nf %(formataddr %<{reply-to}%|%(void{from})%(void(width))%(putaddr To: ) .fi .RE .PP It should be noted here that the side-effects of functions and component escapes still are in force: as a result each component test in the .B if\-elseif\-else\-endif clause sets the .I str register. .PP As an additional note, the (\fIformataddr\fR\^) and (\fIconcataddr\fR\^) functions have some behavior when it comes to the .I str register. The starting point of the register is saved and is used to build up entries in the address list. .PP You will find the .B ap and .B fmtdump utilities invaluable in debugging problems with format strings. .SS Examples With all this in mind, here's the default format string for .BR scan . It's been divided into several pieces for readability. The first part is: .PP .RS .nf %4(msg)%<(cur)+%| %>%<{replied}\-%?{encrypted}E%| %> .fi .RE .PP which says that the message number should be printed in four digits. If the message is the current message then a `+' else a space should be printed; if a \*(lqReplied:\*(rq field is present then a `\-' else if an \*(lqEncrypted:\*(rq field is present then an `E' otherwise a space should be printed. Next: .PP .RS .nf %02(mon{date})/%02(mday{date}) .fi .RE .PP the month and date are printed in two digits (zero filled) separated by a slash. Next, .PP .RS 5 .nf %<{date} %|*%> .fi .RE .PP If a \*(lqDate:\*(rq field was present, then a space is printed, otherwise a `*'. Next, .PP .RS 5 .nf %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%> .fi .RE .PP if the message is from me, and there is a \*(lqTo:\*(rq header, print \*(lqTo:\*(rq followed by a \*(lquser-friendly\*(rq rendering of the first address in the \*(lqTo:\*(rq field; any MIME-encoded characters are decoded into the actual characters. Continuing, .PP .RS 5 .nf %<(zero)%17(decode(friendly{from}))%> .fi .RE .PP if either of the above two tests failed, then the \*(lqFrom:\*(rq address is printed in a mime-decoded, \*(lquser-friendly\*(rq format. And finally, .PP .RS 5 .nf %(decode{subject})%<{body}<<%{body}>>%> .fi .RE .PP the mime-decoded subject and initial body (if any) are printed. .PP For a more complicated example, next consider a possible .I replcomps format file. .PP .RS 5 .nf %(lit)%(formataddr %<{reply-to} .fi .RE .PP This clears .I str and formats the \*(lqReply-To:\*(rq header if present. If not present, the else-if clause is executed. .PP .RS 5 .nf %?{from}%?{sender}%?{return-path}%>)\\ .fi .RE .PP This formats the \*(lqFrom:\*(rq, \*(lqSender:\*(rq and \*(lqReturn-Path:\*(rq headers, stopping as soon as one of them is present. Next: .PP .RS 5 .nf %<(nonnull)%(void(width))%(putaddr To: )\\n%>\\ .fi .RE .PP If the \fIformataddr\fR result is non-null, it is printed as an address (with line folding if needed) in a field \fIwidth\fR wide with a leading label of \*(lqTo:\*(rq. .PP .RS 5 .nf %(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\\ .fi .RE .PP .I str is cleared, and the \*(lqTo:\*(rq and \*(lqCc:\*(rq headers, along with the user's address (depending on what was specified with the \*(lq\-cc\*(rq switch to \fIrepl\fR\^) are formatted. .PP .RS 5 .nf %<(nonnull)%(void(width))%(putaddr cc: )\\n%>\\ .fi .RE .PP If the result is non-null, it is printed as above with a leading label of \*(lqcc:\*(rq. .PP .RS 5 .nf %<{fcc}Fcc: %{fcc}\\n%>\\ .fi .RE .PP If a .B \-fcc .I folder switch was given to .B repl (see .BR repl (1) for more details about %{\fIfcc\fR\^}), an \*(lqFcc:\*(rq header is output. .PP .RS 5 .nf %<{subject}Subject: Re: %{subject}\\n%>\\ .fi .RE .PP If a subject component was present, a suitable reply subject is output. .PP .RS 5 .nf %<{message-id}In-Reply-To: %{message-id}\\n%>\\ %<{message-id}References: %<{references} %{references}%>\\ %{message-id}\\n%> \-\-\-\-\-\-\-\- .fi .RE .PP If a message-id component was present, an \*(lqIn-Reply-To:\*(rq header is output including the message-id, followed by a \*(lqReferences:\*(rq header with references, if present, and the message-id. As with all plain-text, the row of dashes are output as-is. .PP This last part is a good example for a little more elaboration. Here's that part again in pseudo-code: .PP .RS 5 .nf .ta .5i 1i 1.5i 2i if (comp_exists(message-id)) then print (\*(lqIn-reply-to: \*(rq) print (message-id.value) print (\*(lq\\n\*(rq) endif if (comp_exists(message-id)) then print (\*(lqReferences: \*(rq) if (comp_exists(references)) then print(references.value); endif print (message-id.value) print (\*(lq\\n\*(rq) endif .fi .RE .PP .\" (Note that this pseudocode begs the question ``why not just .\" support this syntax?'' MH has been hacked on for a long time...) .\".PP One more example: Currently, .B nmh supports very large message numbers, and it is not uncommon for a folder to have far more than 10000 messages. .\" (Indeed, the original MH .\" tutorial document by Rose and Romine is entitled "How to .\" process 200 messages a day and still get some real work .\" done." The authors apparently only planned to get .\" real work done for about 50 days per folder.) Nontheless (as noted above) the various scan format strings are inherited from older MH versions, and are generally hard-coded to 4 digits of message number before formatting problems start to occur. The nmh format strings can be modified to behave more sensibly with larger message numbers: .PP .RS .nf %(void(msg))%<(gt 9999)%(msg)%|%4(msg)%> .fi .RE .PP The current message number is placed in \fInum\fP. (Note that .RI ( msg ) is an int function, not a component.) The .RI ( gt ) conditional is used to test whether the message number has 5 or more digits. If so, it is printed at full width: otherwise at 4 digits. .SH "SEE ALSO" scan(1), repl(1), ap(8), dp(8) .SH CONTEXT None nmh-1.5/man/mh-mail.man000644 007761 000765 00000016004 11762736345 014705 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MH-MAIL %manext5% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mh-mail \- message format for nmh message system .SH SYNOPSIS any .B nmh command .SH DESCRIPTION .B nmh processes messages in a particular format. It should be noted that although neither Bell nor Berkeley mailers produce message files in the format that .B nmh prefers, .B nmh can read message files in that antiquated format. .PP Each user possesses a mail drop box which initially receives all messages processed by .BR post . .B Inc will read from that drop box and incorporate the new messages found there into the user's own mail folders (typically .RI \*(lq +inbox \*(rq). The mail drop box consists of one or more messages. .PP Messages are expected to consist of lines of text. Graphics and binary data are not handled. No data compression is accepted. All text is clear ASCII 7-bit data. .PP The general \*(lqmemo\*(rq framework of RFC\-822 is used. A message consists of a block of information in a rigid format, followed by general text with no specified format. The rigidly formatted first part of a message is called the header, and the free-format portion is called the body. The header must always exist, but the body is optional. These parts are separated by an empty line, i.e., two consecutive newline characters. Within .B nmh , the header and body may be separated by a line consisting of dashes: .PP .RS 5 .nf From: Local Mailbox To: cc: Fcc: +outbox Subject: .fi .RE .PP The header is composed of one or more header items. Each header item can be viewed as a single logical line of ASCII characters. If the text of a header item extends across several real lines, the continuation lines are indicated by leading spaces or tabs. .PP Each header item is called a component and is composed of a keyword or name, along with associated text. The keyword begins at the left margin, may NOT contain spaces or tabs, may not exceed 63 characters (as specified by RFC\-822), and is terminated by a colon (`:'). Certain components (as identified by their keywords) must follow rigidly defined formats in their text portions. .PP The text for most formatted components (e.g., \*(lqDate:\*(rq and \*(lqMessage\-Id:\*(rq) is produced automatically. The only ones entered by the user are address fields such as \*(lqTo:\*(rq, \*(lqcc:\*(rq, etc. Internet addresses are assigned mailbox names and host computer specifications. The rough format is \*(lqlocal@domain\*(rq, such as \*(lqMH@UCI\*(rq, or \*(lqMH@UCI\-ICSA.ARPA\*(rq. Multiple addresses are separated by commas. A missing host/domain is assumed to be the local host/domain. .PP As mentioned above, a blank line (or a line of dashes) signals that all following text up to the end of the file is the body. No formatting is expected or enforced within the body. .PP Following is a list of header components that are considered meaningful to various .B nmh programs. .PP .BR Date : .RS 5 Added by .BR post , contains date and time of the message's entry into the mail transport system. .RE .PP .BR From : .RS 5 This header is filled in by default with the system's idea of the user's local mailbox. This can be changed with the .B Local\-Mailbox profile entry. It contains the address of the author or authors (may be more than one if a \*(lqSender:\*(rq field is present). For a standard reply (using .BR repl ), the reply address is constructed by checking the following headers (in this order): \*(lqMail-Reply\-To:\*(rq, \*(lqReply\-To:\*(rq, \*(lqFrom:\*(rq, \*(lqSender:\*(rq. A \*(lqFrom:\*(rq header MUST exist when the message is sent to .BR post, otherwise the message will be rejected. .RE .PP .BR Mail\-Reply\-To : .RS 5 For a standard reply (using .BR repl ), the reply address is constructed by checking the following headers (in this order): \*(lqMail-Reply\-To:\*(rq, \*(lqReply\-To:\*(rq, \*(lqFrom:\*(rq, \*(lqSender:\*(rq. .RE .PP .BR Mail\-Followup\-To : .RS 5 When making a \*(lqgroup\*(rq reply (using .B repl .BR \-group ), any addresses in this field will take precedence, and no other reply address will be added to the draft. If this header is not available, then the return addresses will be constructed from the \*(lqMail-Reply\-To:\*(rq, or \*(lqReply\-To:\*(rq, or \*(lqFrom:\*(rq, along with adding the addresses from the headers \*(lqTo:\*(rq, \*(lqcc:\*(rq, as well as adding your personal address. .RE .PP .BR Reply\-To : .RS 5 For a standard reply (using .BR repl ), the reply address is constructed by checking the following headers (in this order): \*(lqMail-Reply\-To:\*(rq, \*(lqReply\-To:\*(rq, \*(lqFrom:\*(rq, \*(lqSender:\*(rq. .RE .PP .BR Sender : .RS 5 Required by .B post in the event that the message has multiple addresses on the \*(lqFrom:\*(rq line. It is otherwise optional. This line should contain the address of the actual sender. .RE .PP .BR To : .RS 5 Contains addresses of primary recipients. .RE .PP .BR cc : .RS 5 Contains addresses of secondary recipients. .RE .PP .BR Bcc : .RS 5 Still more recipients. However, the \*(lqBcc:\*(rq line is not copied onto the message as delivered, so these recipients are not listed. .B nmh uses an encapsulation method for blind copies, see .BR send (1). .RE .PP .BR Dcc : .RS 5 Still more recipients. However, the \*(lqDcc:\*(rq line is not copied onto the messages as delivered. Recipients on the \*(lqDcc:\*(rq line receive the same messsage as recipients on the \*(lqTo:\*(rq and \*(lqcc:\*(rq lines. See .BR send (1) for more details. .RE .PP .BR Fcc : .RS 5 Causes .B post to copy the message into the specified folder for the sender, if the message was successfully given to the transport system. .RE .PP .BR Message\-ID : .RS 5 A unique message identifier added by .B post if the .B \-msgid flag is set. .RE .PP .BR Subject : .RS 5 Sender's commentary. It is displayed by .BR scan . .RE .PP .BR In\-Reply\-To : .RS 5 A commentary line added by .B repl when replying to a message. .RE .PP .BR Resent\-Date : .RS 5 Added when redistributing a message by .BR post . .RE .PP .BR Resent\-From : .RS 5 Added when redistributing a message by .BR post . .RE .PP .BR Resent\-To: .RS 5 New recipients for a message resent by .BR dist . .RE .PP .BR Resent\-cc : .RS 5 Still more recipients. See \*(lqcc:\*(rq and \*(lqResent\-To:\*(rq. .RE .PP .BR Resent\-Bcc : .RS 5 Even more recipients. See \*(lqBcc:\*(rq and \*(lqResent\-To:\*(rq. .RE .PP .BR Resent\-Fcc : .RS 5 Copy resent message into a folder. See \*(lqFcc:\*(rq and \*(lqResent\-To:\*(rq. .RE .PP .BR Resent\-Message\-Id : .RS 5 A unique identifier glued on by .B post if the .B \-msgid flag is set. See \*(lqMessage\-Id:\*(rq and \*(lqResent\-To:\*(rq. .RE .PP .BR Resent : .RS 5 Annotation for .B dist under the .B \-annotate option. .RE .PP .BR Forwarded : .RS 5 Annotation for .B forw under the .B \-annotate option. .RE .PP .BR Replied : .RS 5 Annotation for .B repl under the .B \-annotate option. .RE .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%mailspool%/$USER~^Location of mail drop .fi .SH "SEE ALSO" .I "Standard for the Format of ARPA Internet Text Messages (RFC\-822) .SH CONTEXT None nmh-1.5/man/mh-profile.man000644 007761 000765 00000055262 11765267273 015436 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MH-PROFILE %manext5% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mh-profile \- user profile customization for nmh message handler .SH SYNOPSIS .I $HOME/.mh\(ruprofile .SH DESCRIPTION Each user of .B nmh is expected to have a file named .I \&.mh\(ruprofile in his or her home directory. This file contains a set of user parameters used by some or all of the .B nmh family of programs. Each entry in the file is of the format .PP .RS 5 .IR profile\-component ": " value .RE .PP If the text of profile entry is long, you may extend it across several real lines by indenting the continuation lines with leading spaces or tabs. Comments may be introduced by a line starting with `#:': .PP .RS 5 .IR # ": " This is a comment. .RE .PP Blank lines are not permitted in .IR \&.mh\(ruprofile. .SS "Standard Profile Entries" The possible profile components are exemplified below. The only mandatory entry is `Path:'. The others are optional; some have default values if they are not present. In the notation used below, (profile, default) indicates whether the information is kept in the user's .B nmh profile or .B nmh context, and indicates what the default value is. .PP .BR Path : Mail .RS 5 Locates .B nmh transactions in directory \*(lqMail\*(rq. This is the only mandatory profile entry. (profile, no default) .RE .PP .BR context : context .RS 5 Declares the location of the .B nmh context file. This is overridden by the environment variable .BR $MHCONTEXT . See the .B HISTORY section below. (profile, default: /context) .RE .PP .BR Current\-Folder : inbox .RS 5 Keeps track of the current open folder. (context, default: folder specified by \*(lqInbox\*(rq) .RE .PP .BR Inbox : inbox .RS 5 Defines the name of your default inbox. (profile, default: inbox) .RE .PP .BR Previous\-Sequence : .I pseq .RS 5 Names the sequence or sequences which should be defined as the `msgs' or `msg' argument given to any .B nmh command. If not present or empty, no such sequences are defined. Otherwise, for each name given, the sequence is first zero'd and then each message is added to the sequence. Read the .BR mh\-sequence (5) man page for the details about this sequence. (profile, no default) .RE .PP .BR Sequence\-Negation : not .RS 5 Defines the string which, when prefixed to a sequence name, negates that sequence. Hence, \*(lqnotseen\*(rq means all those messages that are not a member of the sequence \*(lqseen\*(rq. Read the .BR mh\-sequence (5) man page for the details. (profile, no default) .RE .PP .BR Unseen\-Sequence : unseen .RS 5 Names the sequence or sequences which should be defined as those messages which are unread. The commands .BR inc , .BR rcvstore , .BR mhshow , and .B show will add or remove messages from these sequences when they are incorporated or read. If not present or empty, no such sequences are defined. Otherwise, each message is added to, or removed from, each sequence name given. Read the .BR mh\-sequence (5) man page for the details about this sequence. (profile, no default) .RE .PP .BR mh\-sequences : \&.mh\(rusequences .RS 5 The name of the file in each folder which defines public sequences. To disable the use of public sequences, leave the value portion of this entry blank. (profile, default: \&.mh\(rusequences) .RE .PP .BI atr\- seq \- folder : 172\0178\-181\0212 .RS 5 Keeps track of the private sequence called \*(lqseq\*(rq in the specified folder. Private sequences are generally used for read\-only folders. See the .BR mh\-sequence (5) man page for details about private sequences. (context, no default) .RE .PP .BR Editor : /usr/bin/vi .RS 5 Defines the editor to be used by the commands .BR comp , .BR dist , .BR forw , and .BR repl . (profile, default: %default_editor%) .RE .PP .BR automimeproc : .RS 5 If defined and set to 1, then the .B whatnow program will automatically invoke the buildmimeproc (discussed below) to process each message as a MIME composition draft before it is sent. (profile, no default) .RE .PP .BR Msg\-Protect : 600 .RS 5 An octal number which defines the permission bits for new message files. See .BR chmod (1) for an explanation of the octal number. (profile, default: 0600) .RE .PP .BR Folder\-Protect : 700 .RS 5 An octal number which defines the permission bits for new folder directories. See .BR chmod (1) for an explanation of the octal number. (profile, default: 700) .RE .PP .IR program : .I default switches .RS 5 Sets default switches to be used whenever the mh program .I program is invoked. For example, one could override the \*(lqEditor:\*(rq profile component when replying to messages by adding a component such as: .PP .RS 5 repl: \-editor /bin/ed .RE .PP (profile, no defaults) .RE .PP .IB lasteditor "-next:" .I nexteditor .RS 5 Names \*(lqnexteditor\*(rq to be the default editor after using \*(lqlasteditor\*(rq. This takes effect at \*(lqWhat now?\*(rq prompt in .BR comp , .BR dist , .BR forw , and .BR repl . After editing the draft with \*(lqlasteditor\*(rq, the default editor is set to be \*(lqnexteditor\*(rq. If the user types \*(lqedit\*(rq without any arguments to \*(lqWhat now?\*(rq, then \*(lqnexteditor\*(rq is used. (profile, no default) .RE .PP .BR Folder\-Stack : .I folders .RS 5 The contents of the folder-stack for the .B folder command. (context, no default) .RE .PP .BR Local\-Mailbox : Your Username .RS 5 Tells the various MH tools what your local mailbox is. If set, will be used by the default component files by tools like .B comp and .B repl to construct your default \*(lqFrom\*(rq header. The text used here will be copied exactly to your From: header, so it should already be RFC-822 compliant. If this is set, the .B Signature profile entry is NOT used, so it should include a signature as well. (profile, default: userid@local.hostname) .RE .PP .BR Alternate\-Mailboxes : mh@uci\-750a, bug-mh* .RS 5 Tells .B repl and .B scan which addresses are really yours. In this way, .B repl knows which addresses should be included in the reply, and scan knows if the message really originated from you. Addresses must be separated by a comma, and the hostnames listed should be the \*(lqofficial\*(rq hostnames for the mailboxes you indicate, as local nicknames for hosts are not replaced with their official site names. For each address, if a host is not given, then that address on any host is considered to be you. In addition, an asterisk (`*') may appear at either or both ends of the mailbox and host to indicate wild-card matching. (profile, default: your user-id) .RE .PP .BR Aliasfile : aliases .I other-alias .RS 5 Indicates aliases files for .BR ali , .BR whom , and .BR send . This may be used instead of the .B \-alias .I file switch. (profile, no default) .RE .PP .BR Draft\-Folder : drafts .RS 5 Indicates a default draft folder for .BR comp , .BR dist , .BR forw , .BR refile , and .BR repl . Read the .BR mh\-draft (5) man page for details. (profile, no default) .RE .PP .BI digest\-issue\- list : 1 .RS 5 Tells .B forw the last issue of the last volume sent for the digest .IR list . (context, no default) .RE .PP .BI digest\-volume\- list : 1 .RS 5 Tells .B forw the last volume sent for the digest .IR list . (context, no default) .RE .PP .BR MailDrop : \&.mail .RS 5 Tells .B inc your maildrop, if different from the default. This is superseded by the environment variable .BR $MAILDROP . (profile, default: %mailspool%/$USER) .RE .PP .BR Signature : RAND MH System (agent: Marshall Rose) .RS 5 Tells front-end programs such as .BR comp, .BR forw, and .B repl your mail signature. This is superseded by the environment variable .BR $SIGNATURE . If .B $SIGNATURE is not set and this profile entry is not present, the \*(lqgcos\*(rq field of the \fI/etc/passwd\fP file will be used. Your signature will be added to the address .B send puts in the \*(lqFrom:\*(rq header; do not include an address in the signature text. The \*(lqLocal\-Mailbox\*(rq profile component supersedes all of this. (profile, no default) .RE .SS "Process Profile Entries" The following profile elements are used whenever an .B nmh program invokes some other program such as .BR more . The .I \&.mh\(ruprofile can be used to select alternate programs if the user wishes. The default values are given in the examples. .RE .PP .BR buildmimeproc : %bindir%/mhbuild .RS 5 This is the program used by .B whatnow to process drafts which are MIME composition files. .RE .PP .BR fileproc : %bindir%/refile .RS 5 This program is used to refile or link a message to another folder. It is used by .B send to file a copy of a message into a folder given by a \*(lqFcc:\*(rq field. It is used by the draft folder facility in .BR comp , .BR dist , .BR forw , and .B repl to refile a draft message into another folder. It is used to refile a draft message in response to the .B refile directive at the \*(lqWhat now?\*(rq prompt. .RE .PP .BR formatproc : .RS 5 Program called by .B mhl to filter a component when it is tagged with the \*(lqformat\*(rq variable in the mhl filter. See .BR mhl (5) for more information. .RE .PP .BR incproc : %bindir%/inc .RS 5 Program called by .B mhmail to incorporate new mail when it is invoked with no arguments. .RE .PP .BR installproc : %libdir%/install\-mh .RS 5 This program is called to initialize the environment for new users of .BR nmh . .RE .PP .BR lproc : %default_pager% .RS 5 This program is used to list the contents of a message in response to the .B list directive at the \*(lqWhat now?\*(rq prompt. It is also used by the draft folder facility in .BR comp , .BR dist , .BR forw , and .B repl to display the draft message. .RE .PP .BR mailproc : %bindir%/mhmail .RS 5 This is the program used to automatically mail various messages and notifications. It is used by .B conflict when using the .B \-mail option. It is used by .B send to post failure notices. It is used to retrieve an external-body with access-type `mail-server' (such as when storing the body with .BR mhstore ). .RE .PP .BR mhlproc : %libdir%/mhl .RS 5 This is the program used to filter messages in various ways. It is used by .B mhshow to filter and display the message headers of MIME messages. When the .B \-format or .B \-filter option is used by .B forw or .BR repl , the .I mhlproc is used to filter the message that you are forwarding, or to which you are replying. When the .B \-filter option is given to .BR send , the .I mhlproc is used to filter the copy of the message that is sent to \*(lqBcc:\*(rq recipients. .RE .PP .BR moreproc : %default_pager% .RS 5 This is the program used by .B mhl to page the .B mhl formatted message when displaying to a terminal. It is also the default program used by .B mhshow to display message bodies (or message parts) of type text/plain. .RE .PP .BR mshproc : %bindir%/msh .RS 5 Currently not used. .RE .PP .BR packproc : %bindir%/packf .RS 5 Currently not used. .RE .PP .BR postproc : %libdir%/post .RS 5 This is the program used by .BR send , .BR mhmail , .BR rcvdist , and .B viamail (used by the .B sendfiles shell script) to post a message to the mail transport system. It is also called by .B whom (called with the switches .B \-whom and .BR \-library ) to do address verification. .RE .PP .BR rmmproc : none .RS 5 This is the program used by .B rmm and .B refile to delete a message from a folder. .RE .PP .BR sendproc : %bindir%/send .RS 5 This is the program to use by .B whatnow to actually send the message .RE .PP .BR showmimeproc : %bindir%/mhshow .RS 5 This is the program used by .B show to process and display non-text (MIME) messages. .RE .PP .BR showproc : %libdir%/mhl .RS 5 This is the program used by .B show to filter and display text (non-MIME) messages. .RE .PP .BR whatnowproc : %bindir%/whatnow .RS 5 This is the program invoked by .BR comp , .BR forw , .BR dist , and .B repl to query about the disposition of a composed draft message. .RE .PP .BR whomproc : %bindir%/whom .RS 5 This is the program used by .B whatnow to determine to whom a message would be sent. .RE .SS "Environment Variables" The operation of .B nmh and its commands it also controlled by the presence of certain environment variables. .PP Many of these environment variables are used internally by the \*(lqWhat now?\*(rq interface. It's amazing all the information that has to get passed via environment variables to make the \*(lqWhat now?\*(rq interface look squeaky clean to the .B nmh user, isn't it? The reason for all this is that the .B nmh user can select .B any program as the .IR whatnowproc , including one of the standard shells. As a result, it's not possible to pass information via an argument list. The convention is that environment variables whose names are all upper-case are user-settable; those whose names are lower-case only are used internally by nmh and should not generally be set by the user. .PP .B $MH .RS 5 With this environment variable, you can specify a profile other than .I \&.mh\(ruprofile to be read by the .B nmh programs that you invoke. If the value of .B $MH is not absolute, (i.e., does not begin with a \*(lq/\*(rq), it will be presumed to start from the current working directory. This is one of the very few exceptions in .B nmh where non-absolute pathnames are not considered relative to the user's .B nmh directory. .RE .PP .B $MHCONTEXT .RS 5 With this environment variable, you can specify a context other than the normal context file (as specified in the .B nmh profile). As always, unless the value of .B $MHCONTEXT is absolute, it will be presumed to start from your .B nmh directory. .RE .PP .B $MHBUILD .RS 5 With this environment variable, you can specify an additional user profile (file) to be read by .BR mhbuild , in addition to the mhn.defaults profile. .RE .PP .B $MHN .RS 5 With this environment variable, you can specify an additional user profile (file) to be read by .BR mhn , in addition to the mhn.defaults profile. .B mhn is deprecated, so this support for this variable will be removed from a future nmh release. .RE .PP .B $MHSHOW .RS 5 With this environment variable, you can specify an additional user profile (file) to be read by .BR mhshow , in addition to the mhn.defaults profile. .RE .PP .B $MHSTORE .RS 5 With this environment variable, you can specify an additional user profile (file) to be read by .BR mhstore , in addition to the mhn.defaults profile. .RE .PP .B $MM_CHARSET .RS 5 With this environment variable, you can specify the native character set you are using. You must be able to display this character set on your terminal. .PP This variable is checked to see if a RFC-2047 header field should be decoded (in .BR inc , .BR scan , .BR mhl ). This variable is checked by .B show to see if the .I showproc or .I showmimeproc should be called, since showmimeproc will be called if a text message uses a character set that doesn't match .BR $MM_CHARSET . This variable is checked by .B mhshow for matches against the charset parameter of text contents to decide it the text content can be displayed without modifications to your terminal. This variable is checked by .B mhbuild to decide what character set to specify in the charset parameter of text contents containing 8\-bit characters. .PP When decoding text in such an alternate character set, .B nmh must be able to determine which characters are alphabetic, which are control characters, etc. For many operating systems, this will require enabling the support for locales (such as setting the environment variable .B $LC_CTYPE to iso_8859_1). .RE .PP .B $NOMHNPROC .RS 5 If this variable is set, .B show will next test for MIME messages. This mechanism is obsolete; use the .B \-nocheckmime switch to .B show instead. .RE .PP .B $MAILDROP .RS 5 This variable tells .B inc the default maildrop. This supersedes the \*(lqMailDrop\*(rq profile entry. .RE .PP .B $MAILHOST .RS 5 This variable tells .B inc the POP host to query for mail to incorporate. See the inc(1) man page for more information. .RE .PP .B $USERNAME_EXTENSION .RS 5 This variable is for use with username_extension masquerading. See the mh-tailor(5) man page. .RE .PP .B $SIGNATURE .RS 5 This variable tells .B send and .B post your mail signature. This supersedes the \*(lqSignature\*(rq profile entry, and is not used when the \*(lqLocal\-Mailbox\*(rq profile component is set. .RE .PP .B $USER .RS 5 This variable tells .B repl your user name and .B inc your default maildrop: see the \*(lqMailDrop\*(rq profile entry. .RE .PP .B $HOME .RS 5 This variable tells all .B nmh programs your home directory .RE .PP .B $TERM .RS 5 This variable tells .B nmh your terminal type. .PP The environment variable .B $TERMCAP is also consulted. In particular, these tell .B scan and .B mhl how to clear your terminal, and how many columns wide your terminal is. They also tell .B mhl how many lines long your terminal screen is. .RE .PP .B $MHMTSCONF .RS 5 If this variable is set to a non-null value, it specifies the name of the mail transport configuration file to use by .BR post , .BR inc , and other programs that interact with the mail transport system, instead of the default. See mh-tailor(5). .RE .PP .B $MHMTSUSERCONF .RS 5 If this variable is set to a non-null value, it specifies the name of a mail transport configuration file to be read in addition to the default. See mh-tailor(5). .RE .PP .B $MHTMPDIR .B $TMPDIR .B $TMP .RS 5 These variables are searched, in order, for the directory in which to create some temporary files. .RE .PP .B $MM_NOASK .RS 5 Setting this variable is set to 1 has the same effect as specifying the .B \-nolist and .B \-nopause switches to .BR mhbuild , .BR mhn , and .BR mhshow . OBSOLETE: will be removed in a future version of nmh. .RE .PP .B $MHLDEBUG .RS 5 If this variable is set to a non-null value, .B mhl will emit debugging information. .RE .PP .B $MHPDEBUG .RS 5 If this variable is set to a non-null value, .B pick will emit a representation of the search pattern. .RE .PP .B $MHPOPDEBUG .RS 5 If this variable is set to a non-null value, .B msgchck and .B inc will display their interaction with the POP server. This mechanism is obsolete; use the .B \-snoop switch instead. .RE .PP .B $MHWDEBUG .RS 5 If this variable is set to a non-null value, .B nmh commands that use the .BR Alternate\-Mailboxes profile entry will display debugging information about the values in that entry. .RE .PP .B $editalt .RS 5 This is the alternate message. .PP This is set by .B dist and .B repl during edit sessions so you can peruse the message being distributed or replied to. The message is also available through a link called \*(lq@\*(rq in the current directory if your current working directory and the folder the message lives in are on the same UNIX filesystem. .RE .PP .B $mhdraft .RS 5 This is the path to the working draft. .PP This is set by .BR comp , .BR dist , .BR forw , and .B repl to tell the .I whatnowproc which file to ask \*(lqWhat now?\*(rq questions about. .RE .PP .B $mhaltmsg .RS 5 .B dist and .B repl set .B $mhaltmsg to tell the .I whatnowproc about an alternate message associated with the draft (the message being distributed or replied to). .RE .PP .B $mhfolder .RS 5 This is the folder containing the alternate message. .PP This is set by .B dist and .B repl during edit sessions so you can peruse other messages in the current folder besides the one being distributed or replied to. The environment variable .B $mhfolder is also set by .BR show , .BR prev , and .B next for use by .BR mhl . .RE .PP .B $mhdist .RS 5 .B dist sets .B $mhdist to tell the .I whatnowproc that message re-distribution is occurring. .RE .PP .B $mheditor .RS 5 This is set by .BR comp , .BR repl , .BR forw , and .B dist to tell the .I whatnowproc the user's choice of editor (unless overridden by .BR \-noedit ). .RE .PP .B $mhuse .RS 5 This may be set by .BR comp . .RE .PP .B $mhmessages .RS 5 This is set by .BR dist , .BR forw , and .B repl if annotations are to occur. .RE .PP .B $mhannotate .RS 5 This is set by .BR dist , .BR forw , and .B repl if annotations are to occur. .RE .PP .B $mhinplace .RS 5 This is set by .BR dist , .BR forw , and .B repl if annotations are to occur. .RE .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^or $MH~^Rather than the standard profile ^/context~^The user context ^or $MHCONTEXT~^Rather than the standard context ^/\&.mh\(rusequences~^Public sequences for .fi .SH "SEE ALSO" nmh(1), environ(5), mh-sequence(5) .SH HISTORY The .I \&.mh\(ruprofile contains only static information, which .B nmh programs will .B NOT update. Changes in context are made to the .I context file kept in the users .B nmh directory. This includes, but is not limited to: the \*(lqCurrent\-Folder\*(rq entry and all private sequence information. Public sequence information is kept in each folder in the file determined by the \*(lqmh\-sequences\*(rq profile entry (default is .IR \&.mh\(rusequences ). .PP The .I \&.mh\(ruprofile may override the path of the .I context file, by specifying a \*(lqcontext\*(rq entry (this must be in lower-case). If the entry is not absolute (does not start with a \*(lq/\*(rq), then it is interpreted relative to the user's .B nmh directory. As a result, you can actually have more than one set of private sequences by using different context files. .SH BUGS The shell quoting conventions are not available in the .IR \&.mh\(ruprofile . Each token is separated by whitespace. .PP There is some question as to what kind of arguments should be placed in the profile as options. In order to provide a clear answer, recall command line semantics of all .B nmh programs: conflicting switches (e.g. .B \-header and .BR \-noheader ) may occur more than one time on the command line, with the last switch taking effect. Other arguments, such as message sequences, filenames and folders, are always remembered on the invocation line and are not superseded by following arguments of the same type. Hence, it is safe to place only switches (and their arguments) in the profile. .PP If one finds that an .B nmh program is being invoked again and again with the same arguments, and those arguments aren't switches, then there are a few possible solutions to this problem. The first is to create a (soft) link in your .I $HOME/bin directory to the .B nmh program of your choice. By giving this link a different name, you can create a new entry in your profile and use an alternate set of defaults for the .B nmh command. Similarly, you could create a small shell script which called the .B nmh program of your choice with an alternate set of invocation line switches (using links and an alternate profile entry is preferable to this solution). .PP Finally, the .B csh user could create an alias for the command of the form: .PP .RS 5 alias cmd 'cmd arg1 arg2 ...' .RE .PP In this way, the user can avoid lengthy type-in to the shell, and still give .B nmh commands safely. (Recall that some .B nmh commands invoke others, and that in all cases, the profile is read, meaning that aliases are disregarded beyond an initial command invocation) nmh-1.5/man/mh-sequence.man000644 007761 000765 00000021602 11762736345 015573 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MH-SEQUENCE %manext5% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mh-sequence \- sequence specification for nmh message system .SH SYNOPSIS most .B nmh commands .SH DESCRIPTION A sequence (or sequence set) is a symbolic name representing a message or collection of messages. .B nmh has several internally defined sequences, as well as allowing users to define their own sequences. .SS "Message Specification and Pre\-Defined Message Sequences" Most .B nmh commands accept a `msg' or `msgs' specification, where `msg' indicates one message and `msgs' indicates one or more messages. To designate a message, you may use either its number (e.g., 1, 10, 234) or one of these \*(lqreserved\*(rq message names: .PP .RS 5 .nf .ta +\w'\fIName\fP 'u .I "Name Description" first the first message in the folder last the last message in the folder cur the most recently accessed message prev the message numerically preceding \*(lqcur\*(rq next the message numerically following \*(lqcur\*(rq .fi .RE .PP In commands that take a `msg' argument, the default is \*(lqcur\*(rq. As a shorthand, \*(lq\&.\*(rq is equivalent to \*(lqcur\*(rq. .PP For example: In a folder containing five messages numbered 5, 10, 94, 177 and 325, \*(lqfirst\*(rq is 5 and \*(lqlast\*(rq is 325. If \*(lqcur\*(rq is 94, then \*(lqprev\*(rq is 10 and \*(lqnext\*(rq is 177. .PP The word `msgs' indicates that one or more messages may be specified. Such a specification consists of one message designation or of several message designations separated by spaces. A message designation consists either of a message name as defined above, or a message range. .PP A message range is specified as \*(lqname1\-name2\*(rq or \*(lqname:n\*(rq, where `name', `name1' and `name2' are message names, and `n' is an integer. .PP The specification \*(lqname1\-name2\*(rq designates all currently existing messages from `name1' to `name2' inclusive. The \*(lqreserved\*(rq message name \*(lqall\*(rq is a shorthand for the message range \*(lqfirst\-last\*(rq. .PP The specification \*(lqname:n\*(rq designates up to `n' messages. These messages start with `name' if `name' is a message number or one of the reserved names \*(lqfirst\*(rq \*(lqcur\*(rq, or \*(lqnext\*(rq, The messages end with `name' if `name' is \*(lqprev\*(rq or \*(lqlast\*(rq. The interpretation of `n' may be overridden by preceding `n' with a plus or minus sign; `+n' always means up to `n' messages starting with `name', and `\-n' always means up to `n' messages ending with `name'. .PP In commands which accept a `msgs' argument, the default is either \*(lqcur\*(rq or \*(lqall\*(rq, depending on which makes more sense for each command (see the individual man pages for details). Repeated specifications of the same message have the same effect as a single specification of the message. .PP There is also a special \*(lqreserved\*(rq message name \*(lqnew\*(rq which is used by the .B mhpath command. .SS "User\-Defined Message Sequences" In addition to the \*(lqreserved\*(rq (pre-defined) message names given above, .B nmh supports user-defined sequence names. User-defined sequences allow the .B nmh user a tremendous amount of power in dealing with groups of messages in the same folder by allowing the user to bind a group of messages to a meaningful symbolic name. .PP The name used to denote a message sequence must consist of an alphabetic character followed by zero or more alphanumeric characters, and can not be one of the \*(lqreserved\*(rq message names above. After defining a sequence, it can be used wherever an .B nmh command expects a `msg' or `msgs' argument. .PP Some forms of message ranges are allowed with user-defined sequences. The specification \*(lqname:n\*(rq may be used, and it designates up to the first `n' messages (or last `n' messages for `\-n') which are elements of the user-defined sequence `name'. .PP The specifications \*(lqname:next\*(rq and \*(lqname:prev\*(rq may also be used, and they designate the next or previous message (relative to the current message) which is an element of the user-defined sequence `name'. The specifications \*(lqname:first\*(rq and \*(lqname:last\*(rq are equivalent to \*(lqname:1\*(rq and \*(lqname:\-1\*(rq, respectively. The specification \*(lqname:cur\*(rq is not allowed (use just \*(lqcur\*(rq instead). The syntax of these message range specifications is subject to change in the future. .PP User-defined sequence names are specific to each folder. They are defined using the .B pick and .B mark commands. .PP .SS "Public and Private User-Defined Sequences" There are two varieties of user-defined sequences: public and private. Public sequences of a folder are accessible to any .B nmh user that can read that folder. They are kept in each folder in the file determined by the \*(lqmh\-sequences\*(rq profile entry (default is .IR \&.mh\(rusequences ). Private sequences are accessible only to the .B nmh user that defined those sequences and are kept in the user's .B nmh context file. .PP In general, the commands that create sequences (such as .B pick and .BR mark ) will create public sequences if the folder for which the sequences are being defined is writable by the .B nmh user. For most commands, this can be overridden by using the switches .B \-public and .BR \-private . But if the folder is read\-only, or if the \*(lqmh\-sequences\*(rq profile entry is defined but empty, then \fIprivate\fR sequences will be created instead. .SS "Sequence Negation" .B Nmh provides the ability to select all messages not elements of a user-defined sequence. To do this, the user should define the entry \*(lqSequence\-Negation\*(rq in the .B nmh profile file; its value may be any string. This string is then used to preface an existing user-defined sequence name. This specification then refers to those messages not elements of the specified sequence name. For example, if the profile entry is: .PP .RS 5 Sequence\-Negation: not .RE .PP then anytime an .B nmh command is given \*(lqnotfoo\*(rq as a `msg' or `msgs' argument, it would substitute all messages that are not elements of the sequence \*(lqfoo\*(rq. .PP Obviously, the user should beware of defining sequences with names that begin with the value of the \*(lqSequence\-Negation\*(rq profile entry. .SS "The Previous Sequence" .B Nmh provides the ability to remember the `msgs' or `msg' argument last given to an .B nmh command. The entry \*(lqPrevious\-Sequence\*(rq should be defined in the .B nmh profile; its value should be a sequence name or multiple sequence names separated by spaces. If this entry is defined, when when an .B nmh command finishes, it will define the sequence(s) named in the value of this entry to be those messages that were specified to the command. Hence, a profile entry of .PP .RS 5 Previous\-Sequence: pseq .RE .PP directs any .B nmh command that accepts a `msg' or `msgs' argument to define the sequence \*(lqpseq\*(rq as those messages when it finishes. .PP .BR Note : there can be a performance penalty in using the \*(lqPrevious\-Sequence\*(rq facility. If it is used, .B all .B nmh programs have to write the sequence information to the .I \&.mh\(rusequences file for the folder each time they run. If the \*(lqPrevious\-Sequence\*(rq profile entry is not included, only .B pick and .B mark will write to the .B \&.mh\(rusequences file. .SS "The Unseen Sequence" Finally, many users like to indicate which messages have not been previously seen by them. The commands .BR inc , .BR rcvstore , .BR show , .BR mhshow , and .B flist honor the profile entry \*(lqUnseen\-Sequence\*(rq to support this activity. This entry in the .I \&.mh\(ruprofile should be defined as one or more sequence names separated by spaces. If there is a value for \*(lqUnseen\-Sequence\*(rq in the profile, then whenever new messages are placed in a folder (using .B inc or .BR rcvstore ), the new messages will also be added to all the sequences named in this profile entry. For example, a profile entry of .PP .RS 5 Unseen\-Sequence: unseen .RE .PP directs .B inc to add new messages to the sequence \*(lqunseen\*(rq. Unlike the behavior of the \*(lqPrevious\-Sequence\*(rq entry in the profile, however, the sequence(s) will .B not be zeroed by .BR inc . .PP Similarly, whenever .BR show , .BR mhshow , .BR next , or .B prev displays a message, that message will be removed from any sequences named by the \*(lqUnseen\-Sequence\*(rq entry in the profile. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^/context~^The user context ^/\&.mh\(rusequences~^File for public sequences .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^mh-sequences:~^Name of file to store public sequences ^Sequence\-Negation:~^To designate messages not in a sequence ^Previous\-Sequence:~^The last message specification given ^Unseen\-Sequence:~^Those messages not yet seen by the user .fi .SH "SEE ALSO" flist(1), mark(1), pick(1), mh-profile(5) .SH DEFAULTS None nmh-1.5/man/mh-tailor.man000644 007761 000765 00000017431 11762736345 015262 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MH-TAILOR %manext5% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mh-tailor, mts.conf \- mail transport customization for nmh message handler .SH SYNOPSIS .I %etcdir%/mts.conf .SH DESCRIPTION The file .I %etcdir%/mts.conf defines run-time options for those .B nmh programs which interact (in some form) with the message transport system. At present, these (user) programs are: .BR ap , .BR conflict , .BR inc , .BR msgchk , .BR msh , .BR post , .BR rcvdist , and .BR rcvpack . .PP Each option should be given on a single line. Blank lines and lines which begin with `#' are ignored. The options available along with default values and a description of their meanings are listed below: .PP .BR mts : .RS 5 The mail transport method to use. The two acceptable options are .B smtp (which is the default), and .BR sendmail . .PP If you use .BR smtp , this will enable a direct SMTP (simple mail transport protocol) interface in .BR nmh . When sending mail, instead of passing the message to the mail transport agent, .B post will open a socket connection to the mail port on the machine specified in the .B servers entry. .PP If you use .BR sendmail , then .B post will send messages by forking a local copy of .BR sendmail . Currently it will still speak SMTP with this local copy of .BR sendmail . .RE .PP .BR localname : .RS 5 The hostname .B nmh considers local. It should typically be a fully qualified hostname. If this is not set, depending on the version of UNIX you're running, .B nmh will query the system for this value (e.g. uname, gethostname, etc.), and attempt to fully qualify this value. .PP If you are using POP to retrieve new messages, you may want to set this value to the name of the POP server, so that outgoing message appear to have originated on the POP server. .RE .PP .BR localdomain : .RS 5 If this is set, a `.' followed by this string will be appended to your hostname. .PP This should only be needed, if for some reason .B nmh is not able to fully qualify the hostname returned by the system (e.g. uname, gethostname, etc.). .RE .PP .BR clientname : .RS 5 This option specifies the host name that .B nmh will give in the SMTP .B HELO (and .BR EHLO ) command, when posting mail. If not set, the default is to use the host name that .B nmh considers local (see .B localname above). If this option is set, but empty, no .B HELO command will be given. .PP Although the .B HELO command is required by RFC\-821, many SMTP servers do not require it. Early versions of .I SendMail will fail if the hostname given in the .B HELO command is the local host. Later versions of .I SendMail will complain if you omit the .B HELO command. If you run .IR SendMail , find out what your system expects and set this field if needed. .RE .PP .BR systemname : .RS 5 This option is only used for UUCP mail. It specifies the name of the local host in the UUCP \*(lqdomain\*(rq. If not set, depending on the version of UNIX you're running, .B nmh will query the system for this value. This has no equivalent in the .B nmh configuration file. .RE .PP .BR mmdfldir : %mailspool% .RS 5 The directory where maildrops are kept. If this option is set, but empty, the user's home directory is used. This overrides the default value chosen at the time of compilation. .RE .PP .BR mmdflfil : .RS 5 The name of the maildrop file in the directory where maildrops are kept. If this is empty, the user's login name is used. This overrides the default value (which is empty). .RE .PP .BR mmdelim1 : \&\\001\\001\\001\\001\\n .RS 5 The beginning-of-message delimiter for maildrops. .RE .PP .BR mmdelim2 : \&\\001\\001\\001\\001\\n .RS 5 The end-of-message delimiter for maildrops. .RE .PP .BR maildelivery : %libdir%/maildelivery .RS 5 The name of the system-wide default .I maildelivery file. See .BR slocal (1) for the details. .RE .PP .BR everyone : 200 .RS 5 The highest user-id which should NOT receive mail addressed to \*(lqeveryone\*(rq. .RE .PP .BR noshell : .RS 5 If set, then each user-id greater than \*(lqeveryone\*(rq that has a login shell equivalent to the given value (e.g., \*(lq/bin/csh\*(rq) indicates that mail for \*(lqeveryone\*(rq should not be sent to them. This is useful for handling admin, dummy, and guest logins. .RE .SS "SMTP support" This option is only available if you set .B mts to .BR smtp . .PP .BR servers : localhost .RS 5 A lists of hosts and networks which to look for SMTP servers when posting local mail. It turns out this is a major win for hosts which don't run an message transport system. The value of .B servers should be one or more items. Each item is the name of a host which is (hopefully) running a SMTP server. .SS "SendMail" This option is only available if you set .B mts to .BR sendmail . .PP .BR sendmail : %sendmailpath% .RS 5 The pathname to the .B sendmail program. .RE .SS "Post Office Protocol" This option is only available if you have compiled .B nmh with POP support enabled (i.e., \*(lq--enable-pop\*(rq). .PP .BR pophost : .RS 5 The name of the default POP service host. If this is not set, then .B nmh looks in the standard maildrop areas for waiting mail, otherwise the named POP service host is consulted. .RE \" .SS "BBoards Delivery" \" This option is only available if you compiled \fInmh\fP with \" \*(lqbbdelivery:\ on\*(rq. \" .PP \" .BR bbdomain : \" .RS 5 \" The local BBoards domain (a UCI hack). \" .RE \" .SS "BBoards & The POP" \" These options are only available if you compiled \fInmh\fP with \" \*(lqbboards:\ pop\*(rq and \*(lqpop:\ on\*(rq. \" .PP \" .BR popbbhost : \" .RS 5 \" The POP service host which also acts as a BBoard server. This variable \" should be set on the POP BBoards client host. \" .RE \" .PP \" .BR popbbuser : \" .RS 5 \" The guest account on the POP/BB service host. This should be a different \" login ID than either the POP user or the BBoards user. (The user-id \" \*(lqftp\*(rq is highly recommended.) This variable should be set on \" both the POP BBoards client and service hosts. \" .RE \" .PP \" .BR popbblist : \" %etcdir%/hosts.popbb \" .RS 5 \" A file containing of lists of hosts that are allowed to use the POP \" facility to access BBoards using the guest account. If this file is not \" present, then no check is made. This variable should be set on the POP \" BBoards service host. \" .RE .SS "File Locking" A few words on locking: .B nmh has several methods for creating locks on files. When configuring .BR nmh , you will need to decide on the locking style and locking directory (if any). The first controls the method of locking, the second says where lock files should be created. .PP To configure .B nmh for kernel locking, use the \*(lq--with-locking=flock\*(rq configure option if you want to use the .B flock system call; use \*(lq--with-locking=lockf\*(rq if you want to use the .B lockf system call; or use \*(lq--with-locking=fcntl\*(rq if you want to use the .B fcntl system call for kernel-level locking. .PP Instead of kernel locking, you can configure .B nmh to use dot locking by using \*(lq--with-locking=dot\*(rq. Dot locking specifies that a file should be created whose existence means \*(lqlocked\*(rq and whose non-existence means \*(lqunlocked\*(rq. The name of this file is constructed by appending \*(lq.lock\*(rq to the name of the file being locked. If \*(lq--enable-lockdir=directory\*(rq is not specified at build time, lock files will be created in the directory where the file being locked resides. Otherwise, lock files will be created in the directory specified by \*(lq--enable-lockdir\*(rq. .PP Prior to installing .BR nmh , you should see how locking is done at your site, and set the appropriate values. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/mts.conf~^nmh mts configuration file .fi .SH "PROFILE COMPONENTS" None .SH "SEE ALSO" mh\-mts(8), post(8) .SH DEFAULTS As listed above nmh-1.5/man/mhbuild.man000644 007761 000765 00000046277 11765267273 015026 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHBUILD %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhbuild \- translate MIME composition draft .SH SYNOPSIS .na .HP 5 .B mhbuild .I file .RB [ \-list " | " \-nolist ] .RB [ \-realsize " | " \-norealsize ] .RB [ \-headers " | " \-noheaders ] .RB [ \-ebcdicsafe " | " \-noebcdicsafe ] .RB [ \-rfc934mode " | " \-norfc934mode ] .RB [ \-contentid " | " \-nocontentid ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-check " | " \-nocheck ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B mhbuild command will translate a MIME composition draft into a valid MIME message. .PP .B mhbuild creates multi-media messages as specified in RFC\-2045 thru RFC\-2049. Currently .B mhbuild only supports encodings in message bodies, and does not support the encoding of message headers as specified in RFC\-2047. .PP If you specify the name of the composition file as \*(lq-\*(rq, then .B mhbuild will accept the composition draft on the standard input. If the translation of this input is successful, .B mhbuild will output the new MIME message to the standard output. This argument must be the last argument on the command line. .PP Otherwise if the file argument to .B mhbuild is the name of a valid composition file, and the translation is successful, .B mhbuild will replace the original file with the new MIME message. It will rename the original file to start with the \*(lq,\*(rq character and end with the string \*(lq.orig\*(rq, e.g., if you are editing the file \*(lqdraft\*(rq, it will be renamed to \*(lq,draft.orig\*(rq. This allows you to easily recover the .B mhbuild input file. .SS "Listing the Contents" The .B \-list switch tells .B mhbuild to list the table of contents associated with the MIME message that is created. .PP The .B \-headers switch indicates that a one-line banner should be displayed above the listing. The .B \-realsize switch tells .B mhbuild to evaluate the \*(lqnative\*(rq (decoded) format of each content prior to listing. This provides an accurate count at the expense of a small delay. If the .B \-verbose switch is present, then the listing will show any \*(lqextra\*(rq information that is present in the message, such as comments in the \*(lqContent-Type\*(rq header. .SS "Translating the Composition File" .B mhbuild is essentially a filter to aid in the composition of MIME messages. .B mhbuild will convert an .B mhbuild \*(lqcomposition file\*(rq into a valid MIME message. A .B mhbuild \*(lqcomposition file\*(rq is just a file containing plain text that is interspersed with various .B mhbuild directives. When this file is processed by .BR mhbuild , the various directives will be expanded to the appropriate content, and will be encoded according to the MIME standards. The resulting MIME message can then be sent by electronic mail. .PP The formal syntax for a .B mhbuild composition file is defined at the end of this document, but the ideas behind this format are not complex. Basically, the body contains one or more contents. A content consists of either a directive, indicated with a \*(lq#\*(rq as the first character of a line; or, plaintext (one or more lines of text). The continuation character, \*(lq\\\*(lq, may be used to enter a single directive on more than one line, e.g., .PP .RS 5 .nf #image/png \\ /home/foobar/junk/picture.png .fi .RE .PP There are four kinds of directives: \*(lqtype\*(rq directives, which name the type and subtype of the content; \*(lqexternal-type\*(rq directives, which also name the type and subtype of the content; the \*(lqmessage\*(rq directive (#forw), which is used to forward one or more messages; and, the \*(lqbegin\*(rq directive (#begin), which is used to create a multipart content. .PP The \*(lqtype\*(rq directive is used to directly specify the type and subtype of a content. You may only specify discrete types in this manner (can't specify the types multipart or message with this directive). You may optionally specify the name of a file containing the contents in \*(lqnative\*(rq (decoded) format. If this filename starts with the \*(lq|\*(rq character, then it represents a command to execute whose output is captured accordingly. For example, .PP .RS 5 .nf #audio/basic |raw2audio -F < /usr/lib/sound/giggle.au .fi .RE .PP If a filename is not given, .B mhbuild will look for information in the user's profile to determine how the different contents should be composed. This is accomplished by consulting a composition string, and executing it under .BR /bin/sh , with the standard output set to the content. If the .B \-verbose switch is given, .B mhbuild will echo any commands that are used to create contents in this way. .PP The composition string may contain the following escapes: .PP .RS 5 .nf .ta \w'%P 'u %a Insert parameters from directive %f Insert filename containing content %F %f, and stdout is not re-directed %s Insert content subtype %% Insert character % .fi .RE .PP First, .B mhbuild will look for an entry of the form: .PP .RS 5 mhbuild-compose-/ .RE .PP to determine the command to use to compose the content. If this isn't found, .B mhbuild will look for an entry of the form: .PP .RS 5 mhbuild-compose- .RE .PP to determine the composition command. If this isn't found, .B mhbuild will complain. .PP An example entry might be: .PP .RS 5 mhbuild-compose-audio/basic: record | raw2audio -F .RE .PP Because commands like these will vary, depending on the display environment used for login, composition strings for different contents should probably be put in the file specified by the .B $MHBUILD environment variable, instead of directly in your user profile. .PP The \*(lqexternal-type\*(rq directives are used to provide a MIME reference to a content, rather than enclosing the contents itself (for instance, by specifying an ftp site). Hence, instead of providing a filename as with the type directives, external-parameters are supplied. These look like regular parameters, so they must be separated accordingly. For example, .PP .RS 5 .nf #@application/octet-stream; \\ type=tar; \\ conversions=compress \\ [this is the nmh distribution] \\ {application; filename="nmh.tar.gz"} \\ name="nmh.tar.gz"; \\ directory="/pub/nmh"; \\ site="ftp.math.gatech.edu"; \\ access-type=anon-ftp; \\ mode="image" .fi .RE .PP You must give a description string to separate the content parameters from the external-parameters (although this string may be empty). This description string is specified by enclosing it within \*(lq[]\*(rq. A disposition string, to appear in a \*(lqContent-Disposition\*(rq header, may appear in the optional \*(lq{}\*(rq. .PP These parameters are of the form: .PP .RS 5 .nf .ta \w'access-type= 'u access-type= usually \fIanon-ftp\fR or \fImail-server\fR name= filename permission= read-only or read-write site= hostname directory= directoryname (optional) mode= usually \fIascii\fR or \fIimage\fR (optional) size= number of octets server= mailbox subject= subject to send body= command to send for retrieval .fi .RE .PP The \*(lqmessage\*(rq directive (#forw) is used to specify a message or group of messages to include. You may optionally specify the name of the folder and which messages are to be forwarded. If a folder is not given, it defaults to the current folder. Similarly, if a message is not given, it defaults to the current message. Hence, the message directive is similar to the .B forw command, except that the former uses the MIME rules for encapsulation rather than those specified in RFC\-934. For example, .PP .RS 5 .nf #forw +inbox 42 43 99 .fi .RE .PP If you include a single message, it will be included directly as a content of type \*(lqmessage/rfc822\*(rq. If you include more than one message, then .B mhbuild will add a content of type \*(lqmultipart/digest\*(rq and include each message as a subpart of this content. .PP If you are using this directive to include more than one message, you may use the .B \-rfc934mode switch. This switch will indicate that .B mhbuild should attempt to utilize the MIME encapsulation rules in such a way that the \*(lqmultipart/digest\*(rq that is created is (mostly) compatible with the encapsulation specified in RFC\-934. If given, then RFC\-934 compliant user-agents should be able to burst the message on reception\0--\0providing that the messages being encapsulated do not contain encapsulated messages themselves. The drawback of this approach is that the encapsulations are generated by placing an extra newline at the end of the body of each message. .PP The \*(lqbegin\*(rq directive is used to create a multipart content. When using the \*(lqbegin\*(rq directive, you must specify at least one content between the begin and end pairs. .PP .RS 5 .nf #begin This will be a multipart with only one part. #end .fi .RE .PP If you use multiple directives in a composition draft, .B mhbuild will automatically encapsulate them inside a multipart content. Therefore the \*(lqbegin\*(rq directive is only necessary if you wish to use nested multiparts, or create a multipart message containing only one part. .PP For all of these directives, the user may include a brief description of the content between the \*(lq[\*(rq character and the \*(lq]\*(rq character. This description will be copied into the \*(lqContent-Description\*(rq header when the directive is processed. .PP .RS 5 .nf #forw [important mail from Bob] +bob 1 2 3 4 5 .fi .RE .PP Similarly, a disposition string may optionally be provided between \*(lq{\*(rq and \*(lq}\*(rq characters; it will be copied into the \*(lqContent-Disposition\*(rq header when the directive is processed. If a disposition string is provided that does not contain a filename parameter, and a filename is provided in the directive, it will be added to the \*(lqContent-Disposition\*(rq header. For example, the following directive: .PP .RS 5 .nf #text/plain; charset=iso-8859-1 <>{attachment} /tmp/summary.txt .fi .RE .PP creates these message part headers: .PP .RS 5 .nf Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: attachment; filename="summary.txt" .fi .RE .PP By default, .B mhbuild will generate a unique \*(lqContent-ID:\*(rq for each directive, corresponding to each message part; however, the user may override this by defining the ID using the \*(lq<\*(rq and \*(lq>\*(rq characters. The .B \-nocontentid switch suppresses creation of all \*(lqContent-ID:\*(rq headers, even in the top level of the message. .PP In addition to the various directives, plaintext can be present. Plaintext is gathered, until a directive is found or the draft is exhausted, and this is made to form a text content. If the plaintext must contain a \*(lq#\*(rq at the beginning of a line, simply double it, e.g., .PP .RS 5 ##when sent, this line will start with only one # .RE .PP If you want to end the plaintext prior to a directive, e.g., to have two plaintext contents adjacent, simply insert a line containing a single \*(lq#\*(rq character, e.g., .PP .RS 5 .nf this is the first content # and this is the second .fi .RE .PP Finally, if the plaintext starts with a line of the form: .PP .RS 5 Content-Description: text .RE .PP then this will be used to describe the plaintext content. You MUST follow this line with a blank line before starting your text. .PP By default, plaintext is captured as a text/plain content. You can override this by starting the plaintext with \*(lq#<\*(rq followed by a content-type specification. For example, e.g., .PP .RS 5 .nf #" ] [ "[" description "]" ] [ "{" disposition "}" ] [ filename ] EOL | "#@" type "/" subtype 0*(";" attribute "=" value) [ "(" comment ")" ] [ "<" id ">" ] [ "[" description "]" ] [ "{" disposition "}" ] external-parameters EOL | "#forw" [ "<" id ">" ] [ "[" description "]" ] [ "{" disposition "}" ] [ "+"folder ] [ 0*msg ] EOL | "#begin" [ "<" id ">" ] [ "[" description "]" ] [ "{" disposition "}" ] [ "alternative" | "parallel" | something-else ] EOL 1*body "#end" EOL plaintext ::= [ "Content-Description:" description EOL EOL ] 1*line [ "#" EOL ] | "#<" type "/" subtype 0*(";" attribute "=" value) [ "(" comment ")" ] [ "[" description "]" ] [ "{" disposition "}" ] EOL 1*line [ "#" EOL ] line ::= "##" text EOL -- interpreted as "#"text EOL | text EOL .fi .RE .PP .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^$MHBUILD~^Additional profile entries ^%etcdir%/mhn.defaults~^System default MIME profile entries .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^mhbuild-compose-*~^Template for composing contents .fi .SH "SEE ALSO" mhlist(1), mhshow(1), mhstore(1), .br .I "Proposed Standard for Message Encapsulation" (RFC\-934), .br .I "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies" (RFC\-2045), .br .I "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types" (RFC\-2046), .br .I "Multipurpose Internet Mail Extensions (MIME) Part Three: Message Header Extensions for Non-ASCII Text" (RFC\-2047), .br .I "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures" (RFC\-2048), .br .I "Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples" (RFC\-2049) .SH DEFAULTS .nf .RB ` \-headers ' .RB ` \-realsize ' .RB ` \-norfc934mode ' .RB ` \-contentid ' .RB ` \-nocheck ' .RB ` \-noebcdicsafe ' .RB ` \-noverbose ' .fi nmh-1.5/man/mhl.man000644 007761 000765 00000025641 11762736345 014150 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHL %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhl \- produce formatted listings of nmh messages .SH SYNOPSIS .HP 5 .na .B %libdir%/mhl .RB [ \-bell " | " \-nobell ] .RB [ \-clear " | " \-noclear ] .RB [ \-folder .IR +folder ] .RB [ \-form .IR formfile ] .RB [ \-length .IR lines ] .RB [ \-width .IR columns ] .RB [ \-moreproc .IR program ] .RB [ \-nomoreproc ] .RB [ \-fmtproc .IR program ] .RB [ \-nofmtproc ] .RI [ files .IR \&... ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Mhl is an .B nmh command for filtering and/or displaying text messages. It is the default method of displaying text messages for .B nmh (it is the default .IR showproc ). .PP As with .BR more , each of the messages specified as arguments (or the standard input) will be output. If more than one message file is specified, the user will be prompted prior to each one, and a or will begin the output, with clearing the screen (if appropriate), and (usually CTRL\-D) suppressing the screen clear. An (usually CTRL\-C) will abort the current message output, prompting for the next message (if there is one), and a (usually CTRL-\\) will terminate the program (without core dump). .PP The .B \-bell option tells .B mhl to ring the terminal's bell at the end of each page, while the .B \-clear option tells .B mhl to clear the screen at the end of each page (or output a formfeed after each message). Both of these switches (and their inverse counterparts) take effect only if the profile entry .I moreproc is defined but empty, and .B mhl is outputting to a terminal. If the .I moreproc entry is defined and non-empty, and .B mhl is outputting to a terminal, then .B mhl will cause the .I moreproc to be placed between the terminal and .B mhl and the switches are ignored. Furthermore, if the .B \-clear switch is used and \fImhl's\fR output is directed to a terminal, then .B mhl will consult the .B $TERM and .B $TERMCAP environment variables to determine the user's terminal type in order to find out how to clear the screen. If the .B \-clear switch is used and .BR mhl 's output is not directed to a terminal (e.g., a pipe or a file), then .B mhl will send a formfeed after each message. .PP To override the default .I moreproc and the profile entry, use the .B \-moreproc .I program switch. Note that .B mhl will never start a .I moreproc if invoked on a hardcopy terminal. .PP The .B \-length .I length and .B \-width .I width switches set the screen length and width, respectively. These default to the values indicated by .BR $TERMCAP , if appropriate, otherwise they default to 40 and 80, respectively. .PP The default format file used by .B mhl is called .RI \*(lq mhl.format \*(rq. .B mhl will first search for this file in the user's .B nmh directory, and will then search in the directory .IR %etcdir% . This default can be changed by using the .B \-form .I formatfile switch. .PP Finally, the .B \-folder .I +folder switch sets the .B nmh folder name, which is used for the \*(lqmessagename:\*(rq field described below. The environment variable .B $mhfolder is consulted for the default value, which .BR show , .BR next , and .B prev initialize appropriately. .PP .B Mhl operates in two phases: 1) read and parse the format file, and 2) process each message (file). During phase 1, an internal description of the format is produced as a structured list. In phase 2, this list is walked for each message, outputting message information under the format constraints from the format file. .PP The format file can contain information controlling screen clearing, screen size, wrap\-around control, transparent text, component ordering, and component formatting. Also, a list of components to ignore may be specified, and a couple of \*(lqspecial\*(rq components are defined to provide added functionality. Message output will be in the order specified by the order in the format file. .PP Each line of a format file has one of the following forms: .PP .RS 5 .nf ;comment :cleartext variable[,variable...] component:[variable,...] .fi .RE .PP .IP \(bu 4 A line beginning with a `;' is a comment, and is ignored. .IP \(bu 4 A line beginning with a `:' is clear text, and is output exactly as is. .IP \(bu 4 A line containing only a `:' produces a blank line in the output. .IP \(bu 4 A line beginning with \*(lqcomponent:\*(rq defines the format for the specified component, .IP \(bu 4 Remaining lines define the global environment. .PP For example, the line: .PP .RS 5 width=80,length=40,clearscreen,overflowtext="***",overflowoffset=5 .RE .PP defines the screen size to be 80 columns by 40 rows, specifies that the screen should be cleared prior to each page, that the overflow indentation is 5, and that overflow text should be flagged with \*(lq***\*(rq. .PP Following are all of the current variables and their arguments. If they follow a component, they apply only to that component, otherwise, their affect is global. Since the whole format is parsed before any output processing, the last global switch setting for a variable applies to the whole message if that variable is used in a global context (i.e., bell, clearscreen, width, length). .PP .RS 5 .nf .ta \w'noclearscreen 'u +\w'integer/G 'u .I "variable type semantics" width integer screen width or component width length integer screen length or component length offset integer positions to indent \*(lqcomponent: \*(rq overflowtext string text to use at the beginning of an overflow line overflowoffset integer positions to indent overflow lines compwidth integer positions to indent component text after the first line is output uppercase flag output text of this component in all upper case nouppercase flag don't uppercase clearscreen flag/G clear the screen prior to each page noclearscreen flag/G don't clearscreen bell flag/G ring the bell at the end of each page nobell flag/G don't bell component string/L name to use instead of \*(lqcomponent\*(rq for this component nocomponent flag don't output \*(lqcomponent: \*(rq for this component center flag center component on line (works for one\-line components only) nocenter flag don't center leftadjust flag strip off leading whitespace on each line of text noleftadjust flag don't leftadjust compress flag change newlines in text to spaces nocompress flag don't compress wrap flag Wrap lines that exceed width (default) nowrap flag Do not perform line wrapping split flag don't combine multiple fields into a single field nosplit flag combine multiple fields into a single field newline flag print newline at end of components (this is the default) nonewline flag don't print newline at end of components formatfield string format string for this component (see below) decode flag decode text as RFC-2047 encoded header field addrfield flag field contains addresses datefield flag field contains dates format flag Run component through formatproc filter (body only) noformat flag Do not run component through formatproc filter (default) formatarg string Argument to format filter .fi .RE .PP To specify the value of integer\-valued and string\-valued variables, follow their name with an equals\-sign and the value. Integer\-valued variables are given decimal values, while string\-valued variables are given arbitrary text bracketed by double\-quotes. If a value is suffixed by \*(lq/G\*(rq or \*(lq/L\*(rq, then its value is useful in a global\-only or local\-only context (respectively). .PP A line of the form: .PP .RS 5 ignores=component,... .RE .PP specifies a list of components which are never output. .PP The component \*(lqMessageName\*(rq (case\-insensitive) will output the actual message name (file name) preceded by the folder name if one is specified or found in the environment. The format is identical to that produced by the .B \-header option to .BR show . .PP The component \*(lqExtras\*(rq will output all of the components of the message which were not matched by explicit components, or included in the ignore list. If this component is not specified, an ignore list is not needed since all non\-specified components will be ignored. .PP If \*(lqnocomponent\*(rq is NOT specified, then the component name will be output as it appears in the format file. .PP The default format file is: .PP .RS 5 .nf %mhl_format% .fi .RE .PP The variable \*(lqformatfield\*(rq specifies a format string (see .BR mh\-format (5)). The flag variables \*(lqaddrfield\*(rq and \*(lqdatefield\*(rq (which are mutually exclusive), tell .B mhl to interpret the escapes in the format string as either addresses or dates, respectively. .PP By default, .B mhl does not apply any formatting string to fields containing address or dates (see .BR mh\-mail (5) for a list of these fields). Note that this results in faster operation since .B mhl must parse both addresses and dates in order to apply a format string to them. If desired, .B mhl can be given a default format string for either address or date fields (but not both). To do this, on a global line specify: either the flag addrfield or datefield, along with the appropriate formatfield variable string. .PP The \*(lqformat\*(rq flag specifies that this component will be run through the filter program specified by the .IR formatproc profile entry. This filter program is expected to read data on standard input and output data on standard output. Currently the \*(lqformat\*(rq flag is only supported for the \*(lqbody\*(rq component. The component name will be prefixed to the output .IR after the filter has been run. The expected use of this is to filter a message body to create more pleasing text to use in a reply message. A suggested filter to use for .BR repl(1) is as follows: .PP .RS 5 body:component=">",overflowtext=">",overflowoffset=0,format,nowrap .RE .PP The .B \-fmtproc and .B \-nofmtproc switches can be used to override the .I formatproc profile entry. .PP The .I formatarg option specifies a string that is used as an argument to the format filter. This string is processed by .BR mh\-format (5) and all of the message components are available for use. Multiple .I formatarg options can be used to build up multiple arguments to the format filter. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/mhl.format~^The message template ^or /mhl.format~^Rather than the standard template ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^moreproc:~^Program to use as interactive front\-end ^formatproc:~^Program to use as a filter for components that ^^have the \*(lqformat\*(rq flag set. .fi .SH "SEE ALSO" show(1), ap(8), dp(8) .SH DEFAULTS .nf .RB ` \-bell ' .RB ` \-noclear ' .RB ` \-length\ 40 ' .RB ` \-width\ 80 ' .fi .SH CONTEXT None .SH BUGS There should be some way to pass `bell' and `clear' information to the front\-end. .PP The \*(lqnonewline\*(rq option interacts badly with \*(lqcompress\*(rq and \*(lqsplit\*(rq. .PP The \*(lqformat\*(rq option really should work on something other than the body component. nmh-1.5/man/mhlist.man000644 007761 000765 00000011162 11762736345 014661 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHLIST %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhlist \- list information about MIME messages .SH SYNOPSIS .HP 5 .na .B mhlist .RI [ +folder ] .RI [ msgs ] .RB [ \-file .IR file ] .RB [ \-part .IR number ] \&... .RB [ \-type .IR content ] \&... .RB [ \-headers " | " \-noheaders ] .RB [ \-realsize " | " \-norealsize ] .RB [ \-rcache .IR policy ] .RB [ \-wcache .IR policy ] .RB [ \-check " | " \-nocheck ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B mhlist command allows you to list information (essentially a table of contents) about the various parts of a collection of MIME (multi-media) messages. .PP .B mhlist manipulates MIME (multi-media messages) as specified in RFC\-2045 thru RFC\-2049 (See .BR mhbuild (1)). .PP The .B \-headers switch indicates that a one-line banner should be displayed above the listing. .PP The .B \-realsize switch tells .B mhlist to evaluate the \*(lqnative\*(rq (decoded) format of each content prior to listing. This provides an accurate count at the expense of a small delay. .PP If the .B \-verbose switch is present, then the listing will show any \*(lqextra\*(rq information that is present in the message, such as comments in the \*(lqContent-Type\*(rq header. .PP The option .B \-file .I file directs .B mhlist to use the specified file as the source message, rather than a message from a folder. If you specify this file as \*(lq-\*(rq, then .B mhlist will accept the source message on the standard input. Note that the file, or input from standard input should be a validly formatted message, just like any other .B nmh message. It should .B NOT be in mail drop format (to convert a file in mail drop format to a folder of .B nmh messages, see .BR inc (1)). .PP By default, .B mhlist will list information about the entire message (all of its parts). By using the .B \-part and .B \-type switches, you may limit the scope of this command to particular subparts (of a multipart content) and/or particular content types. .PP A part specification consists of a series of numbers separated by dots. For example, in a multipart content containing three parts, these would be named as 1, 2, and 3, respectively. If part 2 was also a multipart content containing two parts, these would be named as 2.1 and 2.2, respectively. Note that the .B \-part switch is effective for only messages containing a multipart content. If a message has some other kind of content, or if the part is itself another multipart content, the .B \-part switch will not prevent the content from being acted upon. .PP A content specification consists of a content type and a subtype. The initial list of \*(lqstandard\*(rq content types and subtypes can be found in RFC\-2046. .PP A list of commonly used contents is briefly reproduced here: .PP .RS 5 .nf .ta \w'application 'u Type Subtypes ---- -------- text plain, enriched multipart mixed, alternative, digest, parallel message rfc822, partial, external-body application octet-stream, postscript image jpeg, gif, png audio basic video mpeg .fi .RE .PP A legal MIME message must contain a subtype specification. .PP To specify a content, regardless of its subtype, just use the name of the content, e.g., \*(lqaudio\*(rq. To specify a specific subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq. Note that regardless of the values given to the .B \-type switch, a multipart content (of any subtype listed above) is always acted upon. Further note that if the .B \-type switch is used, and it is desirable to act on a message/external-body content, then the .B \-type switch must be used twice: once for message/external-body and once for the content externally referenced. .SS "Checking the Contents" The .B \-check switch tells .B mhlist to check each content for an integrity checksum. If a content has such a checksum (specified as a Content-MD5 header field), then .B mhlist will attempt to verify the integrity of the content. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder .fi .SH "SEE ALSO" mhbuild(1), mhshow(1), mhstore(1), sendfiles(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` \-nocheck ' .RB ` \-headers ' .RB ` \-realsize ' .RB ` \-rcache\ ask ' .RB ` \-wcache\ ask ' .RB ` \-noverbose ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The last message selected will become the current message. nmh-1.5/man/mhmail.man000644 007761 000765 00000004340 11713401273 014611 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHMAIL %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhmail \- send or read mail .SH SYNOPSIS .HP 5 .na .B mhmail .RI [ addrs \&...] .RB [ \-body .IR text ] .RB [ \-cc .I addrs \&...] .RB [ \-from .IR addr ] .RB [ \-subject .IR subject ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B mhmail is intended as a replacement for the standard Berkeley mail program .RB ( mail or .BR mailx ), which is compatible with .BR nmh . This program is intended for the use of programs such as .BR cron , which expect to send mail automatically to various users. It is also used by various .B nmh commands to mail various error notifications. Although .B mhmail can be used interactively, it is recommended that .B comp and .B send be used instead to send messages. .PP When invoked without arguments, it simply invokes .B inc to incorporate new messages from the user's maildrop. When one or more users is specified, a message is read from the standard input and spooled to a temporary file. .B mhmail then invokes .B post with the name of the temporary file as its argument to deliver the message to the specified user. .PP The .B \-subject .I subject switch can be used to specify the \*(lqSubject:\*(rq field of the message. .PP By default, .B mhmail will read the message to be sent from the standard input. You can specify the text of the message at the command line with the .B \-body .I text switch. If the standard input has zero length, .B mhmail will not send the message. You can use the switch .B \-body \*(lq\*(rq to force an empty message. .PP Normally, addresses appearing as arguments are put in the \*(lqTo:\*(rq field. If the .B \-cc switch is used, all addresses following it are placed in the \*(lqcc:\*(rq field. .PP By using .B \-from .IR addr , you can specify the \*(lqFrom:\*(rq header of the draft. Naturally, .B post will fill\-in the \*(lqSender:\*(rq header correctly. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%bindir%/inc~^Program to incorporate maildrop into folder ^%libdir%/post~^Program to deliver a message ^/tmp/mhmail*~^Temporary copy of message .fi .SH "SEE ALSO" inc(1), post(8) .SH DEFAULTS None .SH CONTEXT If .B inc is invoked, then .BR inc 's context changes occur. nmh-1.5/man/mhn.man000644 007761 000765 00000002200 11713401273 014115 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHN %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhn \- display/list/store/cache MIME messages .SH SYNOPSIS .HP 5 .na .B mhn .RI [ +folder ] .RI [ msgs ] .RB [ \-file .IR file ] .RB [ \-part .IR number ] \&... .RB [ \-type .IR content ] \&... .RB [ \-show " | " \-noshow ] .RB [ \-list " | " \-nolist ] .RB [ \-store " | " \-nostore ] .RB [ \-cache " | " \-nocache ] .RB [ \-headers " | " \-noheaders ] .RB [ \-realsize " | " \-norealsize ] .RB [ \-serialonly " | " \-noserialonly ] .RB [ \-form .IR formfile ] .RB [ \-pause " | " \-nopause ] .RB [ \-auto " | " \-noauto ] .RB [ \-rcache .IR policy ] .RB [ \-wcache .IR policy ] .RB [ \-check " | " \-nocheck ] .RB [ \-version ] .RB [ \-help ] .PP .HP 5 .B mhn .B \-build .I file .RB [ \-ebcdicsafe " | " \-noebcdicsafe ] .RB [ \-rfc934mode " | " \-norfc934mode ] .ad .SH DESCRIPTION .B MHN SHOULD BE CONSIDERED DEPRECATED. IT IS RETAINED FOR THE PURPOSE .B OF BACKWARD COMPATIBILITY, BUT EVERYONE SHOULD MIGRATE TO USING THE .B COMMANDS MHSHOW, MHSTORE, AND MHLIST. CHECK THE INDIVIDUAL MAN PAGES .B FOR DETAILS. .SH "SEE ALSO" mhbuild(1), mhl(1), sendfiles(1) nmh-1.5/man/mhparam.man000644 007761 000765 00000004147 11762736345 015013 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHPARAM %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhparam \- print nmh profile and context components .SH SYNOPSIS .HP 5 .na .B mhparam .RI [ components ] .RB [ \-all ] .RB [ \-component " | " \-nocomponent ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B mhparam writes the value of the specified profile component to the standard output separated by newlines. If the profile component is not present, the default value (or nothing if there is no default) is printed. .PP If the switch .B \-component is given, then the component name is displayed along with the profile components value. This can be disabled with the switch .BR \-nocomponent . .PP If more than one component is specified in the .I components list, then the switch .B \-component is on by default. If only one component is specified, then the switch .B \-nocomponent is on by default. .PP If .B \-all is specified, then all components in the nmh profile are displayed and other arguments are ignored. .PP Examples: .PP .RS 5 .nf .ta \w'AliasFile:'u+2n % mhparam path Mail % mhparam mhlproc %libdir%/mhl % mhparam \-component Path Path: Mail % mhparam AliasFile rmmproc AliasFile: aliases rmmproc: rmmproc % mhparam \-nocomponent AliasFile rmmproc aliases rmmproc % mhparam path nonexistent context Path: Mail context: context .fi .RE .PP .B mhparam is also useful in back\-quoted operations: .PP .RS 5 .nf % fgrep cornell.edu `mhpath +`/`mhparam aliasfile` .fi .SH "EXIT STATUS" .B mhparam returns the number of components that were not found. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/.mh_profile~^The user profile ^or $MH~^Rather than the standard profile ^/context~^The user context ^or $MHCONTEXT~^Rather than the standard context .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^context:~^To determine the context file .fi .SH "SEE ALSO" mh-profile(5) .SH DEFAULTS .nf .RB ` \-nocomponent "' if only one component is specified" .RB ` \-component "' if more than one component is specified" .RB ` components "' defaults to none" .fi .SH CONTEXT None nmh-1.5/man/mhpath.man000644 007761 000765 00000006757 11762736345 014660 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHPATH %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhpath \- print full pathnames of nmh messages and folders .SH SYNOPSIS .HP 5 .na .B mhpath .RI [ +folder ] .RI [ msgs ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B mhpath expands and sorts the message list `msgs' and writes the full pathnames of the messages to the standard output separated by newlines. If no `msgs' are specified, .B mhpath outputs the current mail folder's pathname instead. If the only argument is `+', your .B nmh \*(lqPath\*(rq is output; this can be useful in shell scripts. .PP Contrasted with other .B nmh commands, a message argument to .B mhpath may often be intended for writing. Because of this: .PP .IP 1) 4 the name \*(lqnew\*(rq has been added to .BR mhpath 's list of reserved message names (the others are \*(lqfirst\*(rq, \*(lqlast\*(rq, \*(lqprev\*(rq, \*(lqnext\*(rq, \*(lqcur\*(rq, and \*(lqall\*(rq). The new message is equivalent to the message after the last message in a folder (and equivalent to 1 in a folder without messages). The \*(lqnew\*(rq message may not be used as part of a message range. .IP 2) 4 Within a message list, the following designations may refer to messages that do not exist: a single numeric message name, the single message name \*(lqcur\*(rq, and (obviously) the single message name \*(lqnew\*(rq. All other message designations must refer to at least one existing message, if the folder contains messages. .IP 3) 4 An empty folder is not in itself an error. .PP A message number less than that of the smallest existing message in a folder is treated as if the message already exists. A message number greater than that of the highest existing message in a folder causes an \*(lqout of range\*(rq error message to be displayed. .PP As part of a range designation that contains messages that do exist, message numbers less than the smallest, or greater than the highest, existing message in a folder are ignored. .PP Examples: The current folder foo contains messages 3 5 6. Cur is 4. .PP .RS 5 .nf % mhpath /r/phyl/Mail/foo % mhpath all /r/phyl/Mail/foo/3 /r/phyl/Mail/foo/5 /r/phyl/Mail/foo/6 % mhpath 2001 mhpath: message 2001 out of range 1-6 % mhpath 1\-2001 /r/phyl/Mail/foo/3 /r/phyl/Mail/foo/5 /r/phyl/Mail/foo/6 % mhpath new /r/phyl/Mail/foo/7 % mhpath last new /r/phyl/Mail/foo/6 /r/phyl/Mail/foo/7 % mhpath last\-new mhpath: bad message list last\-new % mhpath cur /r/phyl/Mail/foo/4 % mhpath 1\-2 mhpath: no messages in range 1\-2 % mhpath first:2 /r/phyl/Mail/foo/3 /r/phyl/Mail/foo/5 % mhpath 1 2 /r/phyl/Mail/foo/1 /r/phyl/Mail/foo/2 .fi .RE .PP .B mhpath is also useful in back\-quoted operations: .PP .RS 5 .nf % cd `mhpath +inbox` % echo `mhpath +` /r/phyl/Mail .fi .RE .PP .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder .fi .SH "SEE ALSO" folder(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to none" .fi .SH CONTEXT None .SH BUGS Like all .B nmh commands, .B mhpath expands and sorts .RI [ msgs ]. So don't expect .PP .RS 5 .nf mv `mhpath 501 500` .fi .RE .PP to move 501 to 500. Quite the reverse. But .PP .RS 5 .nf mv `mhpath 501` `mhpath 500` .fi .RE .PP will do the trick. .PP Out of range message 0 is treated far more severely than large out of range message numbers. nmh-1.5/man/mhshow.man000644 007761 000765 00000037073 11762736345 014677 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHSHOW %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhshow \- display MIME messages .SH SYNOPSIS .HP 5 .na .B mhshow .RI [ +folder ] .RI [ msgs ] .RB [ \-file .IR file ] .RB [ \-part .IR number ] \&... .RB [ \-type .IR content ] \&... .RB [ \-serialonly " | " \-noserialonly ] .RB [ \-pause " | " \-nopause ] .RB [ \-form .IR formfile ] .RB [ \-rcache .IR policy ] .RB [ \-wcache .IR policy ] .RB [ \-check " | " \-nocheck ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B mhshow command display contents of a MIME (multi-media) message or collection of messages. .PP .B mhshow manipulates multi-media messages as specified in RFC\-2045 thru RFC\-2049. Currently .B mhshow only supports encodings in message bodies, and does not support the encoding of message headers as specified in RFC\-2047. .PP By default .B mhshow will display all parts of a multipart message. By using the .B \-part and .B \-type switches, you may limit the scope of .B mhshow to particular subparts (of a multipart content) and/or particular content types. .PP The option .B \-file .I file directs .B mhshow to use the specified file as the source message, rather than a message from a folder. If you specify this file as \*(lq-\*(rq, then .B mhshow will accept the source message on the standard input. Note that the file, or input from standard input should be a validly formatted message, just like any other .B nmh message. It should .B NOT be in mail drop format (to convert a file in mail drop format to a folder of .B nmh messages, see .BR inc (1)). .PP A part specification consists of a series of numbers separated by dots. For example, in a multipart content containing three parts, these would be named as 1, 2, and 3, respectively. If part 2 was also a multipart content containing two parts, these would be named as 2.1 and 2.2, respectively. Note that the .B \-part switch is effective for only messages containing a multipart content. If a message has some other kind of content, or if the part is itself another multipart content, the .B \-part switch will not prevent the content from being acted upon. .PP A content specification consists of a content type and a subtype. The initial list of \*(lqstandard\*(rq content types and subtypes can be found in RFC\-2046. .PP A list of commonly used contents is briefly reproduced here: .PP .RS 5 .nf .ta \w'application 'u Type Subtypes ---- -------- text plain, enriched multipart mixed, alternative, digest, parallel message rfc822, partial, external-body application octet-stream, postscript image jpeg, gif, png audio basic video mpeg .fi .RE .PP A legal MIME message must contain a subtype specification. .PP To specify a content, regardless of its subtype, just use the name of the content, e.g., \*(lqaudio\*(rq. To specify a specific subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq. Note that regardless of the values given to the `\-type' switch, a multipart content (of any subtype listed above) is always acted upon. Further note that if the `\-type' switch is used, and it is desirable to act on a message/external-body content, then the `\-type' switch must be used twice: once for message/external-body and once for the content externally referenced. .SS "Unseen Sequence" If the profile entry \*(lqUnseen\-Sequence\*(rq is present and non\-empty, then .B mhshow will remove each of the messages shown from each sequence named by the profile entry. .SS "Checking the Contents" The .B \-check switch tells .B mhshow to check each content for an integrity checksum. If a content has such a checksum (specified as a Content-MD5 header field), then .B mhshow will attempt to verify the integrity of the content. .SS "Showing the Contents" The headers of each message are displayed with the .I mhlproc (usually .BR mhl ), using the standard format file .IR mhl.headers . You may specify an alternate format file with the .B \-form .I formfile switch. If the format file .I mhl.null is specified, then the display of the message headers is suppressed. .PP Next, the contents are extracted from the message and are stored in a temporary file. Usually, the name of the temporary file is the word \*(lqmhshow\*(rq followed by a string of characters. Occasionally, the method used to display a content (described next), requires that the file end in a specific suffix. For example, the .B soffice command (part of the StarOffice package) can be used to display Microsoft Word content, but it uses the suffix to determine how to display the file. If no suffix is present, the file is not correctly loaded. Similarily, older versions of the .B gs command append a \*(lq.ps\*(rq suffix to the filename if one was missing. As a result, these cannot be used to read the default temporary file. .PP To get around this, your profile can contain lines of the form: .PP .RS 5 mhshow-suffix-/: .RE .PP or .PP .RS 5 mhshow-suffix-: .RE .PP to specify a suffix which can be automatically added to the temporary file created for a specific content type. For example, the following lines might appear in your profile: .PP .RS 5 .nf mhshow-suffix-text: .txt mhshow-suffix-application/msword: .doc mhshow-suffix-application/PostScript: .ps .fi .RE .PP to automatically append a suffix to the temporary files. .PP The method used to display the different contents in the messages bodies will be determined by a \*(lqdisplay string\*(rq. To find the display string, .B mhshow will first search your profile for an entry of the form: .PP .RS 5 mhshow-show-/ .RE .PP to determine the display string. If this isn't found, .B mhshow will search for an entry of the form: .PP .RS 5 mhshow-show- .RE .PP to determine the display string. .PP If a display string is found, any escapes (given below) will be expanded. The result will be executed under \*(lq/bin/sh\*(rq, with the standard input set to the content. .PP The display string may contain the following escapes: .PP .RS 5 .nf .ta \w'%F 'u %a Insert parameters from Content-Type field %e exclusive execution %f Insert filename containing content %F %e, %f, and stdin is terminal not content %l display listing prior to displaying content %p %l, and ask for confirmation %s Insert content subtype %d Insert content description %% Insert the character % .fi .RE .PP For those display strings containing the e- or F-escape, .B mhshow will execute at most one of these at any given time. Although the F-escape expands to be the filename containing the content, the e-escape has no expansion as far as the shell is concerned. .PP When the p-escape prompts for confirmation, typing INTR (usually control-C) will tell .B mhshow not to display that content. The p-escape can be disabled by specifying the switch .BR \-nopause . Further, when .B mhshow is display a content, typing QUIT (usually control-\\) will tell .B mhshow to wrap things up immediately. .PP Note that if the content being displayed is multipart, but not one of the subtypes listed above, then the f- and F-escapes expand to multiple filenames, one for each subordinate content. Further, stdin is not redirected from the terminal to the content. .PP If a display string is not found, .B mhshow has several default values: .PP .RS 5 .nf mhshow-show-text/plain: %pmoreproc '%F' mhshow-show-message/rfc822: %pshow -file '%F' .fi .RE .PP If a subtype of type text doesn't have a profile entry, it will be treated as text/plain. .PP .B mhshow has default methods for handling multipart messages of subtype mixed, alternative, parallel, and digest. Any unknown subtype of type multipart (without a profile entry), will be treated as multipart/mixed. .PP If none of these apply, then .B mhshow will check to see if the message has an application/octet-stream content with parameter \*(lqtype=tar\*(rq. If so, .B mhshow will use an appropriate command. If not, .B mhshow will complain. .PP Example entries might be: .PP .RS 5 .nf mhshow-show-audio/basic: raw2audio 2>/dev/null | play mhshow-show-image: xv '%f' mhshow-show-application/PostScript: lpr -Pps .fi .RE .PP Note that when using the f- or F-escape, it's a good idea to use single-quotes around the escape. This prevents misinterpretation by the shell of any funny characters that might be present in the filename. .PP Finally, .B mhshow will process each message serially\0--\0it won't start showing the next message until all the commands executed to display the current message have terminated. In the case of a multipart content (of any subtype listed above), the content contains advice indicating if the parts should be displayed serially or in parallel. Because this may cause confusion, particularly on uni-window displays, the .B \-serialonly switch can be given to tell .B mhshow to never display parts in parallel. .SS "Showing Alternate Character Sets" Because a content of type text might be in a non-ASCII character set, when .B mhshow encounters a \*(lqcharset\*(rq parameter for this content, it checks if your terminal can display this character set natively. .B mhn checks this by examining the the environment variable .BR $MM_CHARSET . If the value of this environment variable is equal to the value of the charset parameter, then .B mhshow assumes it can display this content without any additional setup. If this environment variable is not set, .B mhshow will assume a value of \*(lqUS-ASCII\*(rq. If the character set cannot be displayed natively, then .B mhshow will look for an entry of the form: .PP .RS 5 mhshow-charset- .RE .PP which should contain a command creating an environment to render the character set. This command string should containing a single \*(lq%s\*(rq, which will be filled-in with the command to display the content. .PP Example entries might be: .PP .RS 5 mhshow-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s .RE .PP or .PP .RS 5 mhshow-charset-iso-8859-1: '%s' .RE .PP The first example tells .B mhshow to start .B xterm and load the appropriate character set for that message content. The second example tells .B mhshow that your pager (or other program handling that content type) can handle that character set, and that no special processing is needed beforehand. .PP Note that many pagers strip off the high-order bit or have problems displaying text with the high-order bit set. However, the pager .B less has support for single-octet character sets. The source to .B less is available on many ftp sites carrying free software. In order to view messages sent in the ISO-8859-1 character set using .BR less , .PP put these lines in your .I \&.login file: .PP .RS 5 .nf setenv LESSCHARSET latin1 setenv LESS "-f" .fi .RE .PP The first line tells .B less to use the ISO-8859-1 definition for determining whether a character is \*(lqnormal\*(rq, \*(lqcontrol\*(lq, or \*(lqbinary\*(rq. The second line tells .B less not to warn you if it encounters a file that has non-ASCII characters. Then, simply set the .I moreproc profile entry to .BR less , and it will get called automatically. (To handle other single-octet character sets, look at the .BR less (1) manual entry for information about the .B $LESSCHARDEF environment variable.) .SS "Messages of Type message/partial" .B mhshow cannot directly display messages of type partial. You must reassemble them first into a normal message using .BR mhstore . Check the man page for .BR mhstore (1) for details. .SS "External Access" For contents of type message/external-body, .B mhshow supports these access-types: .PP .IP \(bu 4 afs .IP \(bu 4 anon-ftp .IP \(bu 4 ftp .IP \(bu 4 local-file .IP \(bu 4 mail-server .PP For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types, .B mhshow will look for the \*(lqnmh-access-ftp\*(rq profile entry, e.g., .PP .RS 5 nmh-access-ftp: myftp.sh .RE .PP to determine the pathname of a program to perform the FTP retrieval. .PP This program is invoked with these arguments: .PP .RS 5 .nf domain name of FTP-site username password remote directory remote filename local filename \*(lqascii\*(rq or \*(lqbinary\*(rq .fi .RE .PP The program should terminate with an exit status of zero if the retrieval is successful, and a non-zero exit status otherwise. .SS "The Content Cache" When .B mhshow encounters an external content containing a \*(lqContent-ID:\*(rq field, and if the content allows caching, then depending on the caching behavior of .BR mhshow , the content might be read from or written to a cache. .PP The caching behavior of .B mhshow is controlled with the .B \-rcache and .B \-wcache switches, which define the policy for reading from, and writing to, the cache, respectively. One of four policies may be specified: \*(lqpublic\*(rq, indicating that .B mhshow should make use of a publically-accessible content cache; \*(lqprivate\*(rq, indicating that .B mhshow should make use of the user's private content cache; \*(lqnever\*(rq, indicating that .B mhshow should never make use of caching; and, \*(lqask\*(rq, indicating that .B mhshow should ask the user. .PP There are two directories where contents may be cached: the profile entry \*(lqnmh-cache\*(rq names a directory containing world-readable contents, and, the profile entry \*(lqnmh-private-cache\*(rq names a directory containing private contents. The former should be an absolute (rooted) directory name. .PP For example, .PP .RS 5 nmh-cache: /tmp .RE .PP might be used if you didn't care that the cache got wiped after each reboot of the system. The latter is interpreted relative to the user's nmh directory, if not rooted, e.g., .PP .RS 5 nmh-private-cache: .cache .RE .PP (which is the default value). .SS "User Environment" Because the display environment in which .B mhshow operates may vary for different machines, .B mhshow will look for the environment variable .BR $MHSHOW . If present, this specifies the name of an additional user profile which should be read. Hence, when a user logs in on a particular display device, this environment variable should be set to refer to a file containing definitions useful for the given display device. Normally, only entries that deal with the methods to display different content type and subtypes .PP .RS 5 .nf mhshow-show-/ mhshow-show- .fi .RE .PP need be present in this additional profile. Finally, .B mhshow will attempt to consult one other additional user profile, e.g., .PP .RS 5 %etcdir%/mhn.defaults .RE .PP which is created automatically during .B nmh installation. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^$MHSHOW~^Additional profile entries ^%etcdir%/mhn.defaults~^System default MIME profile entries ^%etcdir%/mhl.headers~^The headers template .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Unseen\-Sequence:~^To name sequences denoting unseen messages ^mhlproc:~^Default program to display message headers ^nmh-access-ftp:~^Program to retrieve contents via FTP ^nmh-cache~^Public directory to store cached external contents ^nmh-private-cache~^Personal directory to store cached external contents ^mhshow-charset-~^Template for environment to render character sets ^mhshow-show-*~^Template for displaying contents ^moreproc:~^Default program to display text/plain content .fi .SH "SEE ALSO" mhbuild(1), mhl(1), mhlist(1), mhstore(1), sendfiles(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` \-nocheck ' .RB ` \-form\ mhl.headers ' .RB ` \-pause ' .RB ` \-rcache\ ask ' .RB ` \-noserialonly ' .RB ` \-wcache\ ask ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The last message selected will become the current message. nmh-1.5/man/mhstore.man000644 007761 000765 00000031311 11762736345 015040 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MHSTORE %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME mhstore \- store contents of MIME messages into files .SH SYNOPSIS .HP 5 .na .B mhstore .RI [ +folder ] .RI [ msgs ] .RB [ \-file .IR file ] .RB [ \-part .IR number ] \&... .RB [ \-type .IR content ] \&... .RB [ \-auto " | " \-noauto ] .RB [ \-rcache .IR policy ] .RB [ \-wcache .IR policy ] .RB [ \-check " | " \-nocheck ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B mhstore command allows you to store the contents of a collection of MIME (multi-media) messages into files or other messages. .PP .B mhstore manipulates multi-media messages as specified in RFC\-2045 thru RFC\-2049. .PP By default, .B mhstore will store all the parts of each message. Each part will be store in a separate file. The header fields of the message are not stored. By using the .B \-part and .B \-type switches, you may limit the scope of .B mhstore to particular subparts (of a multipart content) and/or particular content types. .PP The option .B \-file .I file directs .B mhstore to use the specified file as the source message, rather than a message from a folder. If you specify this file as \*(lq-\*(rq, then .B mhstore will accept the source message on the standard input. Note that the file, or input from standard input should be a validly formatted message, just like any other .B nmh message. It should .B NOT be in mail drop format (to convert a file in mail drop format to a folder of .B nmh messages, see .BR inc (1)). .PP A part specification consists of a series of numbers separated by dots. For example, in a multipart content containing three parts, these would be named as 1, 2, and 3, respectively. If part 2 was also a multipart content containing two parts, these would be named as 2.1 and 2.2, respectively. Note that the .B \-part switch is effective for only messages containing a multipart content. If a message has some other kind of content, or if the part is itself another multipart content, the .B \-part switch will not prevent the content from being acted upon. .PP A content specification consists of a content type and a subtype. The initial list of \*(lqstandard\*(rq content types and subtypes can be found in RFC\-2046. .PP A list of commonly used contents is briefly reproduced here: .PP .RS 5 .nf .ta \w'application 'u Type Subtypes ---- -------- text plain, enriched multipart mixed, alternative, digest, parallel message rfc822, partial, external-body application octet-stream, postscript image jpeg, gif, png audio basic video mpeg .fi .RE .PP A legal MIME message must contain a subtype specification. .PP To specify a content, regardless of its subtype, just use the name of the content, e.g., \*(lqaudio\*(rq. To specify a specific subtype, separate the two with a slash, e.g., \*(lqaudio/basic\*(rq. Note that regardless of the values given to the .B \-type switch, a multipart content (of any subtype listed above) is always acted upon. Further note that if the .B \-type switch is used, and it is desirable to act on a message/external-body content, then the .B \-type switch must be used twice: once for message/external-body and once for the content externally referenced. .SS "Checking the Contents" The .B \-check switch tells .B mhstore to check each content for an integrity checksum. If a content has such a checksum (specified as a Content-MD5 header field), then .B mhstore will attempt to verify the integrity of the content. .SS "Storing the Contents" The .B mhstore will store the contents of the named messages in \*(lqnative\*(rq (decoded) format. Two things must be determined: the directory to store the content, and the filenames. Files are written in the directory given by the \*(lqnmh-storage\*(rq profile entry, e.g., .PP .RS 5 nmh-storage: /tmp .RE .PP If this entry isn't present, the current working directory is used. .PP If the .B \-auto switch is given, then .B mhstore will check if the message contains information indicating the filename that should be used to store the content. This information should be specified as the attribute \*(lqname=filename\*(rq in the \*(lqContent-Type\*(rq header for the content you are storing. For security reasons, this filename will be ignored if it begins with the character '/', '.', '|', or '!', or if it contains the character '%'. For the sake of security, this switch is not the default, and it is recommended that you do NOT put the .B \-auto switch in your .I \&.mh\(ruprofile file. .PP If the .B \-auto switch is not given (or is being ignored for security reasons) then .B mhstore will look in the user's profile for a \*(lqformatting string\*(rq to determine how the different contents should be stored. First, .B mhstore will look for an entry of the form: .PP .RS 5 mhstore-store-/ .RE .PP to determine the formatting string. If this isn't found, .B mhstore will look for an entry of the form: .PP .RS 5 mhstore-store- .RE .PP to determine the formatting string. .PP If the formatting string starts with a \*(lq+\*(rq character, then content is stored in the named folder. A formatting string consisting solely of a \*(lq+\*(rq character is interpreted to be the current folder. .PP If the formatting string consists solely of a \*(lq-\*(rq character, then the content is sent to the standard output. .PP If the formatting string starts with a '|', then the display string will represent a command for .B mhstore to execute which should ultimately store the content. The content will be passed to the standard input of the command. Before the command is executed, .B mhstore will change to the appropriate directory, and any escapes (given below) in the display string will be expanded. .PP Otherwise the formatting string will represent a pathname in which to store the content. If the formatting string starts with a '/', then the content will be stored in the full path given, else the file name will be relative to the value of \*(lqnmh-storage\*(rq or the current working directory. Any escapes (given below) will be expanded, except for the a-escape. Note that if \*(lqnmh-storage\*(rq is not an absolute path, it will be relative to the folder that contains the message(s). .PP A command or pathname formatting string may contain the following escapes. If the content isn't part of a multipart (of any subtype listed above) content, the p-escapes are ignored. .PP .RS 5 .nf .ta \w'%P 'u %a Parameters from Content-type (only valid with command) %m Insert message number %P Insert part number with leading dot %p Insert part number without leading dot %t Insert content type %s Insert content subtype %% Insert character % .fi .RE .PP If no formatting string is found, .B mhstore will check to see if the content is application/octet-stream with parameter \*(lqtype=tar\*(rq. If so, .B mhstore will choose an appropriate filename. If the content is not application/octet-stream, then .B mhstore will check to see if the content is a message. If so, .B mhstore will use the value \*(lq+\*(rq. As a last resort, .B mhstore will use the value \*(lq%m%P.%s\*(rq. .PP Example profile entries might be: .PP .RS 5 .nf mhstore-store-text: %m%P.txt mhstore-store-text: +inbox mhstore-store-message/partial: + mhstore-store-audio/basic: | raw2audio -e ulaw -s 8000 -c 1 > %m%P.au mhstore-store-image/jpeg: %m%P.jpg mhstore-store-application/PostScript: %m%P.ps .fi .RE .PP .SS "Reassembling Messages of Type message/partial" .B mhstore is also able to reassemble messages that have been split into multiple messages of type \*(lqmessage/partial\*(rq. .PP When asked to store a content containing a partial message, .B mhstore will try to locate all of the portions and combine them accordingly. The default is to store the combined parts as a new message in the current folder, although this can be changed using formatting strings as discussed above. Thus, if someone has sent you a message in several parts (such as the output from .BR sendfiles ), you can easily reassemble them all into a single message in the following fashion: .PP .RS 5 .nf % mhlist 5-8 msg part type/subtype size description 5 message/partial 47K part 1 of 4 6 message/partial 47K part 2 of 4 7 message/partial 47K part 3 of 4 8 message/partial 18K part 4 of 4 % mhstore 5-8 reassembling partials 5,6,7,8 to folder inbox as message 9 % mhlist -verbose 9 msg part type/subtype size description 9 application/octet-stream 118K (extract with uncompress | tar xvpf -) type=tar conversions=compress .fi .RE .PP This will store exactly one message, containing the sum of the parts. It doesn't matter whether the partials are specified in order, since .B mhstore will sort the partials, so that they are combined in the correct order. But if .B mhstore can not locate every partial necessary to reassemble the message, it will not store anything. .SS "External Access" For contents of type message/external-body, \fImhstore\fR supports these access-types: .PP .IP \(bu 4 afs .IP \(bu 4 anon-ftp .IP \(bu 4 ftp .IP \(bu 4 local-file .IP \(bu 4 mail-server .PP For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types, .B mhstore will look for the \*(lqnmh-access-ftp\*(rq profile entry, e.g., .PP .RS 5 nmh-access-ftp: myftp.sh .RE .PP to determine the pathname of a program to perform the FTP retrieval. This program is invoked with these arguments: .PP .RS 5 .nf domain name of FTP-site username password remote directory remote filename local filename \*(lqascii\*(rq or \*(lqbinary\*(rq .fi .RE .PP The program should terminate with an exit status of zero if the retrieval is successful, and a non-zero exit status otherwise. .SS "The Content Cache" When .B mhstore encounters an external content containing a \*(lqContent-ID:\*(rq field, and if the content allows caching, then depending on the caching behavior of .BR mhstore , the content might be read from or written to a cache. .PP The caching behavior of .B mhstore is controlled with the .B \-rcache and .B \-wcache switches, which define the policy for reading from, and writing to, the cache, respectively. One of four policies may be specified: \*(lqpublic\*(rq, indicating that .B mhstore should make use of a publically-accessible content cache; \*(lqprivate\*(rq, indicating that .B mhstore should make use of the user's private content cache; \*(lqnever\*(rq, indicating that .B mhstore should never make use of caching; and, \*(lqask\*(rq, indicating that .B mhstore should ask the user. .PP There are two directories where contents may be cached: the profile entry \*(lqnmh-cache\*(rq names a directory containing world-readable contents, and, the profile entry \*(lqnmh-private-cache\*(rq names a directory containing private contents. The former should be an absolute (rooted) directory name. .PP For example, .PP .RS 5 nmh-cache: /tmp .RE .PP might be used if you didn't care that the cache got wiped after each reboot of the system. The latter is interpreted relative to the user's nmh directory, if not rooted, e.g., .PP .RS 5 nmh-private-cache: .cache .RE .PP (which is the default value). .SS "User Environment" Because the display environment in which .B mhstore operates may vary for different machines, .B mhstore will look for the environment variable .BR $MHSTORE . If present, this specifies the name of an additional user profile which should be read. Hence, when a user logs in on a particular machine, this environment variable should be set to refer to a file containing definitions useful for that machine. Finally, .B mhstore will attempt to consult one other additional user profile, e.g., .PP .RS 5 %etcdir%/mhn.defaults .RE .PP which is created automatically during .B nmh installation. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^$MHSTORE~^Additional profile entries ^%etcdir%/mhn.defaults~^System default MIME profile entries .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^nmh-access-ftp:~^Program to retrieve contents via FTP ^nmh-cache~^Public directory to store cached external contents ^nmh-private-cache~^Personal directory to store cached external contents ^nmh-storage~^Directory to store contents ^mhstore-store-*~^Template for storing contents .fi .SH "SEE ALSO" mhbuild(1), mhlist(1), mhshow(1), sendfiles(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` \-noauto ' .RB ` \-nocheck ' .RB ` \-rcache\ ask ' .RB ` \-wcache\ ask ' .SH CONTEXT If a folder is given, it will become the current folder. The last message selected will become the current message. .SH BUGS Partial messages contained within a multipart content are not reassembled. nmh-1.5/man/msgchk.man000644 007761 000765 00000007364 11762736345 014646 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MSGCHK %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME msgchk \- check for messages .SH SYNOPSIS .HP 5 .na .B msgchk .RB [ \-date " | " \-nodate ] .RB [ \-notify all/mail/nomail ] .RB [ \-nonotify all/mail/nomail ] .RB [ \-host .IR hostname ] .RB [ \-user .IR username ] .RB [ \-sasl ] .RB [ \-saslmech .IR mechanism ] .RB [ \-snoop ] .RI [ users \&... ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B msgchk program checks all known mail drops for mail waiting for you. For those drops which have mail for you, .B msgchk will indicate if it believes that you have seen the mail in question before. .PP The .B \-notify .I type switch indicates under what circumstances .B msgchk should produce a message. The default is .B \-notify .I all which says that .B msgchk should always report the status of the users maildrop. Other values for `type' include `mail' which says that .B msgchk should report the status of waiting mail; and, `nomail' which says that .B msgchk should report the status of empty maildrops. The .B \-nonotify .I type switch has the inverted sense, so .B \-nonotify .I all directs .B msgchk to never report the status of maildrops. This is useful if the user wishes to check .BR msgchk 's exit status. A non\-zero exit status indicates that mail was .B not waiting for at least one of the indicated users. .PP If .B msgchk produces output, then the .B \-date switch directs .B msgchk to print out the last date mail was read, if this can be determined. .SS "Using POP" .B msgchk will normally check all the local mail drops, but if the option \*(lqpophost:\*(rq is set in the mts configuration file \*(lqmts.conf\*(rq, or if the .B \-host .I hostname switch is given, .B msgchk will query this POP service host as to the status of mail waiting. .PP The default is for .B msgchk to assume that your account name on the POP server is the same as your current username. To specify a different username, use the `\-user\ username' switch. .PP When using POP, you will normally need to type the password for your account on the POP server, in order to retrieve your messages. It is possible to automate this process by creating a .RI \*(lq \&.netrc \*(rq file containing your login account information for this POP server. For each POP server, this file should have a line of the following form. Replace the words .IR mypopserver , .IR mylogin , and .I mypassword with your own account information. .PP .RS 5 machine .I mypopserver login .I mylogin password .I mypassword .RE .PP This .RI \*(lq \&.netrc \*(rq file should be owned and readable only by you. .PP For debugging purposes, there is also a switch .BR \-snoop , which will allow you to watch the POP transaction take place between you and the POP server. .PP If .B nmh has been compiled with SASL support, the .B \-sasl switch will enable the use of SASL authentication. Depending on the SASL mechanism used, this may require an additional password prompt from the user (but the .RI \*(lq \&.netrc \*(rq file can be used to store this password). The .B \-saslmech switch can be used to select a particular SASL mechanism. .PP If SASL authentication is successful, .B inc will attempt to negotiate a security layer for session encryption. Encrypted traffic is labelled with `(encrypted)' and `(decrypted)' when viewing the POP transaction with the .B \-snoop switch. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^%etcdir%/mts.conf~^nmh mts configuration file ^%mailspool%/$USER~^Location of mail drop .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u None .fi .SH "SEE ALSO" inc(1) .SH DEFAULTS .nf .RB ` user "' defaults to the current user" .RB ` \-date ' .RB ` "\-notify\ all" ' .fi .SH CONTEXT None nmh-1.5/man/msh.man000644 007761 000765 00000011365 11762736345 014155 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH MSH %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME msh \- nmh shell (and BBoard reader) .SH SYNOPSIS .HP 5 .na .B msh .RB [ \-prompt .IR string ] .RB [ \-scan " | " \-noscan ] .RB [ \-topcur " | " \-notopcur ] .RI [ file ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B msh is an interactive program that implements a subset of the normal .B nmh commands operating on a single file in .BR packf 'd format. That is, .B msh is used to read a file that contains a number of messages, as opposed to the standard .B nmh style of reading a number of files, each file being a separate message in a folder. .BR msh 's chief advantage is that the normal .B nmh style does not allow a file to have more than one message in it. Hence, .B msh is ideal for reading BBoards, as these files are delivered by the transport system in this format. In addition, .B msh can be used on other files, such as message archives which have been .BR pack ed (see .BR packf (1)). Finally, .B msh is an excellent .B nmh tutor. As the only commands available to the user are .B nmh commands, this allows .B nmh beginners to concentrate on how commands to .B nmh are formed and (more or less) what they mean. .PP When invoked, .B msh reads the named file, and enters a command loop. The user may type most of the normal .B nmh commands. The syntax and semantics of these commands typed to .B msh are identical to their .B nmh counterparts. In cases where the nature of .B msh would be inconsistent (e.g., specifying a .I +folder with some commands), .B msh will duly inform the user. The commands that .B msh currently supports (in some slightly modified or restricted forms) are: .PP .RS 5 .nf ali burst comp dist folder forw inc mark mhmail mhn msgchk next packf pick prev refile repl rmm scan send show sortm whatnow whom .fi .RE .PP In addition, .B msh has a .B help command which gives a brief overview. To terminate .BR msh , type CTRL\-D, or use the .B quit command. .PP If the file is writable and has been modified, then using .B quit will query the user if the file should be updated. .PP The .B \-prompt .I string switch sets the prompting string for .BR msh . .PP You may wish to use an alternate .B nmh profile for the commands that .B msh executes; see .BR mh-profile (5) for details about the .B $MH environment variable. .PP The .B exit command is identical to the .B quit command in .BR msh . .PP .B msh supports an output redirection facility. Commands may be followed by one of .PP .RS 5 .nf .ta \w'| \fIcommand\fR 'u ^> \fIfile\fR~^write output to \fIfile\fR ^>> \fIfile\fR~^append output to \fIfile\fR ^| \fIcommand\fR~^pipe output to UNIX \fIcommand\fR .fi .RE .PP If .I file starts with a \*(lq\~\*(rq (tilde), then a .BR csh \-like expansion takes place. Note that .I command is interpreted by .BR sh . Also note that .B msh does NOT support history substitutions, variable substitutions, or alias substitutions. .PP When parsing commands to the left of any redirection symbol, .B msh will honor `\\' (back\-slash) as the quote next\-character symbol, and `\*(lq' (double\-quote) as quote\-word delimiters. All other input tokens are separated by whitespace (spaces and tabs). .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^%etcdir%/mts.conf~^nmh mts configuration file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Msg\-Protect:~^To set mode when creating a new `file' ^fileproc:~^Program to file messages ^showproc:~^Program to show messages .fi .SH "SEE ALSO" packf(1) .SH DEFAULTS .nf .RB ` file "' defaults to \*(lq./msgbox\*(rq" .RB ` "\-prompt\ (msh)\ "' .RB ` \-noscan ' .RB ` \-notopcur ' .fi .SH CONTEXT None .SH BUGS The argument to the .B \-prompt switch must be interpreted as a single token by the shell that invokes .BR msh . Therefore, one must usually place the argument to this switch inside double\-quotes. .PP There is a strict limit of messages per file in .BR packf 'd format which .B msh can handle. Usually, this limit is 1000 messages. .PP Please remember that .B msh is not the C\-Shell, and that a lot of the nice facilities provided by the latter are not present in the former. .PP In particular, .B msh does not understand back\-quoting, so the only effective way to use .B pick inside .B msh is to always use the .B \-seq .I select switch. Clever users of .B nmh will put the line .P .RS 5 pick:\0\-seq\0select\0\-list .RE .PP in their .I \&.mh\(ruprofile file so that .B pick works equally well from both the shell and .BR msh . .PP .B sortm always uses .B \-noverbose and if .B \-textfield .I field is used, .B \-limit .IR 0 . .PP The .B msh program inherits most (if not all) of the bugs from the .B nmh commands it implements. nmh-1.5/man/mts.conf.man000644 007761 000765 00000000025 11476006206 015070 0ustar00kenhkenh000000 000000 .so man5/mh-tailor.5 nmh-1.5/man/new.man000644 007761 000765 00000004143 11713401273 014134 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH NEW %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME new \- report on folders with new messages .PP fnext \- set current folder to next folder with new messages .PP fprev \- set current folder to previous folder with new messages .PP unseen \- scan new messages in all folders with new messages .SH SYNOPSIS .HP 5 .na .B new .RI [ sequences ] .RB [ \-mode .IR mode ] .RB [ \-folders .IR foldersfile ] .RB [ \-version ] .RB [ \-help ] .PP .HP 5 .B fnext is equivalent to .B new \-mode fnext .PP .HP 5 .B fprev is equivalent to .B new \-mode fprev .PP .HP 5 .B unseen is equivalent to .B new \-mode unseen .ad .SH DESCRIPTION .B New in its default mode produces a one\-line\-per\-folder listing of all folders containing messages in the listed .IR sequences or in the sequences listed in the profile entry .RI \*(lq Unseen-Sequence \*(rq. Each line contains the folder, the number of messages in the desired sequences, and the message lists from the .mh_sequences file. For example: .PP .RS 5 .nf foo 11.* 40\-50 bar 380. 760\-772 824\-828 total 391. .fi .RE .PP The `*' on foo indicates that it is the current folder. The last line shows the total number of messages in the desired sequences. .PP .B New crawls the folder hierarchy recursively to find all folders, and prints them in lexicographic order. Override this behavior by providing .IR foldersfile containing the pre-sorted list of folders .B new should check, one per line. .PP In .B fnext and .B fprev modes, .B new instead changes to the next or previous matching folder, respectively. .PP In .B unseen mode, .B new executes .B scan sequences for each matching folder. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Unseen-Sequence:~^The name of the unseen message sequence .fi .SH "SEE ALSO" scan(1), mh\-format(5) .SH HISTORY Based on Luke Mewburn's new (http://www.mewburn.net/luke/src/new). nmh-1.5/man/next.man000644 007761 000765 00000003330 11713401273 014316 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH NEXT %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME next \- show the next message .SH SYNOPSIS .HP 5 .na .B next .RI [ +folder ] .RB [\-showproc .IR program ] .RB [ \-showmimeproc .IR program ] .RB [ \-header " | " \-noheader ] .RB [ \-checkmime " | " \-nocheckmime ] [switches\ for .I showproc or .IR showmimeproc ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Next performs a .B show on the next message in the specified (or current) folder. Like .BR show , it passes any switches on to the program .I showproc or .IR showmimeproc , which is called to list the message. This command is almost exactly equivalent to .RB \*(lq show .BR next \*(rq. Consult the manual entry for .BR show (1) for all the details. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^showproc:~^Program to show non-MIME messages ^showmimeproc:~^Program to show MIME messages .fi .SH "SEE ALSO" show(1), prev(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` \-checkmime ' .RB ` \-header ' .SH CONTEXT If a folder is specified, it will become the current folder. The message that is shown (i.e., the next message in sequence) will become the current message. .SH BUGS .B next is really a link to the .B show program. As a result, if you make a link to .B next and that link is not called .BR next , your link will act like .B show instead. To circumvent this, add a profile\-entry for the link to your .B nmh profile and add the argument .I next to the entry. nmh-1.5/man/nmh.man000644 007761 000765 00000020211 11765267273 014140 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH NMH %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME nmh \- new MH message system .SH SYNOPSIS any .B nmh command .SH DESCRIPTION .B nmh is the name of a powerful message handling system. Rather than being a single comprehensive program, .B nmh consists of a collection of fairly simple single-purpose programs to send, retrieve, save, and manipulate messages. .PP Unlike most mail clients in UNIX, .B nmh is not a closed system which must be explicitly run, then exited when you wish to return to the shell. You may freely intersperse .B nmh commands with other shell commands, allowing you to read and answer your mail while you have (for example) a compilation running, or search for a file or run programs as needed to find the answer to someone's question before answering their mail. .PP The rest of this manual entry is a quick tutorial which will teach you the basics of .BR nmh . You should read the manual entries for the individual programs for complete documentation. .PP To get started using .BR nmh , put the directory .I %bindir% on your .BR $PATH . This is best done in one of the files: .IR \&.profile , .IR \&.login , .IR \&.bashrc , or .I \&.cshrc in your home directory. (Check the manual entry for the shell you use, in case you don't know how to do this.) Run the .B install-mh command. If you've never used .B nmh before, it will create the necessary default files and directories after asking you if you wish it to do so. .PP .B inc moves mail from your system maildrop into your .B nmh `+inbox' folder, breaking it up into separate files and converting it to .B nmh format as it goes. It prints one line for each message it processes, containing the from field, the subject field and as much of the first line of the message as will fit. It leaves the first message it processes as your current message. You'll need to run .B inc each time you wish to incorporate new mail into your .B nmh file. .PP .B scan .B prints a list of the messages in your current folder. .PP The commands: .BR show , .BR next , and .B prev are used to read specific messages from the current folder. .B show displays the current message, or a specific message, which may be specified by its number, which you pass as an argument to .BR show . .B next and .B prev display, respectively, the message numerically after or before the current message. In all cases, the message displayed becomes the current message. If there is no current message, .B show may be called with an argument, or .B next may be used to advance to the first message. .PP .B rmm (remove message) deletes the current message. It may be called with message numbers passed as arguments, to delete specific messages. .PP .B repl is used to respond to the current message (by default). It places you in the editor with a prototype response form. While you're in the editor, you may peruse the item you're responding to by reading the file .IR @ . After completing your response, type .B l to .B list (review) it, or .B s to .B send it. .PP .B comp allows you to compose a message by putting you in the editor on a prototype message form, and then lets you send it. .PP All the .B nmh commands may be run with the single argument: .BR \-help , which causes them to print a list of the arguments they may be invoked with and then exit. .PP All the .B nmh commands may be run with the single argument: .BR \-version , which cause them to print the version number of the .B nmh distribution, and then exit. .PP Commands which take a message number as an argument ( .BR scan , .BR show , .BR repl , \&...) also take one of the words: \*(lqfirst\*(rq, \*(lqprev\*(rq, \*(lqcur\*(rq, \*(lqnext\*(rq, or \*(lqlast\*(rq to indicate (respectively) the first, previous, current, next, or last message in the current folder (assuming they are defined). Commands which take a range of message numbers ( .BR rmm , .BR scan , .BR show , \&...) also take any of the abbreviations: .PP .RS 5 .IP \fI\fR\-\fI\fR 15 Indicates all messages in the range to , inclusive. The range must be nonempty. .IP \fI\fR:+\fIN\fR 15 .IP \fI\fR:\-\fIN\fR 15 Up to .I N messages beginning with (or ending with) message .IR num . .I Num may be any of the pre-defined symbols: .IR first , .IR prev , .IR cur , .I next or .IR last . .IP first:\fIN\fR 15 .IP prev:\fIN\fR 15 .IP next:\fIN\fR 15 .IP last:\fIN\fR 15 The first, previous, next or last messages, if they exist. .RE .PP There are many other possibilities such as creating multiple folders for different topics, and automatically refiling messages according to subject, source, destination, or content. These are beyond the scope of this manual entry. .PP Following is a list of all the .B nmh commands: .PP .RS 5 .fc ^ ~ .nf .ta 1.5i ^ali(1)~^\- list mail aliases ^anno(1)~^\- annotate messages ^burst(1)~^\- explode digests into messages ^comp(1)~^\- compose a message ^dist(1)~^\- redistribute a message to additional addresses ^flist(1)~^\- list folders with messages in given sequence(s) ^flists(1)~^\- list all folders with messages in given sequence(s) ^folder(1)~^\- set/list current folder/message ^folders(1)~^\- list all folders ^forw(1)~^\- forward messages ^inc(1)~^\- incorporate new mail ^mark(1)~^\- mark messages ^mhbuild(1)~^\- translate MIME composition draft ^mhl(1)~^\- produce formatted listings of nmh messages ^mhlist(1)~^\- list information about content of MIME messages ^mhmail(1)~^\- send or read mail ^mhn(1)~^\- display/list/store/cache MIME messages ^mhparam(1)~^\- print nmh profile components ^mhpath(1)~^\- print full pathnames of nmh messages and folders ^mhshow(1)~^\- display MIME messages ^mhstore(1)~^\- store contents of MIME messages into files ^msgchk(1)~^\- check for messages ^msh(1)~^\- nmh shell(and BBoard reader) ^next(1)~^\- show the next message ^packf(1)~^\- compress a folder into a single file ^pick(1)~^\- select messages by content ^prev(1)~^\- show the previous message ^prompter(1)~^\- prompting editor front end ^rcvdist(1)~^\- asynchronously redistribute new mail ^rcvpack(1)~^\- append message to file ^rcvstore(1)~^\- asynchronously incorporate new mail ^rcvtty(1)~^\- report new mail ^refile(1)~^\- file messages in other folders ^repl(1)~^\- reply to a message ^rmf(1)~^\- remove folder ^rmm(1)~^\- remove messages ^scan(1)~^\- produce a one line per message scan listing ^send(1)~^\- send a message ^sendfiles(1)~^\- send multiple files and directories in MIME message ^show(1)~^\- show(display) messages ^slocal(1)~^\- asynchronously filter and deliver new mail ^sortm(1)~^\- sort messages ^whatnow(1)~^\- prompting front\-end for send ^whom(1)~^\- report to whom a message would go .sp ^mh\-alias(5)~^\- alias file for nmh message system ^mh\-draft(5)~^\- draft folder facility ^mh\-format(5)~^\- format file for nmh message system ^mh\-mail(5)~^\- message format for nmh message system ^mh\-profile(5)~^\- user customization for nmh message system ^mh\-sequence(5)~^\- sequence specification for nmh message system ^mh\-tailor(5)~^\- mail transport customization for nmh message system .sp ^ap(8)~^\- parse addresses 822\-style ^conflict(8)~^\- search for alias/password conflicts ^dp(8)~^\- parse dates 822\-style ^fmtdump(8)~^\- decode \fInmh\fP format files ^install\-mh(8)~^\- initialize the nmh environment ^post(8)~^\- deliver a message .fi .RE .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%bindir%~^contains \fInmh\fR commands ^%etcdir%~^contains \fInmh\fR format files ^%libdir%~^contains \fInmh\fR library commands ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory .fi .SH BUGS If problems are encountered with an .B nmh program, the problems should be reported to the local maintainers of .BR nmh . When doing this, the name of the program should be reported, along with the version information for the program. .br To find out what version of an .B nmh program is being run, invoke the program with the .B \-version switch. This information includes the version of .BR nmh , the host it was generated on, and the date the program was loaded. .PP Send bug reports and suggestions to .IR nmh-workers@nongnu.org . .SH "SEE ALSO" mh-chart(1) nmh-1.5/man/packf.man000644 007761 000765 00000004336 11762736345 014452 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH PACKF %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME packf \- pack messages in nmh folder into a single file .SH SYNOPSIS .HP 5 .na .B packf .RI [ +folder ] .RI [ msgs ] .RB [ \-file .IR name ] .RB [ \-mbox ] .RB [ \-mmdf ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Packf will pack copies of messages from a folder, into a single file. .PP If the .B \-mbox switch is given (the default), then the messages are separated using mbox (uucp) style delimiters. This is the format used by most mail clients (elm, mailx, etc.). .PP If the .B \-mmdf switch is given, then the messages are separated by mmdf style delimiters. Each message in the file is separated by four CTRL\-A's and a newline. .PP You may specify the name of the file in which to use with the .B \-file .I name switch. If you do not specify the name of the file, it will default to .RI \*(lq msgbox \*(rq. .PP If the given file name points to an existing file, then the specified messages will be appended to the end of the file, otherwise the file will be created and the messages appended. .PP .B packf makes an mbox-style delimiter by examining the first line of the message. If the first line is a \*(lqReturn-Path\*(rq field, its address and the current date and time are used. Otherwise, if the first line has an \*(lqX-Envelope-From\*(rq field, its contents (which should already be in the correct format) are used. Otherwise, a dummy address and the current date and time are used. .PP Messages that are packed by .B packf can be unpacked using .BR inc . .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^\&.msgbox\&.map~^A binary index of the file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Msg\-Protect:~^To set mode when creating a new `file' .fi .SH "SEE ALSO" inc(1), msh(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to all" .RB ` \-mbox ' .RB ` "\-file ./msgbox" ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The first message packed will become the current message. nmh-1.5/man/pick.man000644 007761 000765 00000022356 11762736345 014316 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH PICK %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME pick \- search for messages by content .SH SYNOPSIS .HP 5 .na .B pick .RI [ +folder ] .RI [ msgs ] .RB [ \-and \&...] .RB [ \-or \&...] .RB [ \-not \&...] .RB [ \-lbrace \&... .BR \-rbrace ] .RB [ \-\|\-component .IR pattern ] .RB [ \-cc .IR pattern ] .RB [ \-date .IR pattern ] .RB [ \-from .IR pattern ] .RB [ \-search .IR pattern ] .RB [ \-subject .IR pattern ] .RB [ \-to .IR pattern ] .RB [ \-after .IR date ] .RB [ \-before .IR date ] .RB [ \-datefield .IR field ] .RB [ \-sequence .I name \&...] .RB [ \-public " | " \-nopublic ] .RB [ \-zero " | " \-nozero ] .RB [ \-list " | " \-nolist ] .RB [ \-version ] .RB [ \-help ] .PP typical usage: .PP .RS 5 .nf scan\0`pick\0\-from\0jones` pick\0\-to\0holloway\0\-sequence\0select show\0`pick\0\-before\0friday` .fi .RE .ad .SH DESCRIPTION .B Pick searches within a folder for messages with the specified contents, and then identifies those messages. Two types of search primitives are available: pattern matching and date constraint operations. .PP A modified .BR grep (1) is used to perform the matching, so the full regular expression (see .BR ed (1)) facility is available within .IR pattern . With .BR \-search , .I pattern is used directly, and with the others, the grep pattern constructed is: .PP .RS 5 `component[ \\t]*:\&.*pattern' .RE .PP This means that the pattern specified for a .B \-search will be found everywhere in the message, including the header and the body, while the other pattern matching requests are limited to the single specified component. The expression .PP .RS 5 `\-\|\-component\ pattern' .RE .PP is a shorthand for specifying .PP .RS 5 `\-search \*(lqcomponent[ \\t]*:\&.*pattern\*(rq\ ' .RE .PP It is used to pick a component which is not one of \*(lqTo:\*(rq, \*(lqcc:\*(rq, \*(lqDate:\*(rq, \*(lqFrom:\*(rq, or \*(lqSubject:\*(rq. An example is .RB \*(lq "pick\0\-\|\-reply\-to\0pooh" \*(rq. .PP Pattern matching is performed on a per\-line basis. Within the header of the message, each component is treated as one long line, but in the body, each line is separate. Lower\-case letters in the search pattern will match either lower or upper case in the message, while upper case will match only upper case. .PP Note that since the .B \-date switch is a pattern matching operation (as described above), to find messages sent on a certain date the pattern string must match the text of the \*(lqDate:\*(rq field of the message. .PP Independent of any pattern matching operations requested, the switches .B \-after .I date or .B \-before .I date may also be used to introduce date/time constraints on all of the messages. By default, the \*(lqDate:\*(rq field is consulted, but if another date yielding field (such as \*(lqBB\-Posted:\*(rq or \*(lqDelivery\-Date:\*(rq) should be used, the .B \-datefield .I field switch may be used. .PP With .B \-before and .BR \-after , .B pick will actually parse the date fields in each of the messages specified in `msgs' and compare them to the date/time specified. If .B \-after is given, then only those messages whose \*(lqDate:\*(rq field value is chronologically after the date specified will be considered. The .B \-before switch specifies the complimentary action. .PP Both the .B \-after and .B \-before switches take legal 822\-style date specifications as arguments. .B Pick will default certain missing fields so that the entire date need not be specified. These fields are (in order of defaulting): timezone, time and timezone, date, date and timezone. All defaults are taken from the current date, time, and timezone. .PP In addition to 822\-style dates, .B pick will also recognize any of the days of the week (\*(lqsunday\*(rq, \*(lqmonday\*(rq, and so on), and the special dates \*(lqtoday\*(rq, \*(lqyesterday\*(rq (24 hours ago), and \*(lqtomorrow\*(rq (24 hours from now). All days of the week are judged to refer to a day in the past (e.g., telling \fIpick\fR \*(lqsaturday\*(rq on a \*(lqtuesday\*(rq means \*(lqlast\ saturday\*(rq not \*(lqthis\ saturday\*(rq). .PP Finally, in addition to these special specifications, .B pick will also honor a specification of the form \*(lq\-dd\*(rq, which means \*(lqdd days ago\*(rq. .PP .B Pick supports complex boolean operations on the searching primitives with the .BR \-and , .BR \-or , .BR \-not , and .B \-lbrace .B \&... .B \-rbrace switches. For example, .PP .RS 5 .nf pick\0\-after\0yesterday\0\-and \-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace .fi .RE .PP identifies messages recently sent by \*(lqfrieda\*(rq or \*(lqfear\*(rq. .PP The matching primitives take precedence over the .B \-not switch, which in turn takes precedence over .B \-and which in turn takes precedence over .BR \-or . To override the default precedence, the .B \-lbrace and .B \-rbrace switches are provided, which act just like opening and closing parentheses in logical expressions. .PP If no search criteria are given, all the messages specified on the command line are selected (this defaults to \*(lqall\*(rq). .PP Once the search has been performed, if the .B \-list switch is given, the message numbers of the selected messages are written to the standard output separated by newlines. This is .B extremely useful for quickly generating arguments for other .B nmh programs by using the \*(lqbackquoting\*(rq syntax of the shell. For example, the command .PP .RS 5 scan\0`pick\0+todo\0\-after\0\*(lq31 Mar 83 0123 PST\*(rq` .RE .PP says to .B scan those messages in the indicated folder which meet the appropriate criterion. Note that since .BR pick 's context changes are written out prior to .BR scan 's invocation, you need not give the folder argument to .B scan as well. .PP The .B \-sequence .I name switch may be given once for each sequence the user wishes to define. For each sequence named, that sequence will be defined to mean exactly those messages selected by .BR pick . For example, .PP .RS 5 pick\0\-from\0frated\0\-seq\0fred .RE .PP defines a new message sequence for the current folder called \*(lqfred\*(rq which contains exactly those messages that were selected. .PP By default, .B pick will zero the sequence before adding it. This action can be disabled with the .B \-nozero switch, which means that the messages selected by .B pick will be added to the sequence, if it already exists, and any messages already a part of that sequence will remain so. .PP The .B \-public and .B \-nopublic switches are used by .B pick in the same way .B mark uses them. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder .fi .SH "SEE ALSO" mark(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to all" .RB ` "\-datefield date" ' .RB ` \-zero ' .RB ` \-list "' is the default if no `\-sequence', `\-nolist' otherwise" .fi .SH CONTEXT If a folder is given, it will become the current folder. .SH HISTORY In previous versions of .BR MH , the .B pick command would .BR show , .BR scan , or .B refile the selected messages. This was rather \*(lqinverted logic\*(rq from the UNIX point of view, so .B pick was changed to define sequences and output those sequences. Hence, .B pick can be used to generate the arguments for all other .B MH commands, instead of giving .B pick endless switches for invoking those commands itself. .PP Also, previous versions of .B pick balked if you didn't specify a search string or a date/time constraint. The current version does not, and merely matches the messages you specify. This lets you type something like: .PP .RS 5 show\0`pick\0last:20\0\-seq\0fear` .RE .PP instead of typing .PP .RS 5 .nf mark\0\-add\0\-nozero\0\-seq\0fear\0last:20 show\0fear .fi .RE .PP Finally, timezones used to be ignored when comparing dates: they aren't any more. .SH "HELPFUL HINTS" Use .RB \*(lq "pick sequence \-list" \*(rq to enumerate the messages in a sequence (such as for use by a shell script). .SH BUGS The argument to the .B \-after and .B \-before switches must be interpreted as a single token by the shell that invokes .BR pick . Therefore, one must usually place the argument to this switch inside quotes. Furthermore, any occurrence of .B \-datefield must occur prior to the .B \-after or .B \-before switch it applies to. .PP If .B pick is used in a back\-quoted operation, such as .PP .RS 5 scan\0`pick\0\-from\0jones` .RE .PP and .B pick selects no messages (e.g., no messages are from \*(lqjones\*(rq), then the shell will still run the outer command (e.g., .BR scan ). Since no messages were matched, .B pick produced no output, and the argument given to the outer command as a result of backquoting .B pick is empty. In the case of .B nmh programs, the outer command now acts as if the default `msg' or `msgs' should be used (e.g., \*(lqall\*(rq in the case of .BR scan ). To prevent this unexpected behavior, if .B \-list was given, and if its standard output is not a tty, then .B pick outputs the illegal message number \*(lq0\*(rq when it fails. This lets the outer command fail gracefully as well. .PP The pattern syntax \*(lq[l-r]\*(rq is not supported; each letter to be matched must be included within the square brackets. nmh-1.5/man/post.man000644 007761 000765 00000015524 11762736345 014354 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH POST %manext8% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME post \- deliver a message .SH SYNOPSIS .HP 5 .na .B %libdir%/post .RB [ \-alias .IR aliasfile ] .RB [ \-filter .IR filterfile ] .RB [ \-nofilter ] .RB [ \-format " | " \-noformat ] .RB [ \-mime " | " \-nomime ] .RB [ \-msgid " | " \-nomsgid ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-watch " | " \-nowatch ] .RB [ \-width .IR columns ] .RB [ \-server .IR servername ] .RB [ \-port .IR portname/number ] .RB [ \-sasl ] .RB [ \-nosasl ] .RB [ \-saslmaxssf .IR ssf ] .RB [ \-saslmech .IR mechanism ] .RB [ \-user .IR username ] .RB [ \-tls ] .RB [ \-notls ] .I file .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Post is the default program called by .B send to deliver the message in .I file to local and remote users. In fact, most of the features attributed to .B send in its manual page are performed by .BR post , with .B send acting as a relatively simple preprocessor. Thus, it is .B post which parses the various header fields, appends a \*(lqDate:\*(rq line, and interacts with the mail transport system. .B Post will not normally be called directly by the user. .PP .B Post searches the \*(lqTo:\*(rq, \*(lqcc:\*(rq, \*(lqBcc:\*(rq, \*(lqFcc:\*(rq, and \*(lqResent\-xxx:\*(rq header lines of the specified message for destination addresses, checks these addresses for validity, and formats them so as to conform to ARPAnet Internet Message Format protocol, unless the .B \-noformat flag is set. This will normally cause \*(lq@\fIlocal\-site\fR\*(rq to be appended to each local destination address, as well as any local return addresses. The .B \-width .I columns switch can be used to indicate the preferred length of the header components that contain addresses. .PP If a \*(lqBcc:\*(rq field is encountered, its addresses will be used for delivery, and the \*(lqBcc:\*(rq field will be removed from the message sent to sighted recipients. The blind recipients will receive an entirely new message with a minimal set of headers. Included in the body of the message will be a copy of the message sent to the sighted recipients. If .B \-filter .I filterfile is specified, then this copy is filtered (re\-formatted) by .B mhl prior to being sent to the blind recipients. Alternately, if the .B \-mime switch is given, then .B post will use the MIME rules for encapsulation. .PP The .B \-alias .I aliasfile switch can be used to specify a file that post should take aliases from. More than one file can be specified, each being preceded with .BR \-alias . In any event, the primary alias file is read first. .PP The .B \-msgid switch indicates that a \*(lqMessage\-ID:\*(rq or \*(lqResent\-Message\-ID:\*(rq field should be added to the header. .PP The .B \-verbose switch indicates that the user should be informed of each step of the posting/filing process. .PP The .B \-watch switch indicates that the user would like to watch the transport system's handling of the message (e.g., local and \*(lqfast\*(rq delivery). .PP Under normal circumstances, .B post uses the \*(lqFrom:\*(rq line in the message draft as the identity of the the originating mailbox. A \*(lqFrom:\*(rq line is required in all message draft. By default the message composition utilities such as .B comp and .B repl will automatically place a \*(lqFrom:\*(rq line in the message draft. There are two ways to override this behavior, however. Note that they apply equally to \*(lqResent\-From:\*(rq lines in messages sent with .BR dist . .PP The first way is to supply a \*(lqSender:\*(rq line. The value of this field will be used as the originating mailbox identity when submitting the message to the mail transport system. If multiple addresses are given in the \*(lqFrom:\*(rq line, a \*(lqSender:\*(rq line is .BR required . If an \*(lqEnvelope-From:\*(rq line is supplied when multiple addresses are given in the \*(lqFrom:\*(rq line, a \*(lqSender:\*(rq header will be generated using the value of the \*(lqEnvelope-From:\*(rq line, .B if the \*(lqEnvelope-From:\*(rq line is not blank. .PP The second way is to supply a \*(lqEnvelope-From:\*(rq line. The value of this field will be used as the originating mailbox identity when submitting the message to the mail transport system. This will override both the value of the \*(lqFrom:\*(rq line and a \*(lqSender:\*(rq line (if one is supplied). The \*(lqEnvelope-From:\*(rq line is allowed to have a blank value; if the value is blank, then the mail transport system will be instructed to not send any bounces in response to the message. Not all mail transport systems support this feature. .PP If nmh is using the SMTP MTA, the .B \-server and the .B \-port switches can be used to override the default mail server (defined by the .RI servers entry in .I %etcdir%/mts.conf ). .PP If .B nmh has been compiled with SASL support, the .B \-sasl and .B \-nosasl switches will enable and disable the use of SASL authentication with the SMTP MTA. Depending on the SASL mechanism used, this may require an additional password prompt from the user (but the .RI \*(lq \&.netrc \*(rq file can be used to store this password). .B \-saslmech switch can be used to select a particular SASL mechanism, and the the .B \-user switch can be used to select a authorization userid to provide to SASL other than the default. .PP If SASL authentication is successful, .BR nmh will attempt to negotiate a security layer for session encryption. Encrypted data is labelled with `(sasl-encrypted)' and `(sasl-decrypted)' when viewing the SMTP transaction with the .B \-snoop switch. The .B \-saslmaxssf switch can be used to select the maximum value of the Security Strength Factor. This is an integer value and the exact meaning of this value depends on the underlying SASL mechanism. A value of 0 disables encryption. .PP If .B nmh has been compiled with TLS support, the .B \-tls and .B \-notls switches will require and disable the negotiation of TLS support when connecting to the SMTP MTA. Encrypted data is labelled with `(tls-encrypted)' and `(tls-decrypted)' when viewing the SMTP transction with the .B \-snoop switch. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/mts.conf~^nmh mts configuration file ^%etcdir%/MailAliases~^global nmh alias file ^%bindir%/refile~^Program to process Fcc:s ^%libdir%/mhl~^Program to process Bcc:s .fi .SH "PROFILE COMPONENTS" .B post does .B NOT consult the user's .I \&.mh\(ruprofile .SH "SEE ALSO" mhmail(1), send(1), mh\-mail(5), mh\-alias(5), mh\-tailor(5), .I "Standard for the Format of ARPA Internet Text Messages" (RFC\-822) .SH DEFAULTS .nf .RB ` \-alias "' defaults to %etcdir%/MailAliases" .RB ` \-format ' .RB ` \-nomime ' .RB ` \-nomsgid ' .RB ` \-noverbose ' .RB ` \-nowatch ' .RB ` "\-width\ 72" ' .RB ` \-nofilter ' .fi .SH CONTEXT None .SH BUGS \*(lqReply\-To:\*(rq fields are allowed to have groups in them according to the 822 specification, but .B post won't let you use them. nmh-1.5/man/prev.man000644 007761 000765 00000003357 11713401273 014325 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH PREV %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME prev \- show the previous message .SH SYNOPSIS .HP 5 .na .B prev .RI [ +folder ] .RB [\-showproc .IR program ] .RB [ \-showmimeproc .IR program ] .RB [ \-header " | " \-noheader ] .RB [ \-checkmime " | " \-nocheckmime ] [switches\ for .I showproc or .IR showmimeproc ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Prev performs a .B show on the previous message in the specified (or current) folder. Like .BR show , it passes any switches on to the program named by .I showproc or .IR showmimeproc , which is called to list the message. This command is almost exactly equivalent to .RB \*(lq "show prev" \*(rq. Consult the manual entry for .BR show (1) for all the details. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^showproc:~^Program to show non-MIME messages ^showmimeproc:~^Program to show MIME messages .fi .SH "SEE ALSO" show(1), next(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` \-checkmime ' .RB ` \-header ' .fi .SH CONTEXT If a folder is specified, it will become the current folder. The message that is shown (i.e., the previous message in sequence) will become the current message. .SH BUGS .B prev is really a link to the .B show program. As a result, if you make a link to .B prev and that link is not called .BR prev , your link will act like .B show instead. To circumvent this, add a profile\-entry for the link to your .B nmh profile and add the argument .B prev to the entry. nmh-1.5/man/prompter.man000644 007761 000765 00000010570 11762736345 015233 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH PROMPTER %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME prompter \- prompting editor front-end for nmh .SH SYNOPSIS .HP 5 .na .B prompter .RB [ \-erase .IR chr ] .RB [ \-kill .IR chr ] .RB [ \-prepend " | " \-noprepend ] .RB [ \-rapid " | " \-norapid ] .RB [ \-doteof " | " \-nodoteof ] .I file .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Prompter is an editor front\-end for .B nmh which allows rapid composition of messages. This program is not normally invoked directly by users but takes the place of an editor and acts as an editor front\-end. It operates on an RFC\-822 style message draft skeleton specified by .IR file , normally provided by the .B nmh commands .BR comp , .BR dist , .BR forw , or .BR repl . .PP .B Prompter is particularly useful when composing messages over slow network or modem lines. It is an .B nmh program in that it can have its own profile entry with switches, but it is not invoked directly by the user. The commands .BR comp , .BR dist , .BR forw , and .B repl invoke .B prompter as an editor, either when invoked with .B \-editor .IR prompter , or by the profile entry \*(lqEditor:\ prompter\*(rq, or when given the command .B edit .B prompter at the \*(lqWhat now?\*(rq prompt. .PP For each empty component .B prompter finds in the draft, the user is prompted for a response; A will cause the whole component to be left out. Otherwise, a `\\' preceding a will continue the response on the next line, allowing for multiline components. Continuation lines .B must begin with a space or tab. .PP Each non\-empty component is copied to the draft and displayed on the terminal. .PP The start of the message body is denoted by a blank line or a line of dashes. If the body is non\-empty, the prompt, which isn't written to the file, is .PP .RS 5 --------Enter additional text .RE .PP or (if .B \-prepend was given) .PP .RS 5 --------Enter initial text .RE .PP Message\-body typing is terminated with an end\-of\-file (usually CTRL\-D). With the .B \-doteof switch, a period on a line all by itself also signifies end\-of\-file. At this point control is returned to the calling program, where the user is asked \*(lqWhat now?\*(rq. See .B whatnow (1) for the valid options to this query. .PP By using the .B \-prepend switch, the user can add type\-in to the beginning of the message body and have the rest of the body follow. This is useful for the .B forw command. .PP By using the .B \-rapid switch, if the draft already contains text in the message\-body, it is not displayed on the user's terminal. This is useful for low\-speed terminals. .PP The line editing characters for kill and erase may be specified by the user via the arguments .B \-kill .I chr and .B \-erase .IR chr , where .I chr may be a character; or `\\nnn', where \*(lqnnn\*(rq is the octal value for the character. .PP An interrupt (usually CTRL\-C) during component typing will abort .B prompter and the .B nmh command that invoked it. An interrupt during message\-body typing is equivalent to CTRL\-D, for historical reasons. This means that .B prompter should finish up and exit. .PP The first non\-flag argument to .B prompter is taken as the name of the draft file, and subsequent non\-flag arguments are ignored. .\" (\fIRepl\fR invokes editors with two file arguments: .\" the draft file name and the replied\-to message file name.) .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^/tmp/prompter*~^Temporary copy of message .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u prompter\-next: To name the editor to be used on exit from .B prompter ^Msg\-Protect:~^To set mode when creating a new draft .fi .SH "SEE ALSO" comp(1), dist(1), forw(1), repl(1), whatnow(1) .SH DEFAULTS .nf .RB ` \-prepend ' .RB ` \-norapid ' .RB ` \-nodoteof ' .fi .SH CONTEXT None .SH "HELPFUL HINTS" The .B \-rapid option is particularly useful with .BR forw , and .B \-noprepend is useful with .B comp .BR \-use . .PP The user may wish to link .B prompter under several names (e.g., \*(lqrapid\*(rq) and give appropriate switches in the profile entries under these names (e.g., \*(lqrapid: -rapid\*(rq). This facilitates invoking prompter differently for different .B nmh commands (e.g., \*(lqforw: -editor rapid\*(rq). .SH BUGS .B Prompter uses .BR stdio (3), so it will lose if you edit files with nulls in them. nmh-1.5/man/rcvdist.man000644 007761 000765 00000003500 11762736345 015034 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH RCVDIST %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME rcvdist \- asynchronously redistribute new mail .SH SYNOPSIS .HP 5 .na .B %libdir%/rcvdist .RB [ \-form .IR formfile ] [switches\ for .IR postproc ] .I address1 \&... .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B rcvdist program will accept a message on its standard input and resend a copy of this message to all of the addresses listed on its command line. .PP When a message is redistributed with the .B rcvdist command, the format of the Resent-xxx header fields is controlled by the forms files .RI \*(lq rcvdistcomps \*(rq. If a file named .RI \*(lq rcvdistcomps \*(rq exists in the user's nmh directory, it will be used instead of the default one. You may specify an alternate forms file with the switch .B \-form .IR formfile . .PP The .RI \*(lq rcvdistcomps \*(rq file uses the format string facility described in .BR mh\-format (5). In addition to the standard format escapes, .B rcvdist also recognizes the following additional .I component escape: .PP .RS 5 .nf .ta \w'Dtimenow 'u +\w'Returns 'u .I "Escape Returns Description" addresses string the addresses to distribute to .fi .RE .PP By default, .B rcvdist uses the program .B post to do the actual delivery of the message, although this can be changed by defining the .I postproc profile component. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/rcvdistcomps~^Default message skeleton ^or /rcvdistcomps~^Rather than standard message skeleton ^%etcdir%/mts.conf~^nmh mts configuration file ^$HOME/\&.maildelivery~^The file controlling local delivery ^%etcdir%/maildelivery~^Rather than the standard file .fi .SH "SEE ALSO" rcvpack(1), rcvstore(1), rcvtty(1), mh\-format(5), slocal(1) .SH BUGS Only two return codes are meaningful, others should be. nmh-1.5/man/rcvpack.man000644 007761 000765 00000002314 11713401273 014772 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH RCVPACK %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME rcvpack \- append message to file .SH SYNOPSIS .HP 5 .na .B %libdir%/rcvpack .I file .RB [ \-mbox ] .RB [ \-mmdf ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B rcvpack program will append a copy of the message to the file listed on its command line. .PP If the .B \-mbox switch is given (the default), then the messages are separated using mbox (uucp) style delimiters. This is the format used by most mail clients (elm, mailx, etc.). .PP If the .B \-mmdf switch is given, then the messages are separated by mmdf style delimiters. Each message in the file is separated by four CTRL\-A's and a newline. .PP .B rcvpack will correctly lock and unlock the file to serialize access to the file, when running multiple copies of .B rcvpack . .PP In general, its use is obsoleted by the .B file action of .BR slocal , although it might still have occasional uses in various shell scripts. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/mts.conf~^nmh mts configuration file .fi .SH "SEE ALSO" rcvdist(1), rcvstore(1), rcvtty(1), slocal(1) .SH BUGS Only two return codes are meaningful, others should be. nmh-1.5/man/rcvstore.man000644 007761 000765 00000006761 11713401273 015222 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH RCVSTORE %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME rcvstore \- asynchronously incorporate mail into a folder .SH SYNOPSIS .HP 5 .na .B %libdir%/rcvstore .RI [ +folder ] .RB [ \-create " | " \-nocreate ] .RB [ \-unseen " | " \-nounseen ] .RB [ \-zero " | " \-nozero ] .RB [ \-sequence .I name \&...] .RB [ \-public " | " \-nopublic ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Rcvstore incorporates a message from the standard input into an .B nmh folder. This command is typically used in conjunction with mail filtering programs such as .B slocal and .BR procmail , to filter your mail into different folders. .PP You may specify which folder to use with .IR +folder . If no folder is specified, .B rcvstore will use the folder given by a non\-empty \*(lqInbox:\*(rq entry in the user's profile, else it will use the folder named \*(lqinbox\*(rq. .PP If the switch .B \-create is given (it is the default) and if the specified (or default) folder does not exist, then it will be created. You may disable this with the .B \-nocreate option. In this case .B rcvstore will exit if the specified folder does not exist. .PP When the new message is incorporated into the folder, it is assigned the next highest number for that folder. .PP .B Rcvstore will incorporate anything except zero length messages into the user's .B nmh folder. It will not change the message in any way. .PP If the user's profile contains a \*(lqMsg\-Protect: nnn\*(rq entry, it will be used as the protection on the newly created message, otherwise the .B nmh default of 0644 will be used. For all subsequent operations on this message, this initially assigned protection will be preserved. .PP If the switch .B \-unseen is given (it is on by default), and if the profile entry \*(lqUnseen\-Sequence\*(rq is present and non\-empty, then .B rcvstore will add the newly incorporated message to each sequence named by this profile entry. You may use the switch .B \-nounseen to disable this. These sequences will not be zero'ed by .B rcvstore prior to adding the new message. .PP Furthermore, the incoming message may be added to additional sequences as they arrive by the use of the .B \-sequence switch. As with the commands .B pick and .BR mark , you may also use the switches .B \-zero and .B \-nozero to specify whether to zero old sequences or not. Similarly, use of the .B \-public and .B \-nopublic switches may be used to force these sequences to be public or private sequences. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Folder\-Protect:~^To set mode when creating a new folder ^Inbox:~^To find the default inbox ^Msg\-Protect:~^To set mode when creating a new message ^Unseen\-Sequence:~^To name sequences denoting unseen messages .fi .SH "SEE ALSO" rcvdist(1), rcvpack(1), rcvtty(1), mh\-sequence(5) .SH DEFAULTS .nf .RB ` +folder "' defaults to \*(lqInbox\*(rq profile entry" .RB ` \-create ' .RB ` \-unseen ' .RB ` \-nozero ' .fi .SH CONTEXT No context changes will be attempted, with the exception of sequence manipulation. .SH BUGS If you use the \*(lqUnseen\-Sequence\*(rq profile entry, .B rcvstore could try to update the context while another .B nmh process is also trying to do so. This can cause the context to become corrupted. To avoid this, do not use .B rcvstore if you use the \*(lqUnseen\-Sequence\*(rq profile entry. nmh-1.5/man/rcvtty.man000644 007761 000765 00000004746 11713401273 014707 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH RCVTTY %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME rcvtty \- report new mail .SH SYNOPSIS .HP 5 .na .B %libdir%/rcvtty .RI [ command ] .RB [ \-form .IR formatfile ] .RB [ \-format .IR string ] .RB [ \-width .IR columns ] .RB [ \-bell " | " \-nobell ] .RB [ \-newline " | " \-nonewline ] .RB [ \-biff ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION The .B rcvtty can be used to report new mail. It is used primarily in conjunction with mail filtering agents such as .B slocal or .BR procmail . .PP The .B rcvtty program executes the named command with the message as its standard input, and writes the resulting output on your terminal. .PP Alternately, if no command is specified (or is bogus), then .B rcvtty will instead write a one\-line scan listing. The default output format of this scan listing may be overridden by using either the .B \-form .I formatfile or .B \-format .I string option, similar to the equivalent options for .B scan and .BR inc . See .BR mh\-format (5) for details. .PP A newline is output before the message output, and the terminal bell is rung after the output. The .B \-nonewline and .B \-nobell options will inhibit these functions. .PP The switch .B \-width .I columns may be given to specify the width of the scan line. The default is to use the width of the terminal. .PP In addition to the standard format escapes described in .BR mh\-format (5), .B rcvtty also recognizes the following additional .I component escapes: .PP .RS 5 .nf .ta \w'Dtimenow 'u +\w'Returns 'u Escape Returns Description body string the (compressed) first part of the body dtimenow date the current date folder string the name of the current folder .fi .RE .PP By default, .B rcvtty will send its output to every terminal on the local machine that is owned by current user, and that has given write permission as granted by the command .BR mesg (1). If the option .B \-biff is given, then .B rcvtty will obey the notification status set by the command .BR biff (1) instead. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/mts.conf~^nmh mts configuration file ^$HOME/\&.maildelivery~^The file controlling local delivery ^%etcdir%/maildelivery~^Rather than the standard file .fi .SH CONTEXT None .SH DEFAULTS .nf .RB ` \-width "' defaults to the width of the terminal" .RB ` \-newline ' .RB ` \-bell ' .fi .SH "SEE ALSO" rcvdist(1), rcvpack(1), rcvstore(1), mh\-format(5), slocal(1) .SH BUGS Only two return codes are meaningful, others should be. nmh-1.5/man/refile.man000644 007761 000765 00000012533 11713401273 014613 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH REFILE %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME refile \- file message in other folders .SH SYNOPSIS .HP 5 .na .B refile .RI [ msgs ] .RB [ \-draft ] .RB [ \-link " | " \-nolink ] .RB [ \-preserve " | " \-nopreserve ] .RB [ \-unlink " | " \-nounlink ] .RB [ \-src .IR +folder ] .RB [ \-file .IR file ] .RB [ \-rmmproc .IR program ] .RB [ \-normmproc ] .I +folder1 \&... .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Refile moves (see .BR mv (1)) or links (see .BR ln (1)) messages from a source folder into one or more destination folders. .PP If you think of a message as a sheet of paper, this operation is not unlike filing the sheet of paper (or copies) in file cabinet folders. When a message is filed, it is linked into the destination folder(s) if possible, and is copied otherwise. As long as the destination folders are all on the same file system, multiple filing causes little storage overhead. This facility provides a good way to cross\-file or multiply\-index messages. For example, if a message is received from Jones about the ARPA Map Project, the command .PP .RS 5 refile\0cur\0+jones\0+Map .RE .PP would allow the message to be found in either of the two folders `jones' or `Map'. .PP You may specify the source folder using .B \-src .IR +folder . If this is not given, the current folder is used by default. If no message is specified, then `cur' is used by default. .PP The option .B \-file .I file directs .B refile to use the specified file as the source message to be filed, rather than a message from a folder. Note that the file should be a validly formatted message, just like any other .B nmh message. It should .B NOT be in mail drop format (to convert a file in mail drop format to a folder of .B nmh messages, see .BR inc (1)). .PP If a destination folder doesn't exist, .B refile will ask if you want to create it. A negative response will abort the file operation. If the standard input for .B refile is .B not a tty, then .B refile will not ask any questions and will proceed as if the user answered \*(lqyes\*(rq to all questions. .PP The option .B \-link preserves the source folder copy of the message (i.e., it does a .BR ln (1) rather than a .BR mv (1)), whereas, .B \-nolink (the default) deletes the filed messages from the source folder. .PP Normally when a message is refiled, for each destination folder it is assigned the number which is one above the current highest message number in that folder. Use of the .B \-preserv switch will override this message renaming, and try to preserve the number of the message. If a conflict for a particular folder occurs when using the .B \-preserve switch, then .B refile will use the next available message number which is above the message number you wish to preserve. .PP If .B \-link is not specified (or .B \-nolink is specified), the filed messages will be removed from the source folder. The default is to remove these messages by renaming them with a site-dependent prefix (usually a comma). Such files will then need to be removed in some manner after a certain amount of time. Many sites arrange for .B cron to remove these files once a day, so check with your system administrator. .PP Alternately, if you wish for .B refile to really remove the files representing these messages from the source folder, you can use the .B -unlink switch (not to be confused with the .B \-link switch). But messages removed by this method cannot be later recovered. .PP If you prefer a more sophisticated method of `removing' the messages from the source folder, you can define the .B rmmproc profile component. For example, you can add a profile component such as .PP .RS 5 rmmproc: /home/coleman/bin/rmm_msgs .RE .PP then .B refile will instead call the named program or script to handle the message files. .PP The user may specify .B \-rmmproc .I program on the command line to override this profile specification. The .B \-normmproc option forces the message files to be deleted by renaming or unlinking them as described above. .PP The .B \-draft switch tells .B refile to file the /draft. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Folder\-Protect:~^To set mode when creating a new folder ^rmmproc:~^Program to delete the message .fi .SH "SEE ALSO" folder(1), rmf(1), rmm(1) .SH DEFAULTS .nf .RB ` "\-src\ +folder" "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` \-nolink ' .RB ` \-nounlink ' .RB ` \-nopreserve ' .fi .SH CONTEXT If .B \-src .I +folder is given, it will become the current folder. If neither .B \-link nor `all' is specified, the current message in the source folder will be set to the last message specified; otherwise, the current message won't be changed. .PP If the \*(lqPrevious\-Sequence\*(rq profile entry is set, in addition to defining the named sequences from the source folder, .B refile will also define those sequences for the destination folders. See .B mh\-sequence (5) for information concerning the previous sequence. .SH BUGS Since .B refile uses your .I rmmproc to delete the message, the .I rmmproc must .B NOT call .B refile without specifying .BR \-normmproc , or you will create an infinite loop. nmh-1.5/man/repl.man000644 007761 000765 00000031622 11765267273 014330 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH REPL %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME repl \- reply to a message .SH SYNOPSIS .HP 5 .na .B repl .RI [ +folder ] .RI [ msgs ] .RB [ \-annotate " | " \-noannotate ] .RB [ \-group " | " \-nogroup ] .RB [ \-cc all/to/cc/me] .RB [ \-nocc all/to/cc/me] .RB [ \-query " | " \-noquery ] .RB [ \-form .IR formfile ] .RB [ \-format " | " \-noformat ] .RB [ \-filter .IR filterfile ] .RB [ \-inplace " | " \-noinplace ] .RB [ \-mime " | " \-nomime ] .RB [ \-fcc .IR +folder ] .RB [ \-width .IR columns ] .RB [ \-draftfolder .IR +folder ] .RB [ \-draftmessage .IR msg ] .RB [ \-nodraftfolder ] .RB [ \-editor .IR editor ] .RB [ \-noedit ] .RB [ \-whatnowproc .IR program ] .RB [ \-nowhatnowproc ] .RB [ \-atfile ] .RB [ \-noatfile ] .RB [ \-fmtproc .IR program ] .RB [ \-nofmtproc ] .RB [ \-build ] .RB [ \-file .IR msgfile ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Repl may be used to produce a reply to an existing message. .PP In its simplest form (with no arguments), .B repl will set up a message\-form skeleton in reply to the current message in the current folder, and invoke the whatnow shell. .PP In order to construct the message draft of the reply, .B repl uses a reply template to guide its actions. A reply template is simply a .B mhl format file (see .BR mh\-format (5) for details). .PP If the switch .B \-nogroup is given (it is on by default), then .B repl will use the standard forms file \*(lqreplcomps\*(rq. This will construct a draft message that is intended to be sent only to the author of the message to which you are replying. If a file named \*(lqreplcomps\*(rq exists in the user's .B nmh directory, it will be used instead of this default forms file. .PP The default reply template \*(lqreplcomps\*(rq will direct .B repl to construct the reply message draft as follows: .PP .RS 5 .nf To: or or cc: and and Fcc: {fcc switch} or +outbox Subject: Re: In\-Reply\-To: References: Comments: In\-Reply\-To or or .ti +3 message dated -------- .fi .RE .PP where field names enclosed in angle brackets (<\ >) indicate the contents of the named field from the message to which the reply is being made. .PP By default, the \*(lqcc:\*(rq field is empty. You may selectively add addresses to this default with the .B \-cc .I type switch. This switch takes an argument ( .IR all / to / cc / me ) which specifies who gets added to the default \*(lqcc:\*(rq list of the reply. You may give this switch multiple times (with different arguments) if you wish to add multiple types of addresses. .PP If the switch .B \-group is given, then .B repl will use the the standard forms file \*(lqreplgroupcomps\*(rq. This will construct a draft message that is intended as a group or followup reply. If a file named \*(lqreplgroupcomps\*(rq exists in the user's nmh directory, it will be used instead of this default forms file. .PP The default group reply template \*(lqreplgroupcomps\*(rq will direct .B repl to construct the reply message draft as follows: .PP .RS 5 .nf To: Subject: Re: In\-Reply\-To: Message from of . .ti +\w'In\-Reply\-To: 'u -------- .fi .RE .PP or if the field is not available: .PP .RS 5 .nf To: or or cc: and and Subject: Re: In\-Reply\-To: Message from of . .ti +\w'In\-Reply\-To: 'u -------- .fi .RE .PP By default, the \*(lqcc:\*(rq contains all the addresses shown. You may selectively remove addresses from this default with the .B \-nocc .I type switch. This switch takes an argument ( .IR all / to / cc / me ) which specifies who gets removed from the default \*(lqcc:\*(rq list of the reply. You may give this switch multiple times (with different arguments) if you wish to remove multiple types of addresses. .PP In any case, you may specify an alternate forms file with the switch .B \-form .IR formfile . .PP The .B \-query switch modifies the action of .B \-nocc .I type switch by interactively asking you if each address that normally would be placed in the \*(lqTo:\*(rq and \*(lqcc:\*(rq list should actually be sent a copy. This is useful for special\-purpose replies. Note that the position of the .B \-cc and .B \-nocc switches, like all other switches which take a positive and negative form, is important. .PP Lines beginning with the fields \*(lqTo:\*(rq, \*(lqcc:\*(rq, and \*(rqBcc:\*(rq will be standardized and have duplicate addresses removed. In addition, the .B \-width .I columns switch will guide .BR repl 's formatting of these fields. .PP If the draft already exists, .B repl will ask you as to the disposition of the draft. A reply of .B quit will abort .BR repl , leaving the draft intact; .B replace will replace the existing draft with a blank skeleton; and .B list will display the draft. .PP See .BR comp (1) for a description of the .B \-editor and .B \-noedit switches. Note that while in the editor, the message being replied to is available through a link named \*(lq@\*(rq (assuming the default .IR whatnowproc ). In addition, the actual pathname of the message is stored in the environment variable .BR $editalt , and the pathname of the folder containing the message is stored in the environment variable .BR $mhfolder . The creation of the \*(lq@\*(rq file and associated environment variables can be controlled via the .B \-atfile and .B \-noatfile options. .PP Although .B repl uses a forms file to direct it how to construct the beginning of the draft, it uses a message filter file to direct it as to how the message to which you are replying should be filtered (re\-formatted) in the body of the draft. The filter file for .B repl should be a standard form file for .BR mhl , as .B repl will invoke .B mhl to format the message to which you are replying. .PP The switches .BR \-noformat , .BR \-format , and .B \-filter .I filterfile specify which message filter file to use. .PP If the switch .B \-noformat is given (it is the default), then the message to which you are replying is not included in the body of the draft. .PP If the switch .B \-format is given, then a default message filter file is used. This default message filter should be adequate for most users. This default filter .RI \*(lq mhl.reply \*(rq is: .PP .RS 5 .nf %mhl_reply% .fi .RE .PP which outputs each line of the body of the message prefaced with the \*(lq>\*(rq character and a space. .PP If a file named .RI \*(lq mhl.reply \*(rq exists in the user's .B nmh directory, it will be used instead of this form. You may specify an alternate message filter file with the switch .B \-filter .IR filterfile . .PP Other reply filters are commonly used, such as: .PP .RS 5 .nf : body:nocomponent,compwidth=9,offset=9 .fi .RE .PP which says to output a blank line and then the body of the message being replied\-to, indented by one tab\-stop. Another popular format is: .PP .RS 5 .nf message-id:nocomponent,\|nonewline,\\ formatfield=\*(lqIn message %{text},\ \*(rq from:nocomponent,\|formatfield=\*(lq%(decode(friendly{text})) writes:\*(rq body:component=\*(lq>\*(rq,\|overflowtext=\*(lq>\*(rq,\|overflowoffset=0 .fi .RE .PP This message filter file cites the Message-ID and author of the message being replied\-to, and then outputs each line of the body prefaced with the \*(lq>\*(rq character. .PP You can also use an external format program to format the message body. The format program is specified by the .IR formatproc profile entry, and is enabled by the \*(lqformat\*(rq flag. A message filter using an external format program would look like this: .PP .RS 5 .nf body:component=\*(lq>\*(rq,\|nowrap,\|format .fi .RE .PP See the .BR mhl(1) documentation for more information. The format program can be changed by the .B \-fmtproc .I program and .B \-nofmtproc switches. .PP To use the MIME rules for encapsulation, specify the .B \-mime switch. This directs .B repl to generate an .B mhbuild composition file. Note that .B nmh will not invoke .B mhbuild automatically, unless you add this line to your .I \&.mh\(ruprofile file: .PP .RS 5 automimeproc: 1 .RE .PP Otherwise, you must specifically give the command .PP .RS 5 What now? mime .RE .PP prior to sending the draft. .PP If the .B \-annotate switch is given, the message being replied\-to will be annotated with the lines .PP .RS 5 Replied:\ date Replied:\ addrs .RE .PP where the address list contains one line for each addressee. The annotation will be done only if the message is sent directly from .BR repl . If the message is not sent immediately from .BR repl , .RB \*(lq "comp\ \-use" \*(rq may be used to re\-edit and send the constructed message, but the annotations won't take place. Normally annotations are done inplace in order to preserve any links to the message. You may use the .B \-noinplace switch to change this. .PP Although the default template specifies that a copy of the reply will be put in the folder 'outbox', if the .B \-fcc .I +folder switch is given it will override the default value. More than one folder, each preceded by .B \-fcc can be named. .PP In addition to the standard .BR mh\-format (5) escapes, .B repl also recognizes the following additional .I component escape: .PP .RS 5 .nf .ta \w'Escape 'u +\w'Returns 'u .I "Escape Returns Description" fcc string Any folders specified with `\-fcc\ folder' .fi .RE .PP To avoid reiteration, .B repl strips any leading `Re: ' strings from the .I subject component. .PP The .B \-draftfolder .I +folder and .B \-draftmessage .I msg switches invoke the .B nmh draft folder facility. This is an advanced (and highly useful) feature. Consult the .BR mh-draft (5) man page for more information. .PP Upon exiting from the editor, .B repl will invoke the .B whatnow program. See .BR whatnow (1) for a discussion of available options. The invocation of this program can be inhibited by using the .B \-nowhatnowproc switch. (In truth of fact, it is the .B whatnow program which starts the initial edit. Hence, .B \-nowhatnowproc will prevent any edit from occurring.) .PP The .B \-build switch is intended to be used by the Emacs mh-e interface to .BR nmh . It implies .BR \-nowhatnowproc . It causes a file .I /reply to be created, containing the draft message that would normally be presented to the user for editing. No mail is actually sent. .PP The .B \-file .I msgfile switch specifies the message to be replied to as an exact filename rather than as an .B nmh folder and message number. It is intended to be used by the .B msh interface to .BR nmh . The same caveats apply to this option as to the .B \-build switch. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/replcomps~^The standard reply template ^or /replcomps~^Rather than the standard template ^%etcdir%/replgroupcomps~^The standard `reply -group' template ^or /replgroupcomps~^Rather than the standard template ^%etcdir%/mhl.reply~^The standard message filter ^or /mhl.reply~^Rather than the standard filter ^$HOME/\&.mh\(ruprofile~^The user profile ^/draft~^The draft file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Alternate\-Mailboxes:~^To determine the user's mailboxes ^Current\-Folder:~^To find the default current folder ^Draft\-Folder:~^To find the default draft\-folder ^Editor:~^To override the default editor ^Msg\-Protect:~^To set mode when creating a new message (draft) ^fileproc:~^Program to refile the message ^mhlproc:~^Program to filter message being replied\-to ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions .fi .SH "SEE ALSO" mhbuild(1), comp(1), forw(1), send(1), whatnow(1), mh\-format(5) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msg "' defaults to cur" .RB ` \-nogroup ' .RB ` "\-nocc\ all" "' with `\-nogroup', `\-cc\ all' with `\-group'" .RB ` \-noannotate ' .RB ` \-nodraftfolder ' .RB ` \-noformat ' .RB ` \-inplace ' .RB ` \-nomime ' .RB ` \-noquery ' .RB ` \-atfile ' .RB ` "\-width\ 72" ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The message replied\-to will become the current message. .SH BUGS If any addresses occur in the reply template, addresses in the template that do not contain hosts are defaulted incorrectly. Instead of using the localhost for the default, .B repl uses the sender's host. Moral of the story: if you're going to include addresses in a reply template, include the host portion of the address. .PP The .B \-width .I columns switch is only used to do address-folding; other headers are not line\-wrapped. .PP If .I whatnowproc is .BR whatnow , then .B repl uses a built\-in .BR whatnow , it does not actually run the .B whatnow program. Hence, if you define your own .IR whatnowproc , don't call it .B whatnow since .B repl won't run it. .PP If your current working directory is not writable, the link named \*(lq@\*(rq is not available. nmh-1.5/man/rmf.man000644 007761 000765 00000004736 11713401273 014137 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH RMF %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME rmf \- remove an nmh folder .SH SYNOPSIS .HP 5 .na .B rmf .RI [ +folder ] .RB [ \-interactive " | " \-nointeractive ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Rmf removes all of the messages (files) within the specified (or default) folder, and then removes the folder (directory) itself. .PP If there are any files within the folder which are not a part of .BR nmh , they will .B not be removed, and an error will be produced. If the folder is given explicitly or the .B \-nointeractive option is given, then the folder will be removed without confirmation. Otherwise, the user will be asked for confirmation. If .B rmf can't find the current folder, for some reason, the folder to be removed defaults to `+inbox' (unless overridden by user's profile entry \*(lqInbox\*(rq) with confirmation. .PP If the folder being removed is a subfolder, the parent folder will become the new current folder, and .B rmf will produce a message telling the user this has happened. This provides an easy mechanism for selecting a set of messages, operating on the list, then removing the list and returning to the current folder from which the list was extracted. .PP If .B rmf s used on a read\-only folder, it will delete all the (private) sequences (i.e., .RI \*(lqatr\- seq \- folder \*(rq entries) for this folder from your context without affecting the folder itself. .PP .B Rmf irreversibly deletes messages that don't have other links, so use it with caution. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Inbox:~^To find the default inbox .fi .SH "SEE ALSO" rmm(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder, usually with confirmation" .RB ` \-interactive "' if +folder' not given, `\-nointeractive' otherwise" .fi .SH CONTEXT .B Rmf will set the current folder to the parent folder if a subfolder is removed; or if the current folder is removed, it will make \*(lqinbox\*(rq current. Otherwise, it doesn't change the current folder or message. .SH BUGS Although intuitively one would suspect that .B rmf works recursively, it does not. Hence if you have a sub\-folder within a folder, in order to .B rmf the parent, you must first .B rmf each of the children. nmh-1.5/man/rmm.man000644 007761 000765 00000004343 11762736346 014160 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH RMM %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME rmm \- remove messages .SH SYNOPSIS .HP 5 .na .B rmm .RI [ +folder ] .RI [ msgs ] .RB [ \-unlink " | " \-nounlink ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION By default, .B rmm will remove the specified messages by renaming each of the message files with a site-dependent prefix (usually a comma). Such files will then need to be removed in some manner after a certain amount of time. Many sites arrange for .B cron to remove these files once a day, so check with your system administrator. .PP Alternately, if you wish for .B rmm to really remove the files representing these messages, you can use the .B \-unlink switch. But messages removed by this method cannot be later recovered. .PP If you prefer a more sophisticated method of `removing' messages, you can define the .I rmmproc profile component. For example, you can add a profile component such as .PP .RS 5 rmmproc: /home/foouser/bin/rmm_msgs .RE .PP then instead of simply renaming the message file, .B rmm will call the named program or script to handle the files that represent the messages to be deleted. .PP Some users of .B csh prefer the following: .PP .RS 5 alias rmm 'refile +d' .RE .PP where folder `+d' is a folder for deleted messages, and .PP .RS 5 alias mexp 'rm `mhpath +d all`' .RE .PP is used to \*(lqexpunge\*(rq deleted messages. .PP The current message is not changed by .BR rmm , so a .B next will advance to the next message in the folder as expected. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^rmmproc:~^Program to delete the message .fi .SH "SEE ALSO" refile(1), rmf(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` -nounlink ' .fi .SH CONTEXT If a folder is given, it will become the current folder. .SH BUGS Since .B refile uses your .I rmmproc to delete the message, the .I rmmproc must .B NOT call .B refile without specifying .BR \-normmproc , or you will create an infinte loop. nmh-1.5/man/scan.man000644 007761 000765 00000014041 11762736346 014305 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH SCAN %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME scan \- produce a one line per message scan listing .SH SYNOPSIS .HP 5 .na .B scan .RI [ +folder ] .RI [ msgs ] .RB [ \-clear " | " \-noclear ] .RB [ \-form .IR formatfile ] .RB [ \-format .IR string ] .RB [ \-header " | " \-noheader ] .RB [ \-width .IR columns ] .RB [ \-reverse " | " \-noreverse ] .RB [ \-file .IR filename ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Scan produces a one\-line\-per\-message listing of the specified folder or messages. Each .B scan line contains the message number (name), the date, the \*(lqFrom:\*(rq field, the \*(lqSubject\*(rq field, and, if room allows, some of the body of the message. For example: .PP .RS 5 .nf .ta \w'15+- 'u +\w'07/\|05x 'u +\w'Dcrocker 'u 15+ 10/\|05 crocker nned\0\0<>\*(rq if the body is sufficiently short. .B Scan actually reads each of the specified messages and parses them to extract the desired fields. During parsing, appropriate error messages will be produced if there are format errors in any of the messages. .PP By default, .B scan will decode RFC-2047 (MIME) encoding in these scan listings. .B Scan will only decode these fields if your terminal can natively display the character set used in the encoding. You should set the MM_CHARSET environment variable to your native character set, if it is not US-ASCII. See the mh-profile(5) man page for details about this environment variable. .PP The switch .BR \-reverse , makes .B scan list the messages in reverse order. .PP The .B \-file .I filename switch allows the user to obtain a .B scan listing of a maildrop file as produced by .BR packf . This listing includes every message in the file (you can't scan individual messages). The switch .B \-reverse is ignored with this option. .PP The switch .B \-width .I columns may be used to specify the width of the scan line. The default is to use the width of the terminal. .PP The .B \-header switch produces a header line prior to the .B scan listing. Currently, the name of the folder and the current date and time are output (see the .B HISTORY section for more information). .PP If the .B \-clear switch is used and .BR scan 's output is directed to a terminal, then .B scan will consult the environment variables .B $TERM and .B $TERMCAP to determine your terminal type in order to find out how to clear the screen prior to exiting. If the .B \-clear switch is used and .BR scan 's output is not directed to a terminal (e.g., a pipe or a file), then .B scan will send a formfeed prior to exiting. .PP For example, the command: .PP .RS 5 (scan \-clear \-header; show all \-show pr \-f) | lpr .RE .PP produces a scan listing of the current folder, followed by a formfeed, followed by a formatted listing of all messages in the folder, one per page. Omitting .RB \*(lq "\-show\ pr\ \-f" \*(rq will cause the messages to be concatenated, separated by a one\-line header and two blank lines. .PP To override the output format used by .BR scan , the .B \-format .I string or .B \-form .I file switches are used. This permits individual fields of the scan listing to be extracted with ease. The string is simply a format string and the file is simply a format file. See .BR mh\-format (5) for the details. .PP In addition to the standard .BR mh\-format (5) escapes, .B scan also recognizes the following additional .I component escapes: .PP .RS 5 .nf .ta \w'Dtimenow 'u +\w'Returns 'u .I "Escape Returns Description" body string the (compressed) first part of the body dtimenow date the current date folder string the name of the current folder .fi .RE .PP If no date header is present in the message, the .I function escapes which operate on .RB { date } will return values for the date of last modification of the message file itself. This feature is handy for scanning a draft folder, as message drafts usually aren't allowed to have dates in them. .PP .B scan will update the .B nmh context prior to starting the listing, so interrupting a long .B scan listing preserves the new context. .B nmh purists hate this idea. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Alternate\-Mailboxes:~^To determine the user's mailboxes ^Current\-Folder:~^To find the default current folder .fi .SH "SEE ALSO" inc(1), pick(1), show(1), mh\-format(5) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to all" .RB ` \-format "' defaulted as described above" .RB ` \-noheader ' .RB ` \-width "' defaulted to the width of the terminal" .fi .SH CONTEXT If a folder is given, it will become the current folder. .SH HISTORY Prior to using the format string mechanism, .B \-header used to generate a heading saying what each column in the listing was. Format strings prevent this from happening. .SH BUGS The argument to the .B \-format switch must be interpreted as a single token by the shell that invokes .BR scan . Therefore, one must usually place the argument to this switch inside quotes. .PP The value of each .I component escape is set by .B scan to the contents of the first message header .B scan encounters with the corresponding component name; any following headers with the same component name are ignored. nmh-1.5/man/send.man000644 007761 000765 00000031305 11762736346 014314 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH SEND %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME send \- send a message .SH SYNOPSIS .HP 5 .na .B send .RB [ \-alias .IR aliasfile ] .RB [ \-draft ] .RB [ \-draftfolder .IR +folder ] .RB [ \-draftmessage .IR msg ] .RB [ \-nodraftfolder ] .RB [ \-filter .IR filterfile ] .RB [ \-nofilter ] .RB [ \-format " | " \-noformat ] .RB [ \-forward " | " \-noforward ] .RB [ \-mime " | " \-nomime ] .RB [ \-msgid " | " \-nomsgid ] .RB [ \-push " | " \-nopush ] .RB [ \-split .IR seconds ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-watch " | " \-nowatch ] .RB [ \-server .IR servername ] .RB [ \-port .IR port-name/number ] .RB [ \-sasl ] .RB [ \-nosasl ] .RB [ \-saslmaxssf .IR ssf ] .RB [ \-saslmech .IR mechanism ] .RB [ \-snoop ] .RB [ \-user .IR username ] .RB [ \-tls ] .RB [ \-notls ] .RB [ \-width .IR columns ] .RB [ file \&...] .RB [ \-version ] .RB [ \-help ] .RB [ \-attach .IR header-field-name ] .RB [ \-noattach ] .RB [ \-attachformat .IR 0 " | " 1 " | " 2 ] .ad .SH DESCRIPTION .B Send will cause each of the specified files to be delivered to each of the destinations in the \*(lqTo:\*(rq, \*(lqcc:\*(rq, \*(lqBcc:\*(rq, \*(lqDcc:\*(rq, and \*(lqFcc:\*(rq fields of the message. If .B send is re\-distributing a message, as invoked from .BR dist , then the corresponding \*(lqResent\-xxx\*(rq fields are examined instead. .PP By default, .B send uses the program .B post to do the actual delivery of the messages, although this can be changed by defining the .I postproc profile component. Most of the features attributed to .B send are actually performed by .BR post . .PP By default the draft is scanned for a header named .IR Nmh-Attachment . The draft is converted to a MIME message if one or more matches are found. This conversion occurs before all other processing. The header name can be changed with the .B \-attach option. This behavior can be disabled completely with the .B \-noattach option. .PP The first part of the MIME message is the draft body if that body contains any non-blank characters. The body of each header field whose name matches the .I header-field-name is interpreted as a file name, and each file named is included as a separate part in the MIME message. .PP For file names with dot suffixes, the profile is scanned for a .I mhshow-suffix- entry for that suffix. The content-type for the part is taken from that profile entry if a match is found. If a match is not found in the user profile, the mhn.defaults profile is scanned next. If no match is found or the file does not have a dot suffix, the content-type is text/plain if the file contains only ASCII characters or application/octet-stream if it contains characters outside of the ASCII range. See .BR mhshow (1) for more details and example syntax. .PP Each part contains a name attribute that is the last component of the path name. A .I x-unix-mode attribute containing the file mode accompanies each part. Finally, a description attribute is generated by running the .I file command on the file. .PP The .B -attachformat option specifies the MIME header field formats: a value of .B 0 includes the .I x-unix-mode attribute as noted above. A value of .BR 1 , the default, suppresses that, puts the file name in the \*(lqContent-Description\*(rq header, and adds a \*(lqContent-Disposition\*(rq header. A value of .B 2 adds the file .I modification-date parameter to the \*(lqContent-Disposition\*(rq header. You can specify one value in your profile, and override it for individual messages at the .I whatnow prompt. .PP Here are example message part headers, for an attachment, for each of the .B -attachformat values: .PP .nf -attachformat 0: Content-Type: text/plain; name="VERSION"; x-unix-mode="0644"; charset="us-ascii" Content-Description: ASCII text -attachformat 1: Content-Type: text/plain; name="VERSION"; charset="us-ascii" Content-Description: VERSION Content-Disposition: attachment; filename="VERSION" -attachformat 2: Content-Type: text/plain; name="VERSION"; charset="us-ascii" Content-Description: VERSION Content-Disposition: attachment; filename="VERSION"; modification-date="Mon, 19 Dec 2005 22:39:51 -0600" .fi .PP If .B \-push is specified, .B send will detach itself from the user's terminal and perform its actions in the background. If .BR push 'd and the draft can't be sent, then an error message will be sent (using the mailproc) back to the user. If .B \-forward is given, then a copy of the draft will be attached to this failure notice. Using .B \-push differs from putting .B send in the background because the output is trapped and analyzed by .BR nmh . .PP If .B \-verbose is specified, .B send will indicate the interactions occurring with the transport system, prior to actual delivery. If .B \-watch is specified .B send will monitor the delivery of local and network mail. Hence, by specifying both switches, a large detail of information can be gathered about each step of the message's entry into the transport system. .PP The .B \-draftfolder .I +folder and .B \-draftmessage .I msg switches invoke the .B nmh draft folder facility. This is an advanced (and highly useful) feature. Consult the .BR mh-draft (5) man page for more information. .PP If .B \-split is specified, .B send will split the draft into one or more partial messages prior to sending. This makes use of the MIME features in .BR nmh . Note however that if .B send is invoked under .BR dist , then this switch is ignored\0--\0it makes no sense to redistribute a message in this fashion. Sometimes you want .B send to pause after posting a partial message. This is usually the case when you are running .B sendmail and expect to generate a lot of partial messages. The argument to .B \-split tells it how long to pause between postings. .PP .B Send with no .I file argument will query whether the draft is the intended file, whereas .B \-draft will suppress this question. Once the transport system has successfully accepted custody of the message, the file will be renamed with a site-dependent prefix (usually a comma), which allows it to be retrieved until the next draft message is sent. If there are errors in the formatting of the message, .B send will abort with a (hopefully) helpful error message. .PP If a \*(lqBcc:\*(rq field is encountered, its addresses will be used for delivery, and the \*(lqBcc:\*(rq field will be removed from the message sent to sighted recipients. The blind recipients will receive an entirely new message with a minimal set of headers. Included in the body of the message will be a copy of the message sent to the sighted recipients. .PP If a \*(lqDcc:\*(rq field is encountered, its addresses will be used for delivery, and the \*(lqDcc:\*(rq field will be removed from the message. The blind recipients will receive the same message sent to the sighted recipients. *WARNING* Recipients listed in the \*(lqDcc:\*(rq field receive no explicit indication that they have received a \*(lqblind copy\*(rq. This can cause blind recipients to inadvertently reply to all of the sighted recipients of the original message, revealing that they received a blind copy. On the other hand, since a normal reply to a message sent via a \*(lqBcc:\*(rq field will generate a reply only to the sender of the original message, it takes extra effort in most mailers to reply to the included message, and so would usually only be done deliberately, rather than by accident. .PP If .B \-filter .I filterfile is specified, then this copy is filtered (re\-formatted) by .B mhl prior to being sent to the blind recipients. Alternately, if you specify the .B -mime switch, then .B send will use the MIME rules for encapsulation. .PP Prior to sending the message, the \*(lqDate:\ now\*(rq field will be appended to the headers in the message. If .B \-msgid is specified, then a \*(lqMessage\-ID:\*(rq field will also be added to the message. .PP If .B send is re\-distributing a message (when invoked by .BR dist ), then \*(lqResent\-\*(rq will be prepended to each of these fields: \*(lqFrom:\*(rq, \*(lqDate:\*(rq, and \*(lqMessage\-ID:\*(rq. .PP A \*(lqFrom:\*(rq field is required for all outgoing messages. Multiple addresses are permitted in the \*(lqFrom:\*(rq field, but a \*(lqSender:\*(rq field is required in this case. Otherwise a \*(lqSender:\*(rq field is optional. .PP If a message with multiple \*(lqFrom:\*(rq addresses does .B NOT include a \*(lqSender:\*(rq field but does include an \*(lqEnvelope\-From:\*(rq field, the \*(lqEnvelope\-From:\*(rq field will be used to construct a \*(lqSender:\*(rq field. .PP When using SMTP for mail submission, the envelope\-from used for the SMTP transaction is derived from the \*(lqEnvelope\-From:\*(rq field. If no \*(lqEnvelope\-From:\*(rq field is present, the \*(lqSender:\*(rq field is used. If neither the \*(lqEnvelope\-From:\*(rq nor the \*(lqSender:\*(rq field is present, the \*(lqFrom:\*(rq field is used. When \*(lqEnvelope\-From:\*(rq appears in a message it will be removed from the final outgoing message. .PP By using the .B \-format switch, each of the entries in the \*(lqTo:\*(rq and \*(lqcc:\*(rq fields will be replaced with \*(lqstandard\*(rq format entries. This standard format is designed to be usable by all of the message handlers on the various systems around the Internet. If .B \-noformat is given, then headers are output exactly as they appear in the message draft. .PP If an \*(lqFcc:\ folder\*(rq is encountered, the message will be copied to the specified folder for the sender in the format in which it will appear to any non\-Bcc receivers of the message. That is, it will have the appended fields and field reformatting. The \*(lqFcc:\*(rq fields will be removed from all outgoing copies of the message. .PP By using the .B \-width .I columns switch, the user can direct .B send as to how long it should make header lines containing addresses. .PP If nmh is using the SMTP MTA, the .B \-server and the .B \-port switches can be used to override the default mail server (defined by the .I %etcdir%/mts.conf .RI servers entry). The .B \-snoop switch can be used to view the SMTP transaction. (Beware that the SMTP transaction may contain authentication information either in plaintext or easily decoded base64.) .PP If .B nmh has been compiled with SASL support, the .B \-sasl and .B \-nosasl switches will enable and disable the use of SASL authentication with the SMTP MTA. Depending on the SASL mechanism used, this may require an additional password prompt from the user (but the .RI \*(lq \&.netrc \*(rq file can be used to store this password). .B \-saslmech switch can be used to select a particular SASL mechanism, and the the .B \-user switch can be used to select a authorization userid to provide to SASL other than the default. .PP If SASL authentication is successful, .BR nmh will attempt to negotiate a security layer for session encryption. Encrypted data is labelled with `(encrypted)' and `(decrypted)' when viewing the SMTP transaction with the .B \-snoop switch. The .B \-saslmaxssf switch can be used to select the maximum value of the Security Strength Factor. This is an integer value and the exact meaning of this value depends on the underlying SASL mechanism. A value of 0 disables encryption. .PP If .B nmh has been compiled with TLS support, the .B \-tls and .B \-notls switches will require and disable the negotiation of TLS support when connecting to the SMTP MTA. Encrypted data is labelled with `(tls-encrypted)' and `(tls-decrypted)' when viewing the SMTP transction with the .B \-snoop switch. .PP The files specified by the profile entry \*(lqAliasfile:\*(rq and any additional alias files given by the .B \-alias .I aliasfile switch will be read (more than one file, each preceded by .BR \-alias , can be named). See .BR mh\-alias (5) for more information. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Draft\-Folder:~^To find the default draft\-folder ^Aliasfile:~^For a default alias file ^Signature:~^To determine the user's mail signature ^mailproc:~^Program to post failure notices ^postproc:~^Program to post the message .fi .SH "SEE ALSO" comp(1), dist(1), forw(1), repl(1), mh\-alias(5), post(8) .SH DEFAULTS .nf .RB ` file "' defaults to /draft" .RB ` \-alias "' defaults to %etcdir%/MailAliases" .RB ` \-nodraftfolder ' .RB ` \-nofilter ' .RB ` \-format ' .RB ` \-forward ' .RB ` \-nomime ' .RB ` \-nomsgid ' .RB ` \-nopush ' .RB ` \-noverbose ' .RB ` \-nowatch ' .RB ` "\-width\ 72" ' .RB ` "\-attach\ Nmh-Attachment" ' .RB ` "\-attachformat\ 1" ' .fi .SH CONTEXT None .SH BUGS Under some configurations, it is not possible to monitor the mail delivery transaction; .B \-watch is a no-op on those systems. .PP Using .B \-split .I 0 doesn't work correctly. nmh-1.5/man/sendfiles.man000644 007761 000765 00000007413 11762736346 015342 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH SENDFILES %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME sendfiles \- send multiple files via a MIME message .SH SYNOPSIS .HP 5 .na .B sendfiles .RB [ delay ] .I mailpath .I subject .I file1 .RI [ file2 \&...] .ad .SH DESCRIPTION The shell script .BR sendfiles , is used to send a collection of files and directories via electronic mail. .PP .RS 5 sendfiles mailpath \*(lqsubject\*(rq files\0... .RE .PP .B sendfiles will archive the files and directories you name with the .B tar command, and then mail the compressed archive to the \*(lqmailpath\*(rq with the given \*(lqsubject\*(rq. The archive will be automatically split up into as many messages as necessary in order to get past most mailers. .PP Sometimes you want .B sendfiles to pause after posting a partial message. This is usually the case when you are running .B sendmail and expect to generate a lot of partial messages. If the first argument given to .B sendfiles starts with a dash, then it is interpreted as the number of seconds to pause in between postings, e.g., .PP .RS 5 sendfiles -30 mailpath \*(lqsubject\*(rq files\0... .RE .PP will pause 30 seconds in between each posting. .PP .SS "Extracting the Received Files" When these messages are received, invoke .B mhstore once for the list of messages. The default is for .B mhstore to store the combined parts as a new message in the current folder, although this can be changed using storage formatting strings. You can then use .B mhlist to find out what's inside; possibly followed by .B mhstore again to write the archive to a file where you can subsequently uncompress and untar it. For instance: .PP .RS 5 .nf % mhlist 5-8 msg part type/subtype size description 5 message/partial 47K part 1 of 4 6 message/partial 47K part 2 of 4 7 message/partial 47K part 3 of 4 8 message/partial 18K part 4 of 4 % mhstore 5-8 reassembling partials 5,6,7,8 to folder inbox as message 9 % mhlist -verbose 9 msg part type/subtype size description 9 application/octet-stream 118K (extract with uncompress | tar xvpf -) type=tar conversions=compress % mhstore 9 % uncompress < 9.tar.Z | tar xvpf - .fi .RE .PP Alternately, by using the .B \-auto switch, .B mhstore will automatically do the extraction for you: .PP .RS 5 .nf % mhlist 5-8 msg part type/subtype size description 5 message/partial 47K part 1 of 4 6 message/partial 47K part 2 of 4 7 message/partial 47K part 3 of 4 8 message/partial 18K part 4 of 4 % mhstore 5-8 reassembling partials 5,6,7,8 to folder inbox as message 9 % mhlist -verbose 9 msg part type/subtype size description 9 application/octet-stream 118K (extract with uncompress | tar xvpf -) type=tar conversions=compress % mhstore -auto 9 -- tar listing appears here as files are extracted .fi .RE .PP As the second .B tar listing is generated, the files are extracted. A prudent user will never put .B \-auto in the .I \&.mh\(ruprofile file. The correct procedure is to first use .B mhlist to find out what will be extracted. Then .B mhstore can be invoked with .B \-auto to perform the extraction. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder .fi .SH "SEE ALSO" mhbuild(1), mhlist(1), mhshow(1), mhstore(1). .I "Proposed Standard for Message Encapsulation" (RFC\-934) .SH DEFAULTS .nf .RB ` \-noverbose ' .fi .SH CONTEXT None nmh-1.5/man/show.man000644 007761 000765 00000014223 11765267273 014344 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH SHOW %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME show \- show (display) messages .SH SYNOPSIS .HP 5 .na .B show .RI [ +folder ] .RI [ msgs ] .RB [ \-draft ] .RB [\-showproc .IR program ] .RB [ \-showmimeproc .IR program ] .RB [ \-header " | " \-noheader ] .RB [ \-checkmime " | " \-nocheckmime ] [switches\ for .I showproc or .IR showmimeproc ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Show lists each of the specified messages to the standard output (typically, the terminal). .PP By default, text (non-MIME) messages are filtered and displayed by the .B nmh command .BR mhl . This command will display text messages in a nice, uniform format. It also allows you to configure the format of the displayed messages and which headers fields are shown. See the .BR mhl (1) manual page for the details about this command. This default can be changed by defining the .I showproc profile component. Any switches not recognized by .B show are passed along to that program. To override the default and the .I showproc profile component, use the .B \-showproc .I program switch. For example, .B \-showproc .I more will cause the .B more program to list the messages with no reformatting. Normally, this program is specified as the .I showproc in the user's .IR \&.mh\(ruprofile , rather than using a command line switch. .PP By default, non-text messages (MIME messages with multi-media contents) are processed and displayed by the .B nmh command .BR mhshow . See the .BR mhshow (1) manual page for details about this command. This default can changed by defining the .I showmimeproc profile component. Any switches not recognized by .B show are passed along to that program. To override this default and the .B showmimeproc profile component, use the .B \-showmimeproc .I program switch. .PP Note that in some cases, .B show may invoke the .I showmimeproc even for textual contents. This will happen for text messages that specify a transfer encoding (such as MIME quoted-printable or base64) or specify a character set that .B show doesn't believe can be displayed natively. The environment variable .B $MM_CHARSET should be set to the terminal's native character set to avoid gratuitous invocations of the .IR showmimeproc . See the .BR mh-profile (5) man page for details about this environment variable. .PP The option .B \-checkmime (set by default) instructs .B show to test if any of the messages to be displayed are non-text (MIME) messages. If any are non-text, they are displayed by the program .IR showmimeproc , else they are displayed by the program .IR showproc . The option .B \-nocheckmime disables this test and instructs .B show to use .IR showproc , regardless of whether any of the messages are non-text (MIME) messages. .P The .B \-noshowproc switch will disable any formatting or paging of messages. It is equivalent to .B \-nocheckmime .B \-showproc .IR cat . It is still accepted, but should be considered (somewhat) obsolete. .PP If the environment variable .B $NOMHNPROC is set, the test for non-text (MIME) messages will be disabled. This method is obsolete. Use the .B \-nocheckmime switch instead. .PP The .B \-header switch tells .B show to display a one\-line description of the message being shown. This description includes the folder and the message number. .PP If no `msgs' are specified, the current message is used. Although it depends on the specific .I showproc or .IR showmimeproc , in the default setup when more than one message is specified, you will be prompted for a prior to listing each message. Each message will be listed a page at a time, and when the end of page is reached, the program will wait for a or . If a is entered, it will print the next line, whereas will print the next screenful. .PP If the standard output is not a terminal, no queries are made, and each file is listed with a one\-line header and two lines of separation. .PP .RB \*(lq "show \-draft" \*(rq will list the file /draft if it exists. .PP If the profile entry \*(lqUnseen\-Sequence\*(rq is present and non\-empty, then .B show will remove each of the messages shown from each sequence named by the profile entry. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder ^Unseen\-Sequence:~^To name sequences denoting unseen messages ^showproc:~^Program to show text (non-MIME) messages ^showmimeproc:~^Program to show non-text (MIME) messages .fi .SH "SEE ALSO" mhl(1), mhshow(1), more(1), next(1), prev(1), scan(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` \-checkmime ' .RB ` \-header ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The last message selected will become the current message. .SH BUGS The .B \-header switch doesn't work when `msgs' expands to more than one message. If the .I showproc is .BR mhl , then this problem can be circumvented by referencing the \*(lqmessagename\*(rq field in the .B mhl format file. .PP .B Show updates the user's context before showing the message. Hence .B show will mark messages as seen prior to the user actually seeing them. This is generally not a problem, unless the user relies on the \*(lqunseen\*(rq messages mechanism, and interrupts .B show while it is showing \*(lqunseen\*(rq messages. .PP If your .I showproc is .B mhl (the default), then .B show uses a built\-in .BR mhl : it does not actually run the .B mhl program. Hence, if you define your own .B showproc , don't call it .B mhl since .B show won't run it. .PP If your .I showproc is the pager .BR more , then avoid running .B show in the background with only its standard output piped to another process, as in .PP .RS 5 show | imprint & .RE .PP Due to a bug in .BR more , show will go into a \*(lqtty input\*(rq state. To avoid this problem, re\-direct .BR show 's diagnostic output as well. For users of .BR csh : .PP .RS 5 show |& imprint & .RE .PP For users of .BR sh : .PP .RS 5 show 2>&1 | imprint & .RE nmh-1.5/man/slocal.man000644 007761 000765 00000026774 11762736346 014656 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH SLOCAL %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME slocal \- asynchronously filter and deliver new mail .SH SYNOPSIS .HP 5 .na .B %libdir%/slocal [address\ info\ sender] .RB [ \-addr .IR address ] .RB [ \-info .IR data ] .RB [ \-sender .IR sender ] .RB [ \-user .IR username ] .RB [ \-mailbox .IR mbox ] .\" \%[\-home\ homedir] .RB [ \-file .IR file ] .RB [ \-maildelivery .IR deliveryfile ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-suppressdup " | " \-nosuppressdup ] .RB [ \-debug ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Slocal is a program designed to allow you to have your inbound mail processed according to a complex set of selection criteria. You do not normally invoke .B slocal yourself, rather .B slocal is invoked on your behalf by your system's Message Transfer Agent (such as .BR sendmail ) when the message arrives. .PP The message selection criteria used by .B slocal is specified in the file .RI \*(lq \&.maildelivery \*(rq in the user's home directory. You can specify an alternate file with the .B \-maildelivery .I file option. The syntax of this file is specified below. .PP The message delivery address and message sender are determined from the Message Transfer Agent envelope information, if possible. Under .BR sendmail , the sender will obtained from the UUCP \*(lqFrom:\*(rq line, if present. The user may override these values with command line arguments, or arguments to the .B \-addr and .B \-sender switches. .PP The message is normally read from the standard input. The .B \-file switch sets the name of the file from which the message should be read, instead of reading stdin. This is useful when debugging a .RI \*(lq \&.maildelivery \*(rq file. .PP The .B \-user switch tells .B slocal the name of the user for whom it is delivering mail. The .B \-mailbox switch tells .B slocal the name of the user's maildrop file. .PP .B slocal is able to detect and suppress duplicate messages. To enable this, use the option .BR \-suppressdup . .B slocal will keep a database containing the Message-ID's of incoming messages, in order to detect duplicates. Depending on your configuration, this database will be in either ndbm or Berkeley db format. .PP The .B \-info switch may be used to pass an arbitrary argument to sub-processes which .B slocal may invoke on your behalf. .PP The .B \-verbose switch causes .B slocal to give information on stdout about its progress. The .B \-debug switch produces more verbose debugging output on stderr. These flags are useful when creating and debugging your .RI \*(lq \&.maildelivery \*(rq file, as they allow you to see the decisions and actions that .B slocal is taking, as well as check for syntax errors in your .RI \*(lq \&.maildelivery \*(rq file. .SS "Message Transfer Agents" Most modern MTAs including .BR sendmail , .BR postfix and .BR exim support a \&.forward file for directing incoming mail. You should include the line .PP .ce \*(lq|\ %libdir%/slocal\ \-user\ username\*(rq .PP in your \&.forward file in your home directory. This will cause your MTA to invoke .B slocal on your behalf when a message arrives. .SS "The Maildelivery File" The .RI \*(lq \&.maildelivery \*(rq file controls how .B slocal filters and delivers incoming mail. Each line of this file consists of five fields, separated by white-space or comma. Since double-quotes are honored, these characters may be included in a single argument by enclosing the entire argument in double-quotes. A double-quote can be included by preceding it with a backslash. Lines beginning with `#' and blank lines are ignored. .PP The format of each line in the .RI \*(lq \&.maildelivery \*(rq file is: .PP .RS 5 .B "header pattern action result string" .RE .PP .BR header : .RS 5 The name of a header field (such as To, Cc, or From) that is to be searched for a pattern. This is any field in the headers of the message that might be present. .PP The following special fields are also defined: .TP \w'defaultrrr'u .I source the out-of-band sender information .TP \w'defaultrrr'u .I addr the address that was used to cause delivery to the recipient .TP \w'defaultrrr'u .I default this matches .B only if the message hasn't been delivered yet .TP \w'defaultrrr'u .I * this always matches .RE .PP .BR pattern : .RS 5 The sequence of characters to match in the specified header field. Matching is case-insensitive, but does not use regular expressions. .RE .PP .BR action : .RS 5 The action to take to deliver the message. When a message is delivered, a \*(lqDelivery\-Date:\ date\*(rq header is added which indicates the date and time that message was delivered. .TP 4 .I destroy This action always succeeds. .TP 4 .IR file ", " mbox ", or " > Append the message to the file named by .IR string . The message is appended to the file in mbox (uucp) format. This is the format used by most other mail clients (such as mailx, elm). If the message can be appended to the file, then this action succeeds. .TP 4 .I mmdf Identical to .IR file , but always appends the message using the MMDF mailbox format. .TP 4 .IR pipe " or " | Pipe the message as the standard input to the command named by .IR string , using the Bourne shell .B sh to interpret the string. Prior to giving the string to the shell, it is expanded with the following built-in variables: .RS .TP \w'zzreplyztozaaa'u $(sender) the out-of-band sender information .TP \w'zzreplyztozaaa'u $(address) the address that was used to cause delivery to the recipient .TP \w'zzreplyztozaaa'u $(size) the size of the message in bytes .TP \w'zzreplyztozaaa'u $(reply\-to) either the \*(lqReply\-To:\*(rq or \*(lqFrom:\*(rq field of the message .TP \w'zzreplyztozaaa'u $(info) the out-of-band information specified .RE .TP 4 .IR qpipe " or " ^ Similar to .IR pipe , but executes the command directly, after built-in variable expansion, without assistance from the shell. This action can be used to avoid quoting special characters which your shell might interpret. .TP 4 .IR folder " or " + Store the message in the .B nmh folder named by .IR string . Currently this is handled by piping the message to the .B nmh program .BR rcvstore , although this may change in the future. .RE .PP .BR result : .RS 5 Indicates how the action should be performed: .TP \w'Azzz'u .I A Perform the action. If the action succeeds, then the message is considered delivered. .TP \w'Azzz'u .I R Perform the action. Regardless of the outcome of the action, the message is not considered delivered. .TP \w'Azzz'u .I ? Perform the action only if the message has not been delivered. If the action succeeds, then the message is considered delivered. .TP \w'Azzz'u .I N Perform the action only if the message has not been delivered and the previous action succeeded. If this action succeeds, then the message is considered delivered. .PP The delivery file is always read completely, so that several matches can be made and several actions can be taken. .RE .SS "Security of Delivery Files" In order to prevent security problems, the .RI \*(lq \&.maildelivery \*(rq file must be owned either by the user or by root, and must be writable only by the owner. If this is not the case, the file is not read. .PP If the .RI \*(lq \&.maildelivery \*(rq file cannot be found, or does not perform an action which delivers the message, then .B slocal will check for a global delivery file at .IR %etcdir%/maildelivery . This file is read according to the same rules. This file must be owned by the root and must be writable only by the root. .PP If a global delivery file cannot be found or does not perform an action which delivers the message, then standard delivery to the user's maildrop is performed. .SS "Example Delivery File" To summarize, here's an example delivery file: .PP .nf .ta \w'default 'u +\w'mh-workersxx 'uC +\w'destroy 'uC +\w'result 'u # # .maildelivery file for nmh's slocal # # Blank lines and lines beginning with a '#' are ignored # # FIELD PATTERN ACTION RESULT STRING # # File mail with foobar in the \*(lqTo:\*(rq line into file foobar.log To foobar file A foobar.log # Pipe messages from coleman to the program message-archive From coleman pipe A /bin/message-archive # Anything to the \*(lqnmh-workers\*(rq mailing list is put in # its own folder, if not filed already To nmh-workers folder ? nmh-workers # Anything with Unix in the subject is put into # the file unix-mail Subject unix file A unix-mail # I don't want to read mail from Steve, so destroy it From steve destroy A \- # Put anything not matched yet into mailbox default \- file ? mailbox # always run rcvtty * \- pipe R %libdir%/rcvtty .fi .SS "Sub-process environment" When a process is invoked, its environment is: the user/group-ids are set to recipient's ids; the working directory is the recipient's home directory; the umask is 0077; the process has no /dev/tty; the standard input is set to the message; the standard output and diagnostic output are set to /dev/null; all other file-descriptors are closed; the environment variables .BR $USER , .BR $HOME , .B $SHELL are set appropriately, and no other environment variables exist. .PP The process is given a certain amount of time to execute. If the process does not exit within this limit, the process will be terminated with extreme prejudice. The amount of time is calculated as ((size / 60) + 300) seconds, where size is the number of bytes in the message (with 30 minutes the maximum time allowed). .PP The exit status of the process is consulted in determining the success of the action. An exit status of zero means that the action succeeded. Any other exit status (or abnormal termination) means that the action failed. .PP In order to avoid any time limitations, you might implement a process that began by .BR fork ()-ing. The parent would return the appropriate value immediately, and the child could continue on, doing whatever it wanted for as long as it wanted. This approach is somewhat risky if the parent is going to return an exit status of zero. If the parent is going to return a non-zero exit status, then this approach can lead to quicker delivery into your maildrop. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^%etcdir%/mts.conf~^nmh mts configuration file ^$HOME/\&.maildelivery~^The file controlling local delivery ^%etcdir%/maildelivery~^Rather than the standard file ^%mailspool%/$USER~^The default maildrop .fi .SH "SEE ALSO" rcvdist(1), rcvpack(1), rcvstore(1), rcvtty(1), mh\-format(5) .SH DEFAULTS .nf .RB ` \-noverbose ' .RB ` \-nosuppressdup ' .RB ` \-maildelivery "' defaults to $HOME/\&.maildelivery" .RB ` \-mailbox "' deaults to %mailspool%/$USER" .RB ` \-file "' defaults to stdin" .RB ` \-user "' defaults to the current user" .fi .SH CONTEXT None .SH HISTORY .B Slocal was originally designed to be backward-compatible with the .B maildelivery facility provided by .BR MMDF-II . Thus, the .RI \*(lq \&.maildelivery \*(rq file syntax is somewhat limited. But .B slocal has been modified and extended, so that is it no longer compatible with .BR MMDF-II . .PP In addition to an exit status of zero, the .B MMDF values .B RP_MOK (32) and .B RP_OK (9) mean that the message has been fully delivered. Any other non-zero exit status, including abnormal termination, is interpreted as the .B MMDF value .B RP_MECH (200), which means \*(lquse an alternate route\*(rq (deliver the message to the maildrop). .SH BUGS Only two return codes are meaningful, others should be. .PP .B Slocal was originally designed to be backwards-compatible with the .B maildelivery functionality provided by .BR MMDF-II . nmh-1.5/man/sortm.man000644 007761 000765 00000006702 11713401274 014513 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH SORTM %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME sortm \- sort messages .SH SYNOPSIS .HP 5 .na .B sortm .RI [ +folder ] .RI [ msgs ] .RB [ \-datefield .IR field ] .RB [ \-textfield .IR field ] .RB [ \-notextfield ] .RB [ \-limit .IR days ] .RB [ \-nolimit ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Sortm sorts the specified messages in the named folder according to the chronological order of the \*(lqDate:\*(rq field of each message. .PP The .B \-verbose switch directs .B sortm to tell the user the general actions that it is taking to place the folder in sorted order. .PP The .B \-datefield .I field switch tells .B sortm the name of the field to use when making the date comparison. If the user has a special field in each message, such as \*(lqBB\-Posted:\*(rq or \*(lqDelivery\-Date:\*(rq, then the .B \-datefield switch can be used to direct .B sortm which field to examine. .PP The .B \-textfield .I field switch causes .B sortm to sort messages by the specified text field. If this field is \*(lqsubject\*(rq, any leading "re:" is stripped off. In any case, all characters except letters and numbers are stripped and the resulting strings are sorted datefield\-major, textfield\-minor, using a case insensitive comparison. .PP With .B \-textfield .IR field , if .B \-limit .I days is specified, messages with similar textfields that are dated within `days' of each other appear together. Specifying .B \-nolimit makes the limit infinity. With .B \-limit .IR 0 , the sort is instead made textfield\-major, date\-minor. .PP For example, to order a folder by date-major, subject-minor, use: .PP .RS 5 sortm -textfield subject +folder .RE .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Current\-Folder:~^To find the default current folder .fi .SH "SEE ALSO" folder(1) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .RB ` msgs"' defaults to all" .RB ` \-datefield "' defaults to date" .RB ` \-notextfield ' .RB ` \-noverbose ' .RB ` \-nolimit ' .fi .SH CONTEXT If a folder is given, it will become the current folder. If the current message is moved, .B sortm will preserve its status as current. .SH HISTORY Timezones used to be ignored when comparing dates: they aren't any more. .PP Messages which were in the folder, but not specified by `msgs', used to be moved to the end of the folder; now such messages are left untouched. .PP .B Sortm sometimes did not preserve the message numbering in a folder (e.g., messages 1, 3, and 5, might have been renumbered to 1, 2, 3 after sorting). This was a bug, and has been fixed. To compress the message numbering in a folder, use .RB \*(lq "folder\ \-pack" \*(rq as always. .SH BUGS If .B sortm encounters a message without a date\-field, or if the message has a date\-field that .B sortm cannot parse, then .B sortm attempts to keep the message in the same relative position. This does not always work. For instance, if the first message encountered lacks a date which can be parsed, then it will usually be placed at the end of the messages being sorted. .PP When .B sortm complains about a message which it can't temporally order, it complains about the message number .B prior to sorting. It should indicate what the message number will be .B after sorting. nmh-1.5/man/unseen.man000644 007761 000765 00000000017 11713401274 014635 0ustar00kenhkenh000000 000000 .so man1/new.1 nmh-1.5/man/whatnow.man000644 007761 000765 00000014105 11762736346 015051 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH WHATNOW %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME whatnow \- prompting front-end for sending messages .SH SYNOPSIS .HP 5 .na .B whatnow .RB [ \-draftfolder .IR +folder ] .RB [ \-draftmessage .IR msg ] .RB [ \-nodraftfolder ] .RB [ \-editor .IR editor ] .RB [ \-noedit ] .RB [ \-prompt .IR string ] .RI [ file ] .RB [ \-version ] .RB [ \-help ] .RB [ \-attach .IR header-field-name ] .RB [ \-noattach ] .ad .SH DESCRIPTION .B Whatnow is the default program that queries the user about the disposition of a composed draft. It is normally automatically invoked by one of the .B nmh commands .BR comp , .BR dist , .BR forw , or .B repl after the initial edit. .PP When started, the editor is started on the draft (unless .B \-noedit is given, in which case the initial edit is suppressed). Then, .B whatnow repetitively prompts the user with \*(lqWhat now?\*(rq and awaits a response. The valid responses are: .PP .RS 5 .TP \w'refilezzzzfolderz'u .B edit re\-edit using the same editor that was used on the preceding round unless a profile entry \*(lq\-next: \*(rq names an alternate editor .TP \w'refilezzzzfolderz'u .B edit invoke for further editing .TP \w'refilezzzzfolderz'u .B refile +folder refile the draft into the given folder .TP \w'refilezzzzfolderz'u .B mime process the draft as MIME composition file using the .I buildmimeproc command .RB ( mhbuild by default) .TP \w'refilezzzzfolderz'u .B display list the message being distributed/replied\-to on the terminal .TP \w'refilezzzzfolderz'u .B list list the draft on the terminal .TP \w'refilezzzzfolderz'u .B send send the message .TP \w'refilezzzzfolderz'u .B send \-watch send the message and monitor the delivery process .TP \w'refilezzzzfolderz'u .B push send the message in the background .TP \w'refilezzzzfolderz'u .B whom list the addresses that the message will go to .TP \w'refilezzzzfolderz'u .B whom \-check list the addresses and verify that they are acceptable to the transport service .TP \w'refilezzzzfolderz'u .B quit preserve the draft and exit .TP \w'refilezzzzfolderz'u .B quit \-delete delete the draft and exit .TP \w'refilezzzzfolderz'u .B delete delete the draft and exit .TP \w'refilezzzzfolderz'u .B cd directory use the directory when interpreting attachment file names .TP \w'refilezzzzfolderz'u .B pwd print the working directory for attachment files .TP \w'refilezzzzfolderz'u .B ls [ls-options] list files in the attachment working directory using the ls command .TP \w'refilezzzzfolderz'u .B attach files add the named files to the draft as MIME attachments .TP \w'refilezzzzfolderz'u .B alist [-ln] list the MIME attachments, either short, long [-l] or numbered [-n] .TP \w'refilezzzzfolderz'u .B detach [-n] files-or-numbers remove MIME attachments, either by file name or by number with -n .RE .PP When entering your response, you need only type enough characters to uniquely identify the response. .PP For the .B edit response, any valid switch to the editor is valid. .PP For the .B send and .B push responses, any valid switch to .BR send (1) is valid (as .B push merely invokes .B send with the .B \-push option). .PP For the .B whom response, any valid switch to .BR whom (1) is valid. .PP For the .B refile response, any valid switch to the .I fileproc is valid. .PP For the .B display and .B list responses, any valid argument to the .I lproc is valid. If any non\-switch arguments are present, then the pathname of the draft will be excluded from the argument list given to the .I lproc (this is useful for listing another .B nmh message). .PP See .BR mh\-profile (5) for further information about how editors are used by .BR nmh . It also discusses how environment variables can be used to direct .BR whatnow 's actions in complex ways. .PP The .B \-prompt .I string switch sets the prompting string for .BR whatnow . .PP The .B \-draftfolder .I +folder and .B \-draftmessage .I msg switches invoke the .B nmh draft folder facility. This is an advanced (and highly useful) feature. Consult the .BR mh-draft (5) man page for more information. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile ^/draft~^The draft file .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Draft\-Folder:~^To find the default draft\-folder ^Editor:~^To override the default editor ^\-next:~^To name an editor to be used after exit ^~^from ^automimeproc:~^If value is 1, and the draft is a MIME ^~^composition file, then automatically call ^~^buildmimeproc prior to sending. ^buildmimeproc:~^Program to translate MIME composition files ^fileproc:~^Program to refile the message ^lproc:~^Program to list the contents of a message ^sendproc:~^Program to use to send the message ^whomproc:~^Program to determine who a message would go to .fi .SH "SEE ALSO" send(1), whom(1) .SH DEFAULTS .nf .RB ` \-prompt "' defaults to \*(lqWhat\ Now?\ \*(rq" .RB ` \-attach "' defaults to \*(lqNmh-Attachment\*(rq" .fi .SH CONTEXT None .SH BUGS The argument to the .B \-prompt switch must be interpreted as a single token by the shell that invokes .BR whatnow . Therefore, one must usually place the argument to this switch inside quotes. .PP If the initial edit fails, .B whatnow deletes your draft (by renaming it with a site-dependent prefix (usually a comma); failure of a later edit preserves the draft. .PP If the .I buildmimeproc fails (returns a nonzero status), .B whatnow simply prints a \*(lqWhat now?\*(rq prompt. .B whatnow depends on the .I buildmimeproc to tell the user that something went wrong. .PP If .I whatnowproc is .BR whatnow , then .BR comp , .BR dist , .BR forw , and .B repl use a built\-in .BR whatnow , and do not actually run the .B whatnow program. Hence, if you define your own .IR whatnowproc , don't call it .B whatnow since it won't be run. .PP If .I sendproc is .BR send , then .B whatnow uses a built\-in .BR send , it does not actually run the .B send program. Hence, if you define your own .IR sendproc , don't call it .B send since .B whatnow won't run it. nmh-1.5/man/whom.man000644 007761 000765 00000007516 11762736346 014344 0ustar00kenhkenh000000 000000 .\" .\" %nmhwarning% .\" .TH WHOM %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME whom \- report to whom a message would go .SH SYNOPSIS .HP 5 .na .B whom .RB [ \-alias .IR aliasfile ] .RB [ \-check " | " \-nocheck ] .RB [ \-draftfolder .IR +folder ] .RB [ \-draftmessage .IR msg ] .RB [ \-nodraftfolder ] .RB [ \-server .IR servername ] .RB [ \-port .IR port-name/number ] .RB [ \-sasl ] .RB [ \-saslmech .IR mechanism ] .RB [ \-snoop ] .RB [ \-user .IR username ] .RB [ \-tls ] .RB [ \-notls ] .RI [ file ] .RB [ \-draft ] .RB [ \-version ] .RB [ \-help ] .ad .SH DESCRIPTION .B Whom is used to expand the headers of a message into a set of addresses and optionally verify that those addresses are deliverable at that time (if .B \-check is given). .PP The .B \-draftfolder .I +folder and .B \-draftmessage .I msg switches invoke the .B nmh draft folder facility. This is an advanced (and highly useful) feature. Consult the .BR mh-draft (5) man page for more information. .PP If nmh is using the SMTP MTA, the .B \-server and the .B \-port switches can be used to override the default mail server (defined by the .I %etcdir%/mts.conf .RI servers entry). The .B \-snoop switch can be used to view the SMTP transaction. (Beware that the SMTP transaction may contain authentication information either in plaintext or easily decoded base64.) .PP If .B nmh has been compiled with SASL support, the .B \-sasl switch will enable the use of SASL authentication with the SMTP MTA. Depending on the SASL mechanism used, this may require an additional password prompt from the user (but the .RI \*(lq \&.netrc \*(rq file can be used to store this password). .B \-saslmech switch can be used to select a particular SASL mechanism, and the the .B \-user switch can be used to select a authorization userid to provide to SASL other than the default. .PP If SASL authentication is successful, .BR nmh will attempt to negotiate a security layer for session encryption. Encrypted data is labelled with `(encrypted)' and `(decrypted)' when viewing the SMTP transaction with the .B \-snoop switch. The .B \-saslmaxssf switch can be used to select the maximum value of the Security Strength Factor. This is an integer value and the exact meaning of this value depends on the underlying SASL mechanism. A value of 0 disables encryption. .PP If .B nmh has been compiled with TLS support, the .B \-tls and .B \-notls switches will require and disable the negotiation of TLS support when connecting to the SMTP MTA. Encrypted data is labelled with `(tls-encrypted)' and `(tls-decrypted)' when viewing the SMTP transction with the .B \-snoop switch. .PP The files specified by the profile entry \*(lqAliasfile:\*(rq and any additional alias files given by the .B \-alias .I aliasfile switch will be read (more than one file, each preceded by .BR \-alias , can be named). See .BR mh\-alias (5) for more information. .SH FILES .fc ^ ~ .nf .ta \w'%etcdir%/ExtraBigFileName 'u ^$HOME/\&.mh\(ruprofile~^The user profile .fi .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory ^Draft\-Folder:~^To find the default draft\-folder ^Aliasfile:~^For a default alias file ^postproc:~^Program to post the message .fi .SH "SEE ALSO" mh\-alias(5), post(8) .SH DEFAULTS .nf .RB ` file "' defaults to /draft" .RB ` \-nocheck ' .RB ` \-alias "' defaults to %etcdir%/MailAliases" .fi .SH CONTEXT None .SH BUGS With the .B \-check option, .B whom makes no guarantees that the addresses listed as being ok are really deliverable, rather, an address being listed as ok means that at the time that .B whom was run the address was thought to be deliverable by the transport service. For local addresses, this is absolute; for network addresses, it means that the host is known; for uucp addresses, it (often) means that the .B UUCP network is available for use. nmh-1.5/m4/ndbm.m4000644 007761 000765 00000003532 11762736345 013615 0ustar00kenhkenh000000 000000 dnl -------------- dnl CHECK FOR NDBM dnl -------------- dnl dnl NMH_CHECK_DBM(include,library,action-if-found,action-if-not) dnl Check for presence of dbm_open() in the specified library dnl and with the specified include file (if libname is the empty dnl string then don't try to link against any particular library). dnl We set nmh_ndbm_found to 'yes' or 'no'; if found we set dnl nmh_ndbmheader to the first arg and nmh_ndbm to the second. dnl If this macro accepted a list of include,library tuples dnl to test in order that would be cleaner than the current dnl nest of calls in configure.in. dnl We try to link our own code fragment (which includes the dnl headers in the same way slocal.c does) rather than dnl using AC_CHECK_LIB because on later versions of libdb dnl the dbm_open() function is provided via a #define and dnl we don't want to hardcode searching for the internal dnl function that lies behind it. (AC_CHECK_LIB works by dnl defining its own bogus prototype rather than pulling in dnl the right header files.) dnl An oddity (bug) of this macro is that if you haven't dnl done AC_PROG_CC or something that implies it before dnl using this macro autoconf complains about a recursive dnl expansion. AC_DEFUN([NMH_CHECK_NDBM], [ if test "x$2" = "x"; then nmh_libs= AC_MSG_CHECKING([for dbm in $1]) else nmh_libs="-l$2 " AC_MSG_CHECKING([for dbm in $1 and $2]) fi dnl We don't try to cache the result, because that exceeds dnl my autoconf skills -- feel free to put it in :-> -- PMM nmh_saved_libs="$LIBS" LIBS="$nmh_libs $5 $LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #define DB_DBM_HSEARCH 1 #include <$1> ]], [[dbm_open("",0,0);]])],[nmh_ndbm_found=yes],[nmh_ndbm_found=no]) LIBS="$nmh_saved_libs" if test "$nmh_ndbm_found" = "yes"; then AC_MSG_RESULT(yes) nmh_ndbmheader="$1" nmh_ndbm="$2" $3 else AC_MSG_RESULT(no) $4 : fi ])dnl nmh-1.5/m4/netlibs.m4000644 007761 000765 00000000517 11762736345 014335 0ustar00kenhkenh000000 000000 dnl dnl Updated for more modern systems. Check to see if we need to link against dnl optional libraries for networking functions. dnl AC_DEFUN([NMH_CHECK_NETLIBS], [AC_SEARCH_LIBS([gethostbyname], [nsl], , [AC_MSG_ERROR([gethostbyname not found])]) AC_SEARCH_LIBS([connect], [socket], , [AC_MSG_ERROR([connect not found])]) ])dnl nmh-1.5/m4/readline.m4000644 007761 000765 00000001552 11762736345 014460 0ustar00kenhkenh000000 000000 dnl dnl Our readline heuristic. If we haven't been asked about readline, then dnl try to compile with it. If we've been asked for it, then we fail dnl if we cannot use it. If we were explicitly NOT asked for it, then dnl don't even try to use it. dnl AC_DEFUN([NMH_READLINE], [AC_ARG_WITH([readline], AS_HELP_STRING([--with-readline], [enable readline editing for whatnow (default=maybe)]), [], [with_readline=maybe]) AS_IF([test x"$with_readline" = xyes -o x"$with_readline" = xmaybe], [save_LIBS="$LIBS" LIBS= AC_SEARCH_LIBS([readline], [readline editline], [READLINELIB="$LIBS" AC_DEFINE([READLINE_SUPPORT], [1], [Support for using readline() in whatnow])], [AS_IF([test x"$with_readline" = xyes], [AC_MSG_ERROR([Unable to find a readline library])])]) LIBS="$save_LIBS"]) ]) AC_SUBST([READLINELIB]) nmh-1.5/h/addrsbr.h000644 007761 000765 00000001534 11762736345 014134 0ustar00kenhkenh000000 000000 /* * addrsbr.h -- definitions for the address parsing system */ #define AD_HOST 1 /* getm(): lookup official hostname */ #define AD_NHST 0 /* getm(): do not lookup official name */ #define AD_NAME AD_NHST /* AD_HOST is TOO slow */ #define UUCPHOST (-1) #define LOCALHOST 0 #define NETHOST 1 #define BADHOST 2 struct mailname { struct mailname *m_next; char *m_text; char *m_pers; char *m_mbox; char *m_host; char *m_path; int m_type; char m_nohost; char m_bcc; int m_ingrp; char *m_gname; char *m_note; }; #define adrformat(m) auxformat ((m), 1) /* * prototypes */ void mnfree(struct mailname *); int ismymbox(struct mailname *); char *getname(char *); char *getlocaladdr(void); char *auxformat(struct mailname *, int); struct mailname *getm(char *, char *, int, int, char *); nmh-1.5/h/aliasbr.h000644 007761 000765 00000003413 11713401273 014107 0ustar00kenhkenh000000 000000 /* * aliasbr.h -- definitions for the aliasing system * */ extern char *AliasFile; /* mh-alias(5) */ #define PASSWD "/etc/passwd" /* passwd(5) */ #define GROUP "/etc/group" /* group(5) */ #define EVERYONE 200 /* lowest uid for everyone */ struct aka { char *ak_name; /* name to match against */ struct adr *ak_addr; /* list of addresses that it maps to */ struct aka *ak_next; /* next aka in list */ char ak_visible; /* should be visible in headers */ }; struct adr { char *ad_text; /* text of this address in list */ struct adr *ad_next; /* next adr in list */ char ad_local; /* text is local (check for expansion) */ }; /* * incore version of /etc/passwd */ struct home { char *h_name; /* user name */ uid_t h_uid; /* user id */ gid_t h_gid; /* user's group */ char *h_home; /* user's home directory */ char *h_shell; /* user's shell */ int h_ngrps; /* number of groups this user belongs to */ struct home *h_next; /* next home in list */ }; struct home *seek_home (char *); /* * prototypes */ int alias (char *); int akvisible (void); void init_pw (void); char *akresult (struct aka *); char *akvalue (char *); char *akerror (int); /* codes returned by alias() */ #define AK_OK 0 /* file parsed ok */ #define AK_NOFILE 1 /* couldn't read file */ #define AK_ERROR 2 /* error parsing file */ #define AK_LIMIT 3 /* memory limit exceeded */ #define AK_NOGROUP 4 /* no such group */ /* should live here, not in mts.c */ extern int Everyone; extern char *NoShell; nmh-1.5/h/crawl_folders.h000644 007761 000765 00000001177 11713401273 015325 0ustar00kenhkenh000000 000000 /* * crawl_folders.h -- crawl folder hierarchy */ #define CRAWL_NUMFOLDERS 100 /* Callbacks return TRUE crawl_folders should crawl the children of `folder'. * Callbacks need not duplicate folder, as crawl_folders does not free it. */ typedef boolean (crawl_callback_t)(char *folder, void *baton); /* Crawl the folder hierarchy rooted at the relative path `dir'. For each * folder, pass `callback' the folder name (as a path relative to the current * directory) and `baton'; the callback may direct crawl_folders not to crawl * its children; see above. */ void crawl_folders (char *dir, crawl_callback_t *callback, void *baton); nmh-1.5/h/dropsbr.h000644 007761 000765 00000003107 11713401273 014145 0ustar00kenhkenh000000 000000 /* * dropsbr.h -- definitions for maildrop-style files */ /* * A file which is formatted like a maildrop may have a corresponding map * file which is an index to the bounds of each message. The first record * of such an map is special, it contains: * * d_id = number of messages in file * d_size = version number of map * d_start = last message read * d_stop = size of file * * Each record after that contains: * * d_id = BBoard-ID: of message, or similar info * d_size = size of message in ARPA Internet octets (\n == 2 octets) * d_start = starting position of message in file * d_stop = stopping position of message in file * * Note that d_start/d_stop do NOT include the message delimiters, so * programs using the map can simply fseek to d_start and keep reading * until the position is at d_stop. */ /* * various formats for maildrop files */ #define OTHER_FORMAT 0 #define MBOX_FORMAT 1 #define MMDF_FORMAT 2 #define DRVRSN 3 struct drop { int d_id; int d_size; off_t d_start; off_t d_stop; }; /* * prototypes */ int mbx_open (char *, int, uid_t, gid_t, mode_t); int mbx_read (FILE *, long, struct drop **, int); int mbx_write(char *, int, FILE *, int, long, long, off_t, int, int); int mbx_copy (char *, int, int, int, int, char *, int); int mbx_size (int, off_t, off_t); int mbx_close (char *, int); char *map_name (char *); int map_read (char *, long, struct drop **, int); int map_write (char *, int, int, long, off_t, off_t, long, int, int); int map_chk (char *, int, struct drop *, long, int); nmh-1.5/h/fmt_compile.h000644 007761 000765 00000014232 11762736345 015010 0ustar00kenhkenh000000 000000 /* * fmt_compile.h -- format types */ /* types that output text */ #define FT_COMP 1 /* the text of a component */ #define FT_COMPF 2 /* comp text, filled */ #define FT_LIT 3 /* literal text */ #define FT_LITF 4 /* literal text, filled */ #define FT_CHAR 5 /* a single ascii character */ #define FT_NUM 6 /* "value" as decimal number */ #define FT_NUMF 7 /* "value" as filled dec number */ #define FT_STR 8 /* "str" as text */ #define FT_STRF 9 /* "str" as text, filled */ #define FT_STRFW 10 /* "str" as text, filled, width in "value" */ #define FT_STRLIT 11 /* "str" as text, no space compression */ #define FT_PUTADDR 12 /* split and print address line */ /* types that modify the "str" or "value" registers */ #define FT_LS_COMP 13 /* set "str" to component text */ #define FT_LS_LIT 14 /* set "str" to literal text */ #define FT_LS_GETENV 15 /* set "str" to getenv(text) */ #define FT_LS_CFIND 16 /* set "str" to context_find(text) */ #define FT_LS_DECODECOMP 17 /* set "str" to decoded component text */ #define FT_LS_DECODE 18 /* decode "str" as RFC-2047 header */ #define FT_LS_TRIM 19 /* trim trailing white space from "str" */ #define FT_LV_COMP 20 /* set "value" to comp (as dec. num) */ #define FT_LV_COMPFLAG 21 /* set "value" to comp flag word */ #define FT_LV_LIT 22 /* set "value" to literal num */ #define FT_LV_DAT 23 /* set "value" to dat[n] */ #define FT_LV_STRLEN 24 /* set "value" to length of "str" */ #define FT_LV_PLUS_L 25 /* set "value" += literal */ #define FT_LV_MINUS_L 26 /* set "value" -= literal */ #define FT_LV_DIVIDE_L 27 /* set "value" to value / literal */ #define FT_LV_MODULO_L 28 /* set "value" to value % literal */ #define FT_LV_CHAR_LEFT 29 /* set "value" to char left in output */ #define FT_LS_MONTH 30 /* set "str" to tws month */ #define FT_LS_LMONTH 31 /* set "str" to long tws month */ #define FT_LS_ZONE 32 /* set "str" to tws timezone */ #define FT_LS_DAY 33 /* set "str" to tws weekday */ #define FT_LS_WEEKDAY 34 /* set "str" to long tws weekday */ #define FT_LS_822DATE 35 /* set "str" to 822 date str */ #define FT_LS_PRETTY 36 /* set "str" to pretty (?) date str */ #define FT_LV_SEC 37 /* set "value" to tws second */ #define FT_LV_MIN 38 /* set "value" to tws minute */ #define FT_LV_HOUR 39 /* set "value" to tws hour */ #define FT_LV_MDAY 40 /* set "value" to tws day of month */ #define FT_LV_MON 41 /* set "value" to tws month */ #define FT_LV_YEAR 42 /* set "value" to tws year */ #define FT_LV_YDAY 43 /* set "value" to tws day of year */ #define FT_LV_WDAY 44 /* set "value" to tws weekday */ #define FT_LV_ZONE 45 /* set "value" to tws timezone */ #define FT_LV_CLOCK 46 /* set "value" to tws clock */ #define FT_LV_RCLOCK 47 /* set "value" to now - tws clock */ #define FT_LV_DAYF 48 /* set "value" to tws day flag */ #define FT_LV_DST 49 /* set "value" to tws daylight savings flag */ #define FT_LV_ZONEF 50 /* set "value" to tws timezone flag */ #define FT_LS_PERS 51 /* set "str" to person part of addr */ #define FT_LS_MBOX 52 /* set "str" to mbox part of addr */ #define FT_LS_HOST 53 /* set "str" to host part of addr */ #define FT_LS_PATH 54 /* set "str" to route part of addr */ #define FT_LS_GNAME 55 /* set "str" to group part of addr */ #define FT_LS_NOTE 56 /* set "str" to comment part of addr */ #define FT_LS_ADDR 57 /* set "str" to mbox@host */ #define FT_LS_822ADDR 58 /* set "str" to 822 format addr */ #define FT_LS_FRIENDLY 59 /* set "str" to "friendly" format addr */ #define FT_LV_HOSTTYPE 60 /* set "value" to addr host type */ #define FT_LV_INGRPF 61 /* set "value" to addr in-group flag */ #define FT_LS_UNQUOTE 62 /* remove RFC 2822 quotes from "str" */ #define FT_LV_NOHOSTF 63 /* set "value" to addr no-host flag */ /* Date Coercion */ #define FT_LOCALDATE 64 /* Coerce date to local timezone */ #define FT_GMTDATE 65 /* Coerce date to gmt */ /* pre-format processing */ #define FT_PARSEDATE 66 /* parse comp into a date (tws) struct */ #define FT_PARSEADDR 67 /* parse comp into a mailaddr struct */ #define FT_FORMATADDR 68 /* let external routine format addr */ #define FT_CONCATADDR 69 /* formataddr w/out duplicate removal */ #define FT_MYMBOX 70 /* do "mymbox" test on comp */ /* misc. */ /* ADDTOSEQ only works if you include "options LBL" */ #define FT_ADDTOSEQ 71 /* add current msg to a sequence */ /* conditionals & control flow (must be last) */ #define FT_SAVESTR 72 /* save current str reg */ #define FT_DONE 73 /* stop formatting */ #define FT_PAUSE 74 /* pause */ #define FT_NOP 75 /* nop */ #define FT_GOTO 76 /* (relative) goto */ #define FT_IF_S_NULL 77 /* test if "str" null */ #define FT_IF_S 78 /* test if "str" non-null */ #define FT_IF_V_EQ 79 /* test if "value" = literal */ #define FT_IF_V_NE 80 /* test if "value" != literal */ #define FT_IF_V_GT 81 /* test if "value" > literal */ #define FT_IF_MATCH 82 /* test if "str" contains literal */ #define FT_IF_AMATCH 83 /* test if "str" starts with literal */ #define FT_S_NULL 84 /* V = 1 if "str" null */ #define FT_S_NONNULL 85 /* V = 1 if "str" non-null */ #define FT_V_EQ 86 /* V = 1 if "value" = literal */ #define FT_V_NE 87 /* V = 1 if "value" != literal */ #define FT_V_GT 88 /* V = 1 if "value" > literal */ #define FT_V_MATCH 89 /* V = 1 if "str" contains literal */ #define FT_V_AMATCH 90 /* V = 1 if "str" starts with literal */ #define IF_FUNCS FT_S_NULL /* start of "if" functions */ nmh-1.5/h/fmt_scan.h000644 007761 000765 00000005477 11762736345 014317 0ustar00kenhkenh000000 000000 /* * fmt_scan.h -- definitions for fmt_scan() */ /* * This structure describes an "interesting" component. It holds * the name & text from the component (if found) and one piece of * auxilary info. The structure for a particular component is located * by (open) hashing the name and using it as an index into the ptr array * "wantcomp". All format entries that reference a particular component * point to its comp struct (so we only have to do component specific * processing once. e.g., parse an address.). */ struct comp { char *c_name; /* component name (in lower case) */ char *c_text; /* component text (if found) */ struct comp *c_next; /* hash chain linkage */ short c_flags; /* misc. flags (from fmt_scan) */ short c_type; /* type info (from fmt_compile) */ union { struct tws *c_u_tws; struct mailname *c_u_mn; } c_un; }; #define c_tws c_un.c_u_tws #define c_mn c_un.c_u_mn /* * c_type bits */ #define CT_ADDR (1<<0) /* referenced as address */ #define CT_DATE (1<<1) /* referenced as date */ /* * c_flags bits */ #define CF_TRUE (1<<0) /* usually means component is present */ #define CF_PARSED (1<<1) /* address/date has been parsed */ #define CF_DATEFAB (1<<2) /* datefield fabricated */ #define CF_TRIMMED (1<<3) /* Component has been trimmed */ extern int fmt_norm; /* * Hash table for deciding if a component is "interesting". */ extern struct comp *wantcomp[128]; /* * Hash function for component name. The function should be * case independent and probably shouldn't involve a routine * call. This function is pretty good but will not work on * single character component names. */ #define CHASH(nm) (((((nm)[0]) - ((nm)[1])) & 0x1f) + (((nm)[2]) & 0x5f)) /* * Find a component in the hash table. */ #define FINDCOMP(comp,name) \ for (comp = wantcomp[CHASH(name)]; \ comp && strcmp(comp->c_name,name); \ comp = comp->c_next) ; /* * This structure defines one formatting instruction. */ struct format { unsigned char f_type; char f_fill; short f_width; /* output field width */ union { struct comp *f_u_comp; /* associated component */ char *f_u_text; /* literal text */ char f_u_char; /* literal character */ int f_u_value; /* literal value */ } f_un; }; #define f_skip f_width /* instr to skip (false "if") */ #define f_comp f_un.f_u_comp #define f_text f_un.f_u_text #define f_char f_un.f_u_char #define f_value f_un.f_u_value /* * prototypes */ struct format *fmt_scan (struct format *, char *, int, int *); char *new_fs (char *, char *, char *); int fmt_compile (char *, struct format **); char *formataddr(char *, char *); char *concataddr(char *, char *); extern char *format_string; nmh-1.5/h/md5.h000644 007761 000765 00000004541 11762736345 013201 0ustar00kenhkenh000000 000000 /* * md5.h -- header file for md5 message digest * taken from RFC-1321/Appendices A.1/A.2 */ /* * RSAREF types and constants */ /* * Use include for nmh/mh */ #include /* * We need this for uint32_t */ #include /* * Use prototypes for nmh/mh */ #define PROTOTYPES 1 /* * PROTOTYPES should be set to one if and only if the compiler * supports function argument prototyping. The following makes * PROTOTYPES default to 0 if it has not already been defined * with C compiler flags. */ #ifndef PROTOTYPES #define PROTOTYPES 0 #endif /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; /* UINT2 defines a two byte word */ typedef unsigned short int UINT2; /* UINT4 defines a four byte word */ typedef uint32_t UINT4; /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it returns an empty list. */ #if PROTOTYPES #define PROTO_LIST(list) list #else #define PROTO_LIST(list) () #endif /* MD5.H - header file for MD5C.C */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* MD5 context. */ typedef struct { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } MD5_CTX; void MD5Init PROTO_LIST ((MD5_CTX *)); void MD5Update PROTO_LIST ((MD5_CTX *, unsigned char *, unsigned int)); void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); nmh-1.5/h/mf.h000644 007761 000765 00000002705 11713401273 013077 0ustar00kenhkenh000000 000000 /* * mf.h -- include file for mailbox filters */ #include #ifndef TRUE # define TRUE 1 #endif #ifndef FALSE # define FALSE 0 #endif #ifndef NOTOK # define NOTOK (-1) #endif #ifndef OK # define OK 0 #endif #ifndef DONE # define DONE 1 #endif #define LINESIZ 512 #define MBXMODE 0600 #define TMPMODE 0600 #define OWIDTH 75 /* length of a header line */ #define HFROM 1 /* header has From: component */ #define HSNDR 2 /* header has Sender: component */ #define HADDR 3 /* header has address component */ #define HDATE 4 /* header has Date: component */ #define HOTHR 5 /* header is unimportant */ struct adrx { char *text; char *pers; char *mbox; char *host; char *path; char *grp; int ingrp; char *note; char *err; }; /* * Codes returned by uucp2mmdf(), mmdf2uucp() */ #define MFOK 0 /* all went well */ /* remaining codes must > DONE */ #define MFPRM 2 /* bad parameter */ #define MFSIO 3 /* stdio package went screwy */ #define MFROM 4 /* from line was bad */ #define MFHDR 5 /* headers were bad */ #define MFTXT 6 /* text was bad */ #define MFERR 7 /* I/O or system error */ #define MFDLM 8 /* Bad delimiter in MMDF file */ /* * prototypes */ int isfrom(char *); int lequal (unsigned char *, unsigned char *); int mfgets (FILE *, char **); char *legal_person (char *); struct adrx *seekadrx (char *); struct adrx *getadrx (char *); struct adrx *uucpadrx (char *); nmh-1.5/h/mh.h000644 007761 000765 00000025775 11765267273 013136 0ustar00kenhkenh000000 000000 /* * mh.h -- main header file for all of nmh */ #include /* * Well-used constants */ #define NOTOK (-1) /* syscall()s return this on error */ #define OK 0 /* ditto on success */ #define DONE 1 /* trinary logic */ #define ALL "" #define Nbby 8 /* number of bits/byte */ #define MAXARGS 1000 /* max arguments to exec */ #define NFOLDERS 1000 /* max folder arguments on command line */ #define DMAXFOLDER 4 /* typical number of digits */ #define MAXFOLDER 1000 /* message increment */ #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif typedef unsigned char boolean; /* not int so we can pack in a structure */ /* If we're using gcc then give it some information about * functions that abort. */ #if __GNUC__ > 2 #define NORETURN __attribute__((__noreturn__)) #define NMH_UNUSED(i) (void) i #else #define NORETURN #define NMH_UNUSED(i) i #endif /* * user context/profile structure */ struct node { char *n_name; /* key */ char *n_field; /* value */ char n_context; /* context, not profile */ struct node *n_next; /* next entry */ }; /* * switches structure */ #define AMBIGSW (-2) /* from smatch() on ambiguous switch */ #define UNKWNSW (-1) /* from smatch() on unknown switch */ struct swit { char *sw; /* The minchars field is apparently used like this: -# : Switch can be abbreviated to # characters; switch hidden in -help. 0 : Switch can't be abbreviated; switch shown in -help. # : Switch can be abbreviated to # characters; switch shown in -help. */ int minchars; }; extern struct swit anoyes[]; /* standard yes/no switches */ #define ATTACHFORMATS 3 /* Number of send attach formats. */ /* * general folder attributes */ #define READONLY (1<<0) /* No write access to folder */ #define SEQMOD (1<<1) /* folder's sequences modifed */ #define ALLOW_NEW (1<<2) /* allow the "new" sequence */ #define OTHERS (1<<3) /* folder has other files */ #define MODIFIED (1<<4) /* msh in-core folder modified */ #define FBITS "\020\01READONLY\02SEQMOD\03ALLOW_NEW\04OTHERS\05MODIFIED" /* * type for holding the sequence set of a message */ typedef unsigned int seqset_t; /* * Determine the number of user defined sequences we * can have. The first 5 sequence flags are for * internal nmh message flags. */ #define NUMATTRS ((sizeof(seqset_t) * Nbby) - 5) /* * first free slot for user defined sequences * and attributes */ #define FFATTRSLOT 5 /* * internal messages attributes (sequences) */ #define EXISTS (1<<0) /* exists */ #define DELETED (1<<1) /* deleted */ #define SELECTED (1<<2) /* selected for use */ #define SELECT_EMPTY (1<<3) /* "new" message */ #define SELECT_UNSEEN (1<<4) /* inc/show "unseen" */ #define MBITS "\020\01EXISTS\02DELETED\03SELECTED\04NEW\05UNSEEN" /* * Primary structure of folder/message information */ struct msgs { int lowmsg; /* Lowest msg number */ int hghmsg; /* Highest msg number */ int nummsg; /* Actual Number of msgs */ int lowsel; /* Lowest selected msg number */ int hghsel; /* Highest selected msg number */ int numsel; /* Number of msgs selected */ int curmsg; /* Number of current msg if any */ int msgflags; /* Folder attributes (READONLY, etc) */ char *foldpath; /* Pathname of folder */ /* * Name of sequences in this folder. We add an * extra slot, so we can NULL terminate the list. */ char *msgattrs[NUMATTRS + 1]; /* * bit flags for whether sequence * is public (0), or private (1) */ seqset_t attrstats; /* * These represent the lowest and highest possible * message numbers we can put in the message status * area, without calling folder_realloc(). */ int lowoff; int hghoff; /* * This is an array of seqset_t which we allocate dynamically. * Each seqset_t is a set of bits flags for a particular message. * These bit flags represent general attributes such as * EXISTS, SELECTED, etc. as well as track if message is * in a particular sequence. */ seqset_t *msgstats; /* msg status */ }; /* * Amount of space to allocate for msgstats. Allocate * the array to have space for messages numbers lo to hi. */ #define MSGSTATSIZE(mp,lo,hi) ((size_t) (((hi) - (lo) + 1) * sizeof(*(mp)->msgstats))) /* * macros for message and sequence manipulation */ #define clear_msg_flags(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] = 0) #define copy_msg_flags(mp,i,j) \ ((mp)->msgstats[(i) - mp->lowoff] = (mp)->msgstats[(j) - mp->lowoff]) #define get_msg_flags(mp,ptr,msgnum) (*(ptr) = (mp)->msgstats[(msgnum) - mp->lowoff]) #define set_msg_flags(mp,ptr,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] = *(ptr)) #define does_exist(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] & EXISTS) #define unset_exists(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] &= ~EXISTS) #define set_exists(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] |= EXISTS) #define is_selected(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] & SELECTED) #define unset_selected(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] &= ~SELECTED) #define set_selected(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] |= SELECTED) #define is_select_empty(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] & SELECT_EMPTY) #define set_select_empty(mp,msgnum) \ ((mp)->msgstats[(msgnum) - mp->lowoff] |= SELECT_EMPTY) #define is_unseen(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] & SELECT_UNSEEN) #define unset_unseen(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] &= ~SELECT_UNSEEN) #define set_unseen(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] |= SELECT_UNSEEN) /* for msh only */ #define set_deleted(mp,msgnum) ((mp)->msgstats[(msgnum) - mp->lowoff] |= DELETED) #define in_sequence(mp,seqnum,msgnum) \ ((mp)->msgstats[(msgnum) - mp->lowoff] & (1 << (FFATTRSLOT + seqnum))) #define clear_sequence(mp,seqnum,msgnum) \ ((mp)->msgstats[(msgnum) - mp->lowoff] &= ~(1 << (FFATTRSLOT + seqnum))) #define add_sequence(mp,seqnum,msgnum) \ ((mp)->msgstats[(msgnum) - mp->lowoff] |= (1 << (FFATTRSLOT + seqnum))) #define is_seq_private(mp,seqnum) \ ((mp)->attrstats & (1 << (FFATTRSLOT + seqnum))) #define make_seq_public(mp,seqnum) \ ((mp)->attrstats &= ~(1 << (FFATTRSLOT + seqnum))) #define make_seq_private(mp,seqnum) \ ((mp)->attrstats |= (1 << (FFATTRSLOT + seqnum))) #define make_all_public(mp) \ ((mp)->attrstats = 0) /* * macros for folder attributes */ #define clear_folder_flags(mp) ((mp)->msgflags = 0) #define is_readonly(mp) ((mp)->msgflags & READONLY) #define set_readonly(mp) ((mp)->msgflags |= READONLY) #define other_files(mp) ((mp)->msgflags & OTHERS) #define set_other_files(mp) ((mp)->msgflags |= OTHERS) #define NULLMP ((struct msgs *) 0) /* * m_getfld() message parsing */ #define NAMESZ 999 /* Limit on component name size. RFC 2822 limits line lengths to 998 characters, so a header name can be at most that long. m_getfld limits header names to 2 less than NAMESZ, which is fine, because header names must be followed by a colon. Add one for terminating NULL. */ #define LENERR (-2) /* Name too long error from getfld */ #define FMTERR (-3) /* Message Format error */ #define FLD 0 /* Field returned */ #define FLDPLUS 1 /* Field returned with more to come */ #define FLDEOF 2 /* Field returned ending at eom */ #define BODY 3 /* Body returned with more to come */ #define BODYEOF 4 /* Body returned ending at eom */ #define FILEEOF 5 /* Reached end of input file */ /* * Maildrop styles */ #define MS_DEFAULT 0 /* default (one msg per file) */ #define MS_UNKNOWN 1 /* type not known yet */ #define MS_MBOX 2 /* Unix-style "from" lines */ #define MS_MMDF 3 /* string mmdlm2 */ #define MS_MSH 4 /* whacko msh */ extern int msg_count; /* m_getfld() indicators */ extern int msg_style; /* .. */ extern char *msg_delim; /* .. */ #define NOUSE 0 /* draft being re-used */ #define TFOLDER 0 /* path() given a +folder */ #define TFILE 1 /* path() given a file */ #define TSUBCWF 2 /* path() given a @folder */ #define OUTPUTLINELEN 72 /* default line length for headers */ #define LINK "@" /* Name of link to file to which you are */ /* replying. */ #define NMH_ATTACH_HEADER "Nmh-Attachment" /* Default header for -attach */ /* * miscellaneous macros */ #define pidXwait(pid,cp) pidstatus (pidwait (pid, NOTOK), stdout, cp) #ifndef max # define max(a,b) ((a) > (b) ? (a) : (b)) #endif #ifndef min # define min(a,b) ((a) < (b) ? (a) : (b)) #endif #ifndef abs # define abs(a) ((a) > 0 ? (a) : -(a)) #endif /* * GLOBAL VARIABLES */ #define CTXMOD 0x01 /* context information modified */ #define DBITS "\020\01CTXMOD" extern char ctxflags; extern char *invo_name; /* command invocation name */ extern char *mypath; /* user's $HOME */ extern char *defpath; /* pathname of user's profile */ extern char *ctxpath; /* pathname of user's context */ extern struct node *m_defs; /* list of profile/context entries */ /* * These standard strings are defined in config.c. They are the * only system-dependent parameters in nmh, and thus by redefining * their values and reloading the various modules, nmh will run * on any system. */ extern char *buildmimeproc; extern char *catproc; extern char *components; extern char *context; extern char *current; extern char *defaulteditor; extern char *defaultfolder; extern char *digestcomps; extern char *distcomps; extern char *draft; extern char *faceproc; extern char *fileproc; extern char *foldprot; extern char *formatproc; extern char *forwcomps; extern char *inbox; extern char *incproc; extern char *installproc; extern char *lproc; extern char *mailproc; extern char *mh_defaults; extern char *mh_profile; extern char *mh_seq; extern char *mhlformat; extern char *mhlforward; extern char *mhlproc; extern char *mhlreply; extern char *moreproc; extern char *msgprot; extern char *mshproc; extern char *nmhaccessftp; extern char *nmhstorage; extern char *nmhcache; extern char *nmhprivcache; extern char *nsequence; extern char *packproc; extern char *postproc; extern char *pfolder; extern char *psequence; extern char *rcvdistcomps; extern char *rcvstoreproc; extern char *replcomps; extern char *replgroupcomps; extern char *rmmproc; extern char *sendproc; extern char *showmimeproc; extern char *showproc; extern char *usequence; extern char *version_num; extern char *version_str; extern char *vmhproc; extern char *whatnowproc; extern char *whomproc; extern void (*done) (int) NORETURN; #include nmh-1.5/h/mhcachesbr.h000644 007761 000765 00000000525 11713401273 014572 0ustar00kenhkenh000000 000000 /* * mhcachesbr.h -- definitions for manipulating MIME content cache */ /* * various cache policies */ static struct swit caches[] = { #define CACHE_NEVER 0 { "never", 0 }, #define CACHE_PRIVATE 1 { "private", 0 }, #define CACHE_PUBLIC 2 { "public", 0 }, #define CACHE_ASK 3 { "ask", 0 }, { NULL, 0 } }; nmh-1.5/h/mhparse.h000644 007761 000765 00000016633 11713401273 014141 0ustar00kenhkenh000000 000000 /* * mhparse.h -- definitions for parsing/building of MIME content * -- (mhparse.c/mhbuildsbr.c) */ #define NPARTS 50 #define NTYPES 20 #define NPARMS 10 /* * Abstract type for header fields */ typedef struct hfield *HF; /* * Abstract types for MIME parsing/building */ typedef struct cefile *CE; typedef struct CTinfo *CI; typedef struct Content *CT; /* * type for Init function (both type and transfer encoding) */ typedef int (*InitFunc) (CT); /* * types for various transfer encoding access functions */ typedef int (*OpenCEFunc) (CT, char **); typedef void (*CloseCEFunc) (CT); typedef unsigned long (*SizeCEFunc) (CT); /* * Structure for storing/encoding/decoding * a header field and its value. */ struct hfield { char *name; /* field name */ char *value; /* field body */ int hf_encoding; /* internal flag for transfer encoding to use */ HF next; /* link to next header field */ }; /* * Structure for storing parsed elements * of the Content-Type component. */ struct CTinfo { char *ci_type; /* content type */ char *ci_subtype; /* content subtype */ char *ci_attrs[NPARMS + 2]; /* attribute names */ char *ci_values[NPARMS]; /* attribute values */ char *ci_comment; /* RFC-822 comments */ char *ci_magic; }; /* * Structure for storing decoded contents after * removing Content-Transfer-Encoding. */ struct cefile { char *ce_file; /* decoded content (file) */ FILE *ce_fp; /* decoded content (stream) */ int ce_unlink; /* remove file when done? */ }; /* * Primary structure for handling Content (Entity) */ struct Content { /* source (read) file */ char *c_file; /* read contents (file) */ FILE *c_fp; /* read contents (stream) */ int c_unlink; /* remove file when done? */ long c_begin; /* where content body starts in file */ long c_end; /* where content body ends in file */ /* linked list of header fields */ HF c_first_hf; /* pointer to first header field */ HF c_last_hf; /* pointer to last header field */ /* copies of MIME related header fields */ char *c_vrsn; /* MIME-Version: */ char *c_ctline; /* Content-Type: */ char *c_celine; /* Content-Transfer-Encoding: */ char *c_id; /* Content-ID: */ char *c_descr; /* Content-Description: */ char *c_dispo; /* Content-Disposition: */ char *c_partno; /* within multipart content */ /* Content-Type info */ struct CTinfo c_ctinfo; /* parsed elements of Content-Type */ int c_type; /* internal flag for content type */ int c_subtype; /* internal flag for content subtype */ /* Content-Transfer-Encoding info (decoded contents) */ CE c_cefile; /* structure holding decoded content */ int c_encoding; /* internal flag for encoding type */ /* Content-MD5 info */ int c_digested; /* have we seen this header before? */ unsigned char c_digest[16]; /* decoded MD5 checksum */ /* pointers to content-specific structures */ void *c_ctparams; /* content type specific data */ struct exbody *c_ctexbody; /* data for type message/external */ /* function pointers */ InitFunc c_ctinitfnx; /* parse content body */ OpenCEFunc c_ceopenfnx; /* get a stream to decoded contents */ CloseCEFunc c_ceclosefnx; /* release stream */ SizeCEFunc c_cesizefnx; /* size of decoded contents */ int c_umask; /* associated umask */ pid_t c_pid; /* process doing display */ int c_rfc934; /* rfc934 compatibility flag */ char *c_showproc; /* default, if not in profile */ char *c_termproc; /* for charset madness... */ char *c_storeproc; /* overrides profile entry, if any */ char *c_storage; /* write contents (file) */ char *c_folder; /* write contents (folder) */ }; /* * Flags for Content-Type (Content->c_type) */ #define CT_UNKNOWN 0x00 #define CT_APPLICATION 0x01 #define CT_AUDIO 0x02 #define CT_IMAGE 0x03 #define CT_MESSAGE 0x04 #define CT_MULTIPART 0x05 #define CT_TEXT 0x06 #define CT_VIDEO 0x07 #define CT_EXTENSION 0x08 /* * Flags for Content-Transfer-Encoding (Content->c_encoding) */ #define CE_UNKNOWN 0x00 #define CE_BASE64 0x01 #define CE_QUOTED 0x02 #define CE_8BIT 0x03 #define CE_7BIT 0x04 #define CE_BINARY 0x05 #define CE_EXTENSION 0x06 #define CE_EXTERNAL 0x07 /* for external-body */ /* * TEXT content */ /* Flags for subtypes of TEXT */ #define TEXT_UNKNOWN 0x00 #define TEXT_PLAIN 0x01 #define TEXT_RICHTEXT 0x02 #define TEXT_ENRICHED 0x03 /* Flags for character sets */ #define CHARSET_UNKNOWN 0x00 #define CHARSET_UNSPECIFIED 0x01 /* only needed when building drafts */ #define CHARSET_USASCII 0x01 #define CHARSET_LATIN 0x02 /* Structure for text content */ struct text { int tx_charset; /* flag for character set */ }; /* * MULTIPART content */ /* Flags for subtypes of MULTIPART */ #define MULTI_UNKNOWN 0x00 #define MULTI_MIXED 0x01 #define MULTI_ALTERNATE 0x02 #define MULTI_DIGEST 0x03 #define MULTI_PARALLEL 0x04 /* Structure for subparts of a multipart content */ struct part { CT mp_part; /* Content structure for subpart */ struct part *mp_next; /* pointer to next subpart structure */ }; /* Main structure for multipart content */ struct multipart { char *mp_start; /* boundary string separating parts */ char *mp_stop; /* terminating boundary string */ struct part *mp_parts; /* pointer to first subpart structure */ }; /* * MESSAGE content */ /* Flags for subtypes of MESSAGE */ #define MESSAGE_UNKNOWN 0x00 #define MESSAGE_RFC822 0x01 #define MESSAGE_PARTIAL 0x02 #define MESSAGE_EXTERNAL 0x03 /* Structure for message/partial */ struct partial { char *pm_partid; int pm_partno; int pm_maxno; int pm_marked; int pm_stored; }; /* Structure for message/external */ struct exbody { CT eb_parent; /* pointer to controlling content structure */ CT eb_content; /* pointer to internal content structure */ char *eb_partno; char *eb_access; int eb_flags; char *eb_name; char *eb_permission; char *eb_site; char *eb_dir; char *eb_mode; unsigned long eb_size; char *eb_server; char *eb_subject; char *eb_body; }; /* * APPLICATION content */ /* Flags for subtype of APPLICATION */ #define APPLICATION_UNKNOWN 0x00 #define APPLICATION_OCTETS 0x01 #define APPLICATION_POSTSCRIPT 0x02 /* * Structures for mapping types to their internal flags */ struct k2v { char *kv_key; int kv_value; }; extern struct k2v SubText[]; extern struct k2v Charset[]; extern struct k2v SubMultiPart[]; extern struct k2v SubMessage[]; extern struct k2v SubApplication[]; /* * Structures for mapping (content) types to * the functions to handle them. */ struct str2init { char *si_key; int si_val; InitFunc si_init; }; extern struct str2init str2cts[]; extern struct str2init str2ces[]; extern struct str2init str2methods[]; /* * prototypes */ int pidcheck (int); CT parse_mime (char *); int add_header (CT, char *, char *); int get_ctinfo (unsigned char *, CT, int); int params_external (CT, int); int open7Bit (CT, char **); void close_encoding (CT); extern int checksw; /* Add Content-MD5 field */ nmh-1.5/h/mime.h000644 007761 000765 00000002256 11713401273 013425 0ustar00kenhkenh000000 000000 /* * mime.h -- definitions for MIME */ #define VRSN_FIELD "MIME-Version" #define VRSN_VALUE "1.0" #define XXX_FIELD_PRF "Content-" #define TYPE_FIELD "Content-Type" #define ENCODING_FIELD "Content-Transfer-Encoding" #define ID_FIELD "Content-ID" #define DESCR_FIELD "Content-Description" #define DISPO_FIELD "Content-Disposition" #define MD5_FIELD "Content-MD5" #define isatom(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \ && (c) != ')' && (c) != '<' && (c) != '>' \ && (c) != '@' && (c) != ',' && (c) != ';' \ && (c) != ':' && (c) != '\\' && (c) != '"' \ && (c) != '.' && (c) != '[' && (c) != ']') /* * Test for valid characters used in "token" * as defined in RFC2045 */ #define istoken(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \ && (c) != ')' && (c) != '<' && (c) != '>' \ && (c) != '@' && (c) != ',' && (c) != ';' \ && (c) != ':' && (c) != '\\' && (c) != '"' \ && (c) != '/' && (c) != '[' && (c) != ']' \ && (c) != '?' && (c) != '=') #define CPERLIN 76 #define BPERLIN (CPERLIN / 4) #define LPERMSG 632 #define CPERMSG (LPERMSG * CPERLIN) nmh-1.5/h/msh.h000644 007761 000765 00000005011 11762736345 013274 0ustar00kenhkenh000000 000000 /* * msh.h -- definitions for msh */ /* flags for stream */ #define STDIO 0 /* regular stdoutput */ #define CRTIO 1 /* create re-direct */ #define APPIO 2 /* append re-direct */ #define PIPIO 3 /* pipe re-direct */ struct Cmd { char line[BUFSIZ]; char *args[MAXARGS]; char *redirect; int direction; FILE *stream; }; #define NULLCMD ((struct Cmd *) 0) #define MHNCHK 0x0001 /* did nontext check */ #define MHNYES 0x0002 /* .. and known to be non-text */ #define CUR (1 << (FFATTRSLOT + NUMATTRS - 1)) #ifdef BPOP # define VIRTUAL SELECT_EMPTY # define is_virtual(mp,msgnum) ((mp)->msgstats[msgnum] & VIRTUAL) # define unset_virtual(mp,msgnum) ((mp)->msgstats[msgnum] &= ~VIRTUAL) # define set_virtual(mp,msgnum) ((mp)->msgstats[msgnum] |= VIRTUAL) #endif struct Msg { struct drop m_drop; char *m_scanl; struct tws m_tb; short m_flags; seqset_t m_stats; }; #define m_bboard_id m_drop.d_id #define m_top m_drop.d_size #define m_start m_drop.d_start #define m_stop m_drop.d_stop /* * FOLDER */ extern char *fmsh; /* folder instead of file */ extern int modified; /* command modified folder */ extern struct msgs *mp; /* used a lot */ extern struct Msg *Msgs; /* Msgs[0] not used */ FILE *msh_ready (int, int); /* * COMMAND */ extern int interactive; /* running from a /dev/tty */ extern int redirected; /* re-directing output */ extern FILE *sp; /* original stdout */ extern char *cmd_name; /* command being run */ extern char myfilter[]; /* path to mhl.forward */ extern char *BBoard_ID; /* BBoard-ID constant */ /* * SIGNALS */ extern SIGNAL_HANDLER istat; /* original SIGINT */ extern SIGNAL_HANDLER qstat; /* original SIGQUIT */ extern int interrupted; /* SIGINT detected */ extern int broken_pipe; /* SIGPIPE detected */ extern int told_to_quit; /* SIGQUIT detected */ /* * prototypes */ int readid (int); int expand (char *); void m_reset (void); void fsetup (char *); void setup (char *); void readids (int); void display_info (int); void forkcmd (char **s, char *); void distcmd (char **); void explcmd (char **); int filehak (char **); void filecmd (char **); void foldcmd (char **); void forwcmd (char **); void helpcmd (char **); void markcmd (char **); void mhncmd (char **); void showcmd (char **); int pack (char *, int, int); int packhak (char **); void packcmd (char **); void pickcmd (char **); void replcmd (char **); void rmmcmd (char **); void scancmd (char **); void sortcmd (char **); nmh-1.5/h/mts.h000644 007761 000765 00000002343 11762736345 013315 0ustar00kenhkenh000000 000000 /* * mts.h -- definitions for the mail system */ /* * Local and UUCP Host Name */ char *LocalName(int); char *SystemName(void); /* * Mailboxes */ extern char *mmdfldir; extern char *mmdflfil; extern char *uucpldir; extern char *uucplfil; #define MAILDIR (mmdfldir && *mmdfldir ? mmdfldir : getenv ("HOME")) #define MAILFIL (mmdflfil && *mmdflfil ? mmdflfil : getusername ()) #define UUCPDIR (uucpldir && *uucpldir ? uucpldir : getenv ("HOME")) #define UUCPFIL (uucplfil && *uucplfil ? uucplfil : getusername ()) char *getusername(void); char *getfullname(void); char *getlocalmbox(void); /* * Separators */ extern char *mmdlm1; extern char *mmdlm2; #define isdlm1(s) (strcmp (s, mmdlm1) == 0) #define isdlm2(s) (strcmp (s, mmdlm2) == 0) /* * Read mts.conf file */ void mts_init (char *); /* * MTS specific variables */ /* whether to speak SMTP to localhost:25 or to /usr/sbin/sendmail */ #define MTS_SMTP 0 #define MTS_SENDMAIL 1 extern int sm_mts; extern char *sendmail; /* * SMTP/POP stuff */ extern char *clientname; extern char *servers; extern char *pophost; /* * Global MailDelivery File */ extern char *maildelivery; /* * Aliasing Facility (doesn't belong here) */ extern int Everyone; extern char *NoShell; nmh-1.5/h/nmh.h000644 007761 000765 00000002031 11762736345 013266 0ustar00kenhkenh000000 000000 /* * nmh.h -- system configuration header file */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include # include #define NLENGTH(dirent) strlen((dirent)->d_name) #include #include #include #ifdef HAVE_SYS_PARAM_H # include #endif # include # include /* * we should be getting this value from pathconf(_PC_PATH_MAX) */ #ifndef PATH_MAX # ifdef MAXPATHLEN # define PATH_MAX MAXPATHLEN # else /* so we will just pick something */ # define PATH_MAX 1024 # endif #endif /* * we should get this value from sysconf(_SC_NGROUPS_MAX) */ #ifndef NGROUPS_MAX # ifdef NGROUPS # define NGROUPS_MAX NGROUPS # else # define NGROUPS_MAX 16 # endif #endif /* * we should be getting this value from sysconf(_SC_OPEN_MAX) */ #ifndef OPEN_MAX # ifdef NOFILE # define OPEN_MAX NOFILE # else /* so we will just pick something */ # define OPEN_MAX 64 # endif #endif #include nmh-1.5/h/picksbr.h000644 007761 000765 00000000220 11713401273 014120 0ustar00kenhkenh000000 000000 /* * picksbr.h -- definitions for picksbr.c */ /* * prototypes */ int pcompile (char **, char *); int pmatches (FILE *, int, long, long); nmh-1.5/h/popsbr.h000644 007761 000765 00000000703 11713401273 013776 0ustar00kenhkenh000000 000000 /* * popsbr.h -- header for POP client subroutines */ int pop_init (char *, char *, char *, char *, char *, int, int, char *); int pop_fd (char *, int, char *, int); int pop_stat (int *, int *); int pop_retr (int, int (*)(char *)); int pop_dele (int); int pop_noop (void); int pop_rset (void); int pop_top (int, int, int (*)(char *)); int pop_quit (void); int pop_done (void); int pop_set (int, int, int); int pop_list (int, int *, int *, int *); nmh-1.5/h/prototypes.h000644 007761 000765 00000012306 11765267273 014744 0ustar00kenhkenh000000 000000 /* * prototypes.h -- various prototypes */ /* * missing system prototypes */ #if ! defined(HAVE_TERMCAP_H) && ! defined (HAVE_NCURSES_TERMCAP_H) extern int tgetent (char *bp, char *name); extern int tgetnum (char *id); extern int tgetflag (char *id); extern char *tgetstr (char *id, char **area); extern char *tgoto (char *cm, int destcol, int destline); extern int tputs (char *cp, int affcnt, int (*outc) (int)); #endif /* * prototype from config.h */ char *etcpath(char *); /* * prototypes from the nmh subroutine library */ void adios (char *, char *, ...) NORETURN; void admonish (char *, char *, ...); void advertise (char *, char *, char *, va_list); void advise (char *, char *, ...); void ambigsw (char *, struct swit *); int atooi(char *); char **brkstring (char *, char *, char *); int check_charset (char *, int); int client(char *, char *, char *, int, int); void closefds(int); char *concat (char *, ...); int context_del (char *); char *context_find (char *); int context_foil (char *); void context_read (void); void context_replace (char *, char *); void context_save (void); char *copy (char *, char *); char **copyip (char **, char **, int); void cpydata (int, int, char *, char *); void cpydgst (int, int, char *, char *); int decode_rfc2047 (char *, char *, size_t); void discard (FILE *); int default_done (int); void escape_display_name (char *, size_t); int ext_hook(char *, char *, char *); int fdcompare (int, int); int folder_addmsg (struct msgs **, char *, int, int, int, int, char *); int folder_delmsgs (struct msgs *, int, int); void folder_free (struct msgs *); int folder_pack (struct msgs **, int); struct msgs *folder_read (char *); struct msgs *folder_realloc (struct msgs *, int, int); int gans (char *, struct swit *); char **getans (char *, struct swit *); #ifdef READLINE_SUPPORT char **getans_via_readline (char *, struct swit *); #endif /* READLINE_SUPPORT */ int getanswer (char *); char **getarguments (char *, int, char **, int); char *get_charset(void); char *getcpy (char *); char *getfolder(int); int lkclose(int, char*); int lkfclose(FILE *, char *); FILE *lkfopen(char *, char *); int lkopen(char *, int, mode_t); int m_atoi (char *); char *m_backup (char *); int m_convert (struct msgs *, char *); char *m_draft (char *, char *, int, int *); void m_eomsbr (int (*)(int)); int m_getfld (int, unsigned char *, unsigned char *, int, FILE *); int m_gmprot (void); char *m_maildir (char *); char *m_mailpath (char *); char *m_name (int); int m_putenv (char *, char *); char *m_mktemp(const char *, int *, FILE **); char *m_mktemp2(const char *, const char *, int *, FILE **); void m_unknown(FILE *); int makedir (char *); char *nmh_getpass(const char *); char *norm_charmap(char *); char *new_fs (char *, char *, char *); char *path(char *, int); int peekc(FILE *ib); int pidwait (pid_t, int); int pidstatus (int, FILE *, char *); char *pluspath(char *); void print_help (char *, struct swit *, int); void print_sw (char *, struct swit *, char *, FILE *); void print_version (char *); void push (void); char *pwd (void); char *r1bindex(char *, int); void readconfig (struct node **, FILE *, char *, int); int refile (char **, char *); void ruserpass(char *, char **, char **); int remdir (char *); int seq_addmsg (struct msgs *, char *, int, int, int); int seq_addsel (struct msgs *, char *, int, int); char *seq_bits (struct msgs *); int seq_delmsg (struct msgs *, char *, int); int seq_delsel (struct msgs *, char *, int, int); int seq_getnum (struct msgs *, char *); char *seq_list (struct msgs *, char *); int seq_nameok (unsigned char *); void seq_print (struct msgs *, char *); void seq_printall (struct msgs *); void seq_read (struct msgs *); void seq_save (struct msgs *); void seq_setcur (struct msgs *, int); void seq_setprev (struct msgs *); void seq_setunseen (struct msgs *, int); int showfile (char **, char *); int smatch(char *, struct swit *); char *snprintb (char *, size_t, unsigned, char *); int ssequal (char *, char *); int stringdex (char *, char *); char *trimcpy (unsigned char *); int unputenv (char *); int uprf (char *, char *); int vfgets (FILE *, char **); char *write_charset_8bit (void); int mh_strcasecmp (const char *s1, const char *s2); int strncasecmp (const char *s1, const char *s2, size_t n); /* * some prototypes for address parsing system * (others are in addrsbr.h) */ char *LocalName(int); char *SystemName(void); /* * prototypes for some routines in uip */ int annotate (char *, char *, char *, int, int, int, int); void annolist(char *, char *, char *, int); void annopreserve(int); void clear_screen(void); void m_pclose(void); int make_intermediates(char *); int mhl(int, char **); int mhlsbr(int, char **, FILE *(*)(char *)); int distout (char *, char *, char *); void replout (FILE *, char *, char *, struct msgs *, int, int, char *, char *, char *, int); void set_endian(void); int sc_hardcopy(void); int sc_length(void); int sc_width(void); int build_form (char *, char *, int *, char *, char *, char *, char *, char *, char *); int sendsbr (char **, int, char *, struct stat *, int, char *, int); int SOprintf (char *, ...); int what_now (char *, int, int, char *, char *, int, struct msgs *, char *, int, char *, int); int WhatNow(int, char **); int writeBase64aux(FILE *, FILE *); nmh-1.5/h/rcvmail.h000644 007761 000765 00000000501 11762736345 014141 0ustar00kenhkenh000000 000000 /* * rcvmail.h -- rcvmail hook definitions */ #include #include #include #include #include #define RCV_MOK 0 #define RCV_MBX 1 #ifdef NRTC /* sigh */ # undef RCV_MOK # undef RCV_MBX # define RCV_MOK RP_MOK # define RCV_MBX RP_MECH #endif /* NRTC */ nmh-1.5/h/scansbr.h000644 007761 000765 00000002166 11713401273 014131 0ustar00kenhkenh000000 000000 /* * scansbr.h -- definitions for scan() */ extern char *scanl; #define SCNENC 2 /* message just fine, but encrypted(!!) */ #define SCNMSG 1 /* message just fine */ #define SCNEOF 0 /* empty message */ #define SCNERR (-1) /* error message */ #define SCNNUM (-2) /* number out of range */ #define SCNFAT (-3) /* fatal error */ /* * default format for `scan' and `inc' */ #ifndef UK #define FORMAT \ "%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}>>%>\n" #else #define FORMAT \ "%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mday{date})/%02(mon{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}>>%>\n" #endif #define WIDTH 78 /* * prototypes */ int scan (FILE *, int, int, char *, int, int, int, char *, long, int); nmh-1.5/h/signals.h000644 007761 000765 00000000455 11762736345 014154 0ustar00kenhkenh000000 000000 /* * signals.h -- header file for nmh signal interface */ #ifdef HAVE_CONFIG_H #include #endif /* * The type for a signal handler */ typedef void (*SIGNAL_HANDLER)(int); /* * prototypes */ SIGNAL_HANDLER SIGNAL (int, SIGNAL_HANDLER); SIGNAL_HANDLER SIGNAL2 (int, SIGNAL_HANDLER); nmh-1.5/h/tws.h000644 007761 000765 00000004515 11713401273 013313 0ustar00kenhkenh000000 000000 /* * tws.h */ /* If the following is #defined, a timezone given as a numeric-only offset will be treated specially if it's in a zone that observes Daylight Saving Time. For instance, during DST, a Date: like "Mon, 24 Jul 2000 12:31:44 -0700" will be printed as "Mon, 24 Jul 2000 12:31:44 PDT". Without the code activated by the following #define, that'd be incorrectly printed as "...MST". */ #define ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST 1 struct tws { int tw_sec; /* seconds after the minute - [0, 61] */ int tw_min; /* minutes after the hour - [0, 59] */ int tw_hour; /* hour since midnight - [0, 23] */ int tw_mday; /* day of the month - [1, 31] */ int tw_mon; /* months since January - [0, 11] */ int tw_year; /* 4 digit year (ie, 1997) */ int tw_wday; /* days since Sunday - [0, 6] */ int tw_yday; /* days since January 1 - [0, 365] */ int tw_zone; time_t tw_clock; /* if != 0, corresponding calendar value */ int tw_flags; }; #define TW_NULL 0x0000 #define TW_SDAY 0x0003 /* how day-of-week was determined */ #define TW_SNIL 0x0000 /* not given */ #define TW_SEXP 0x0001 /* explicitly given */ #define TW_SIMP 0x0002 /* implicitly given */ #define TW_SZONE 0x0004 /* how timezone was determined */ #define TW_SZNIL 0x0000 /* not given */ #define TW_SZEXP 0x0004 /* explicitly given */ #define TW_DST 0x0010 /* daylight savings time */ #define TW_ZONE 0x0020 /* use numeric timezones only */ #define TW_SUCC 0x0040 /* whether parsing was successful */ #define TW_YES 0x0040 /* yes, found */ #define TW_NO 0x0000 /* no, not found */ #define dtwszone(tw) dtimezone (tw->tw_zone, tw->tw_flags) extern char *tw_dotw[]; extern char *tw_ldotw[]; extern char *tw_moty[]; /* * prototypes */ char *dtime (time_t *, int); char *dtimenow (int); char *dctime (struct tws *); struct tws *dlocaltimenow (void); struct tws *dlocaltime (time_t *); struct tws *dgmtime (time_t *); char *dasctime (struct tws *, int); char *dtimezone (int, int); void twscopy (struct tws *, struct tws *); int twsort (struct tws *, struct tws *); time_t dmktime (struct tws *); void set_dotw (struct tws *); struct tws *dparsetime (char *); nmh-1.5/h/utils.h000644 007761 000765 00000000627 11762736345 013655 0ustar00kenhkenh000000 000000 /* * utils.h -- utility prototypes */ void *mh_xmalloc(size_t); void *mh_xrealloc(void *, size_t); char *pwd(void); char *add(char *, char *); char *addlist(char *, char *); int folder_exists(char *); void create_folder(char *, int, void (*)(int)); int num_digits(int); struct msgs_array { int max, size; char **msgs; }; void app_msgarg(struct msgs_array *, char *); int open_form(char **, char *); nmh-1.5/h/vmhsbr.h000644 007761 000765 00000002103 11713401273 013766 0ustar00kenhkenh000000 000000 /* * vmhsbr.h -- definitions for the vmh protocol */ #define RC_VRSN 1 /* flags for rh_type */ #define RC_INI 0x01 /* must be greater than OK */ #define RC_ACK 0x02 #define RC_ERR 0x03 #define RC_CMD 0x04 #define RC_QRY 0x05 #define RC_TTY 0x06 #define RC_WIN 0x07 #define RC_DATA 0x08 #define RC_EOF 0x09 #define RC_FIN 0x0a #define RC_XXX 0x0b struct record { struct rcheader { char rh_type; /* type of record */ int rh_len; /* length of data */ } rc_header; char *rc_data; /* extensible array */ }; #define rc_head(rc) (&rc->rc_header) #define RHSIZE(rc) (sizeof rc->rc_header) #define rc_type rc_header.rh_type #define rc_len rc_header.rh_len #define initrc(rc) rc->rc_data = NULL /* * prototypes */ int rcinit (int, int); int rcdone (void); int rc2rc (char, int, char *, struct record *); int str2rc (char, char *, struct record *); int peer2rc (struct record *); int rc2peer (char, int, char *); int str2peer (char, char *); int fmt2peer (char, char *, ...); int err2peer (char, char *, char *, ...); int verr2peer (char, char *, char *, va_list); nmh-1.5/etc/components000644 007761 000765 00000001476 11762736345 015003 0ustar00kenhkenh000000 000000 %; %; Our default components file. Used by `comp' %; %; %; This line creates our From: header based on the following ordering: %; %; - Use a -from switch if it exists ({from}) %; - Use our local mailbox identity; first from the Local-Mailbox profile %; entry, otherwise gets the information from the local system %; %<{from}%|%(void(localmbox))%>%(void(width))%(putaddr From: ) %; %; Here we include an address list if one or more "-to" arguments were %; given, otherwise just output a blank header. We do the same for the %; "cc" header as well. %; %<{to}%(void(width))%(putaddr To: )%|To:%> %<{cc}%(void(width))%(putaddr cc: )%|cc:%> %; %; Slight difference here: if we're not given "-fcc" on the command line, %; make the default mailbox +outbox %; Fcc: %<{fcc}%(putstr)%|+outbox%> Subject:%<{subject} %(putstr)%> -------- nmh-1.5/etc/digestcomps000644 007761 000765 00000001430 11762736345 015125 0ustar00kenhkenh000000 000000 %; %; digestcomps - the component template file used when doing "forw -digest" %; %; What happens here is the following: %; %; - Try to make reasonable defaults when using -digest %; - Allow users to override headers if they give them %; %; See forwcomps for more details on how this works %; %<{nmh-from}%(void(width))%(putaddr From: )%|From: %{digest}-Request%> %<{nmh-to}%(void(width))%(putaddr To: )%|To: %{digest} Distribution: dist-%{digest};%> %<{nmh-cc}%(void(width))%(putaddr cc: )\n%>\ %<{fcc}Fcc: %(putstr)\n%>\ Subject: %<{nmh-subject}%(putlit)%|%{digest} Digest V%(cur) #%(msg)%> Reply-To: %{digest} -------- %{digest} Digest %(weekday{nmh-date}), %2(mday{nmh-date}) %(month{nmh-date}) %(year{nmh-date}) Volume %(cur) : Issue %(msg) Today's Topics: nmh-1.5/etc/distcomps000644 007761 000765 00000001247 11762736345 014617 0ustar00kenhkenh000000 000000 %; %; distcomps - Our components file for "dist" %; %; This is modeled after the components file for forw, so check that %; file for more explanation as to what is going on here. %; %; When using "dist" we have to use the special Resent- headers, since %; we're keeping the original headers of the message intact. %; %; All of the header components from the original message are available %; if you wish to use them. %; %<{nmh-from}%|%(void(localmbox))%>%(void(width))%(putaddr Resent-From: ) %<{nmh-to}%(void(width))%(putaddr Resent-To: )%|Resent-To:%> %<{nmh-cc}%(void(width))%(putaddr Resent-cc: )%|Resent-cc:%> %<{nmh-fcc}%(void(width))%(putaddr Resent-fcc: )%|Resent-fcc:%> nmh-1.5/etc/forwcomps000644 007761 000765 00000002337 11762736345 014632 0ustar00kenhkenh000000 000000 %; %; forwcomps - Our components file when we're using "forw" %; %; We want people to be able to use the components from forwarded %; messages in this file, so we have to cheat a bit. We create a series %; of pseudo-components with a "nmh" prefix to represent arguments given %; on the command line. We don't do this for %{fcc} since there's already %; precedence for this from "repl". %; %; If we're given multiple messages to forward, provide the components %; from the first one. Can't really think of anything better to do there. %; %; Generate a "From:" header; if we don't give one, use %(localmbox) %; %<{nmh-from}%|%(void(localmbox))%>%(void(width))%(putaddr From: ) %; %; Generate To: and cc: headers; if we're given ones, put something in there %; otherwise leave them blank. %; %<{nmh-to}%(void(width))%(putaddr To: )%|To:%> %<{nmh-cc}%(void(width))%(putaddr cc: )%|cc:%> %; %; If we're not given a -fcc switch, then default to +outbox %; Fcc: %<{fcc}%(putstr)%|+outbox%> %; %; If we're not given a -subject switch, then use the original message %; subject, but adding (fwd) on the end. I got this idea from exmh, and %; I've always liked it. %; Subject:%<{nmh-subject} %(trim)%(putlit)%?{subject} %(trim)%(putlit) (fwd)%> -------- nmh-1.5/etc/MailAliases000644 007761 000765 00000002103 11713401273 014747 0ustar00kenhkenh000000 000000 ; ; MailAliases -- nmh global aliases file ; ; This file is used to define aliases that are valid for all mh users. ; This file is almost empty as MH now supports personal aliases. ; ; If you need to define system wide aliases such as "everyone", it is ; preferable that this be done as the mail transport level, so that they ; will be valid for users of other mail clients. ; everyone: * ; Blank lines and lines beginning with a ; are ignored. ; < file -> read more aliases from "file" ; foo: fum -> simple replacement ; foo: fum, fie -> list replacement ; foo: < file -> list replacement from "file" ; foo: = group -> list replacement from UNIX group ; foo: + group -> list replacement by ALL users in /etc/passwd ; with gid == group ; foo: * -> list replacement by ALL users in /etc/passwd ; with uid >= 200 ; foo*: fum -> matches foo (including the empty string) ; ; using a ';' instead of a ':' indicates that the alias should be displayed ; along with the addresses used (normally, the addresses replace the alias ; completely) nmh-1.5/etc/mhl.body000644 007761 000765 00000000056 11476006206 014307 0ustar00kenhkenh000000 000000 width=10000 body:nocomponent,overflowoffset=0 nmh-1.5/etc/mhl.digest000644 007761 000765 00000000301 11476006206 014622 0ustar00kenhkenh000000 000000 width=80,overflowoffset=10 leftadjust,compress,compwidth=9 Date:formatfield="%<(nodate{text})%{text}%|%(tws{text})%>" From: Subject: : body:nocomponent,overflowoffset=0,noleftadjust,nocompress nmh-1.5/etc/mhl.format000644 007761 000765 00000000573 11476006206 014646 0ustar00kenhkenh000000 000000 ; mhl.format ; ; default message filter for `show' ; : overflowtext="***",overflowoffset=5 leftadjust,compwidth=9 ignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>" To: cc: From:decode Subject:decode : extras:nocomponent : body:nocomponent,overflowtext=,overflowoffset=0,noleftadjust nmh-1.5/etc/mhl.forward000644 007761 000765 00000000434 11476006206 015016 0ustar00kenhkenh000000 000000 ; mhl.forward ; ; default message filter for `forw' (forw -format) ; width=80,overflowtext=,overflowoffset=10 leftadjust,compress,compwidth=9 Date:formatfield="%<(nodate{text})%{text}%|%(tws{text})%>" From: To: cc: Subject: : body:nocomponent,overflowoffset=0,noleftadjust,nocompress nmh-1.5/etc/mhl.headers000644 007761 000765 00000000637 11476006206 014772 0ustar00kenhkenh000000 000000 ; mhl.headers ; ; Default format file for displaying headers in ; MIME messages. mhn calls the mhlproc with this ; filter to display message header. ; overflowtext="***",overflowoffset=5 leftadjust,compwidth=9 ignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>" To: cc: From:decode Subject:decode : extras:nocomponent : nmh-1.5/etc/mhl.reply000644 007761 000765 00000000273 11713401273 014503 0ustar00kenhkenh000000 000000 ; mhl.reply ; ; default message filter for `repl' (repl -format) ; from:nocomponent,formatfield="%(decode(friendly{text})) writes:" body:component="> ",overflowtext="> ",overflowoffset=0 nmh-1.5/etc/mhn.defaults.sh000755 007761 000765 00000020425 11762736345 015615 0ustar00kenhkenh000000 000000 #!/bin/sh # # mhn.defaults.sh -- create extra profile file for MIME handling # # USAGE: mhn.defaults.sh [ search-path [ search-prog ]] # If a search path is passed to the script, we # use that, else we use a default search path. if [ -n "$1" ]; then SEARCHPATH=$1 else SEARCHPATH="$PATH:/usr/demo/SOUND" fi # If a search program is passed to the script, we # use that, else we use a default search program. if [ -n "$2" ]; then SEARCHPROG=$2 else SEARCHPROG="mhn.find.sh" fi # put output into a temporary file, so we # can sort it before output. TMP=/tmp/nmh_temp.$$ trap "rm -f $TMP" 0 1 2 3 13 15 echo "mhstore-store-text: %m%P.txt" >> $TMP echo "mhstore-store-text/richtext: %m%P.rt" >> $TMP echo "mhstore-store-video/mpeg: %m%P.mpg" >> $TMP echo "mhstore-store-application/PostScript: %m%P.ps" >> $TMP PGM="`$SEARCHPROG $SEARCHPATH xwud`" if [ ! -z "$PGM" ]; then XWUD="$PGM" X11DIR="`echo $PGM | awk -F/ '{ for(i=2;i> $TMP elif [ ! -z $"PBM" -a ! -z "$XWUD" ]; then echo "mhshow-show-image/gif: %p${PBMDIR}giftoppm | ${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP echo "mhshow-show-image/x-pbm: %p${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP echo "mhshow-show-image/x-pgm: %p${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP echo "mhshow-show-image/x-ppm: %p${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP echo "mhshow-show-image/x-xwd: %p$XWUD -geometry =-0+0" >> $TMP PGM="`$SEARCHPROG $SEARCHPATH djpeg`" if [ ! -z "$PGM" ]; then echo "mhshow-show-image/jpeg: %p$PGM -Pg | ${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP fi fi if [ -f "/dev/audioIU" ]; then PGM="`$SEARCHPROG $SEARCHPATH recorder`" if [ ! -z "$PGM" ]; then echo "mhstore-store-audio/basic: %m%P.au" >> $TMP echo "mhbuild-compose-audio/basic: ${AUDIODIR}recorder '%f' -au -pause > /dev/tty" >> $TMP echo "mhshow-show-audio/basic: %p${AUDIODIR}splayer -au" >> $TMP fi elif [ -f "/dev/audio" ]; then PGM="`$SEARCHPROG $SEARCHPATH raw2audio`" if [ ! -z "$PGM" ]; then AUDIODIR="`echo $PGM | awk -F/ '{ for(i=2;i %m%P.au" >> $TMP echo "mhstore-store-audio/x-next: %m%P.au" >> $TMP AUDIOTOOL="`$SEARCHPROG $SEARCHPATH audiotool`" if [ ! -z "$AUDIOTOOL" ]; then echo "mhbuild-compose-audio/basic: $AUDIOTOOL '%f' && ${AUDIODIR}raw2audio -F < '%f'" >> $TMP else echo "mhbuild-compose-audio/basic: trap \"exit 0\" 2 && ${AUDIODIR}record | ${AUDIODIR}raw2audio -F" >> $TMP fi echo "mhshow-show-audio/basic: %p${AUDIODIR}raw2audio 2>/dev/null | ${AUDIODIR}play" >> $TMP PGM="`$SEARCHPROG $SEARCHPATH adpcm_enc`" if [ ! -z "$PGM" ]; then DIR="`echo $PGM | awk -F/ '{ for(i=2;i> $TMP else echo "mhbuild-compose-audio/x-next: ${AUDIODIR}record | ${DIR}adpcm_enc" >> $TMP fi echo "mhshow-show-audio/x-next: %p${DIR}adpcm_dec | ${AUDIODIR}play" >> $TMP else if [ ! -z "$AUDIOTOOL" ]; then echo "mhbuild-compose-audio/x-next: $AUDIOTOOL '%f'" >> $TMP else echo "mhbuild-compose-audio/x-next: ${AUDIODIR}record" >> $TMP fi echo "mhshow-show-audio/x-next: %p${AUDIODIR}play" >> $TMP fi else echo "mhbuild-compose-audio/basic: cat < /dev/audio" >> $TMP echo "mhshow-show-audio/basic: %pcat > /dev/audio" >> $TMP fi fi PGM="`$SEARCHPROG $SEARCHPATH mpeg_play`" if [ ! -z "$PGM" ]; then echo "mhshow-show-video/mpeg: %p$PGM '%f'" >> $TMP fi PGM="`$SEARCHPROG $SEARCHPATH lpr`" if [ ! -z "$PGM" ]; then echo "mhshow-show-application/PostScript: %plpr -Pps" >> $TMP else PGM="`$SEARCHPROG $SEARCHPATH lp`" if [ ! -z "$PGM" ]; then echo "mhshow-show-application/PostScript: %plp -dps" >> $TMP fi fi PGM="`$SEARCHPROG $SEARCHPATH ivs_replay`" if [ ! -z "$PGM" ]; then echo "mhshow-show-application/x-ivs: %p$PGM -o '%F'" >> $TMP fi cat <> ${TMP} mhshow-suffix-application/msword: .doc mhshow-suffix-application/msword: .docx mhshow-suffix-application/ogg: .ogg mhshow-suffix-application/pdf: .pdf mhshow-suffix-application/postscript: .ps mhshow-suffix-application/rtf: .rtf mhshow-suffix-application/vnd.ms-excel: .xla mhshow-suffix-application/vnd.ms-excel: .xlc mhshow-suffix-application/vnd.ms-excel: .xld mhshow-suffix-application/vnd.ms-excel: .xll mhshow-suffix-application/vnd.ms-excel: .xlm mhshow-suffix-application/vnd.ms-excel: .xls mhshow-suffix-application/vnd.ms-excel: .xlt mhshow-suffix-application/vnd.ms-excel: .xlw mhshow-suffix-application/vnd.ms-powerpoint: .pot mhshow-suffix-application/vnd.ms-powerpoint: .pps mhshow-suffix-application/vnd.ms-powerpoint: .ppt mhshow-suffix-application/vnd.ms-powerpoint: .ppz mhshow-suffix-application/x-bzip2: .bz2 mhshow-suffix-application/x-cpio: .cpio mhshow-suffix-application/x-dvi: .dvi mhshow-suffix-application/x-gzip: .gz mhshow-suffix-application/x-java-archive: .jar mhshow-suffix-application/x-javascript: .js mhshow-suffix-application/x-latex: .latex mhshow-suffix-application/x-sh: .sh mhshow-suffix-application/x-tar: .tar mhshow-suffix-application/x-texinfo: .texinfo mhshow-suffix-application/x-tex: .tex mhshow-suffix-application/x-troff-man: .man mhshow-suffix-application/x-troff-me: .me mhshow-suffix-application/x-troff-ms: .ms mhshow-suffix-application/x-troff: .t mhshow-suffix-application/zip: .zip mhshow-suffix-audio/basic: .au mhshow-suffix-audio/midi: .midi mhshow-suffix-audio/mpeg: .mp3 mhshow-suffix-audio/mpeg: .mpg mhshow-suffix-audio/x-ms-wma: .wma mhshow-suffix-audio/x-wav: .wav mhshow-suffix-image/gif: .gif mhshow-suffix-image/jpeg: .jpeg mhshow-suffix-image/jpeg: .jpg mhshow-suffix-image/png: .png mhshow-suffix-image/tiff: .tif mhshow-suffix-image/tiff: .tiff mhshow-suffix-text/calendar: .ics mhshow-suffix-text/css: .css mhshow-suffix-text/html: .html mhshow-suffix-text/rtf: .rtf mhshow-suffix-text/sgml: .sgml mhshow-suffix-text/xml: .xml mhshow-suffix-video/mpeg: .mpeg mhshow-suffix-video/mpeg: .mpg mhshow-suffix-video/quicktime: .moov mhshow-suffix-video/quicktime: .mov mhshow-suffix-video/quicktime: .qt mhshow-suffix-video/quicktime: .qtvr mhshow-suffix-video/x-msvideo: .avi mhshow-suffix-video/x-ms-wmv: .wmv EOF # I'd like to check if netscape is available and use it preferentially to lynx, # but only once I've added a new %-escape that makes more permanent temp files, # so netscape -remote can be used (without -remote you get a complaint dialog # that another netscape is already running and certain things can't be done). PGM="`$SEARCHPROG $SEARCHPATH lynx`" if [ ! -z "$PGM" ]; then echo "mhshow-show-text/html: %p$PGM '%F'" >> $TMP fi PGM="`$SEARCHPROG $SEARCHPATH richtext`" if [ ! -z "$PGM" ]; then echo "mhshow-show-text/richtext: %p$PGM -p '%F'" >> $TMP else PGM="`$SEARCHPROG $SEARCHPATH rt2raw`" if [ ! -z "$PGM" ]; then echo "mhshow-show-text/richtext: %p$PGM < '%f' | fmt -78 | more" >> $TMP fi fi # staroffice to read .doc files PGM="`$SEARCHPROG $SEARCHPATH soffice`" if [ ! -z "$PGM" ]; then echo "mhshow-show-application/msword: %psoffice '%F'" >> $TMP echo "mhshow-suffix-application/msword: .doc" >> $TMP fi # output a sorted version of the file sort < $TMP exit 0 : not until we get a "safe" postscript environment... PGM="`$SEARCHPROG $SEARCHPATH pageview`" if [ "$DISPLAY" = "unix:0.0" -a ! -z "$PGM" ]; then echo "mhshow-show-application/PostScript: %p$PGM -" >> $TMP else PGM="`$SEARCHPROG $SEARCHPATH gs`" if [ ! -z "$PGM" ]; then echo "mhshow-show-application/PostScript: %p$PGM -- '%F'" >> $TMP echo "mhshow-suffix-application/PostScript: .ps" >> $TMP fi fi : have to experiment more with this PGM="`$SEARCHPROG $SEARCHPATH ivs_record`" if [ ! -z "$PGM" ]; then echo "mhbuild-compose-application/x-ivs: $PGM -u localhost '%F'" >> $TMP fi nmh-1.5/etc/mhn.find.sh000755 007761 000765 00000001251 11713401273 014703 0ustar00kenhkenh000000 000000 #! /bin/sh # # mhn.find.sh -- check if a particular command is available # if test -z "$2"; then echo "usage: mhn.find.sh search-path program" 1>&2 exit 1 fi # PATH to search for programs SEARCHPATH=$1 # program to search for PROGRAM=$2 PGM= oIFS="$IFS" IFS=":" for A in $SEARCHPATH; do # skip the directories `.' and `..' if test "$A" = "." -o "$A" = ".."; then continue fi # if program was found in /usr/local/bin, then # just echo program name, else echo full pathname if test -f "$A/$PROGRAM"; then if test "$A" = "/usr/local/bin"; then PGM="$PROGRAM" else PGM="$A/$PROGRAM" fi echo "$PGM" exit 0 fi done IFS="$oIFS" nmh-1.5/etc/mts.conf.in000644 007761 000765 00000001737 11762736345 014752 0ustar00kenhkenh000000 000000 # # nmh mail transport interface customization file. # # Check the mh-tailor(5) man page for descriptions of available options. # # The delivery method to use. Supported values are `smtp' and `sendmail'. # When `smtp', nmh will open a socket connection to the mail port on the # machine specified below, and speak SMTP directly. # When `sendmail', nmh will pipe messages directly to the sendmail program. mts: %mts% # Name that nmh considers `local'. If not set, nmh will # query the system for this value (gethostname, etc...). #localname: foo.bar.com # Default location of mail drops. If this option is # set, but empty, the user's home directory is used. mmdfldir: %mailspool% # The name of the maildrop file in the directory where maildrops # are kept. If this is empty, the user's login name is used. mmdflfil: # Hardcoded POP server name (prevents inc'ing from local mail spool). #pophost: localhost # List of smtp servers to try if using smtp support servers: %smtpservers% nmh-1.5/etc/rcvdistcomps000644 007761 000765 00000000124 11476006206 015307 0ustar00kenhkenh000000 000000 %(lit)%(formataddr{addresses})\ %<(nonnull)%(void(width))%(putaddr Resent-To: )\n%> nmh-1.5/etc/rcvdistcomps.outbox000644 007761 000765 00000000150 11476006206 016625 0ustar00kenhkenh000000 000000 %(lit)%(formataddr{addresses})\ %<(nonnull)%(void(width))%(putaddr Resent-To: )\n%>\ Resent-Fcc: outbox nmh-1.5/etc/replcomps000644 007761 000765 00000002475 11762736345 014622 0ustar00kenhkenh000000 000000 %; %; replcomps - our default component file for "repl" %; %; %; First, output a "From" header. %(void(localmbox))%(void(width))%(putaddr From: ) %; %; These next lines slurp in lots of addresses for To: and cc:. %; Use with repl -query or else you may get flooded with addresses! %; %; If no To:/cc:/Fcc: text, we output empty fields for prompter to fill in. %; %(lit)%(formataddr{reply-to})\ %(formataddr %<{from}%(void{from})%|%(void{apparently-from})%>)\ %(formataddr{resent-to})\ %(formataddr{prev-resent-to})\ %(formataddr{x-to})\ %(formataddr{apparently-to})\ %(void(width))%(putaddr To: ) %(lit)%(formataddr{to})\ %(formataddr{cc})\ %(formataddr{x-cc})\ %(formataddr{resent-cc})\ %(formataddr{prev-resent-cc})\ %(formataddr(localmbox))\ %(void(width))%(putaddr cc: ) Fcc: %<{fcc}%{fcc}%|+outbox%> Subject: %<{subject}Re: %(void{subject})%(trim)%(putstr)%> %; %; Make References: and In-reply-to: fields for threading. %; Use (void), (trim) and (putstr) to eat trailing whitespace. %; %<{message-id}In-reply-to: %{message-id}\n%>\ %<{message-id}References: \ %<{references}%(void{references})%(trim)%(putstr) %>\ %(void{message-id})%(trim)%(putstr)\n%>\ Comments: In-reply-to \ %<{from}%(void{from})%?(void{apparently-from})%|%(void{sender})%>\ %(trim)%(putstr)\n\ message dated "%<(nodate{date})%{date}%|%(tws{date})%>." -------- nmh-1.5/etc/replgroupcomps000644 007761 000765 00000002502 11762736345 015666 0ustar00kenhkenh000000 000000 %; replgroupcomps %; %; form (components) file for `repl -group' %; %; Check the following headers to create reply addresses. %; %; To: Mail-Followup-To %; %; OR %; %; To: Mail-Reply-To (or) %; Reply-To (or) %; From (or) %; Sender (or) %; Return-Path %; %; AND %; %; cc: To (and) %; cc (and) %; personal address %; %(void(localmbox))%(void(width))%(putaddr From: ) %(lit)%(formataddr{mail-followup-to})\ %<(nonnull)%(void(width))%(putaddr To: )\n\ %|\ %(lit)%(formataddr %<{mail-reply-to}%?{reply-to}%?{from}%?{sender}%?{return-path}%>)\ %<(nonnull)%(void(width))%(putaddr To: )\n%>\ %(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(localmbox))\ %<(nonnull)%(void(width))%(putaddr cc: )\n%>%>\ %; Fcc: %<{fcc}%{fcc}%|+outbox%> Subject: %<{subject}Re: %(void{subject})%(trim)%(putstr)%> %; %; Make References: and In-reply-to: fields for threading. %; Use (void), (trim) and (putstr) to eat trailing whitespace. %; %<{message-id}In-reply-to: %{message-id}\n%>\ %<{message-id}References: \ %<{references}%(void{references})%(trim)%(putstr) %>\ %(void{message-id})%(trim)%(putstr)\n%>\ Comments: In-reply-to \ %<{from}%(void{from})%?(void{apparently-from})%|%(void{sender})%>\ %(trim)%(putstr)\n\ message dated "%<(nodate{date})%{date}%|%(tws{date})%>." -------- nmh-1.5/etc/scan.default000644 007761 000765 00000000707 11476006206 015145 0ustar00kenhkenh000000 000000 %; scan.default %; %; This file is supplied for reference only; it shows the default %; format string (for non-UK sites) which was compiled into the %; command "scan". See the source file "h/scansbr.h" for details. %; %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}>>%> nmh-1.5/etc/scan.mailx000644 007761 000765 00000000421 11476006206 014624 0ustar00kenhkenh000000 000000 %<(cur)>%| %>\ %<{status} %|N%>\ %<{replied}R%?{encrypted}E%| %>\ %4(msg) \ %<(mymbox{from})%<{to}To: %13(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %3(day{date}) %3(month{date}) %02(mday{date}) \ %02(hour{date}):%02(min{date}) \ %(decode{subject}) nmh-1.5/etc/scan.MMDDYY000644 007761 000765 00000000573 11476006206 014525 0ustar00kenhkenh000000 000000 %; scan.MMDDYY %; %; Like scan.default, but the date is printed in MM/DD/YY format rather than %; MM/DD. %; %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})/%(void(year{date}))%02(modulo 100)%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}>>%> nmh-1.5/etc/scan.nomime000644 007761 000765 00000000572 11476006206 015005 0ustar00kenhkenh000000 000000 %; scan.nomime %; %; This file is a modification of the standard (non-UK version) %; format for scan, that doesn't do any RFC-2047 decoding of %; header components. %; %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(friendly{to})%>%>%<(zero)%17(friendly{from})%> \ %{subject}%<{body}<<%{body}>>%> nmh-1.5/etc/scan.size000644 007761 000765 00000000365 11476006206 014473 0ustar00kenhkenh000000 000000 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %5(size) \ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}%> nmh-1.5/etc/scan.time000644 007761 000765 00000000434 11476006206 014454 0ustar00kenhkenh000000 000000 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date}) \ %02(hour{date}):%02(min{date})%3(tzone{date})\ %<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}%> nmh-1.5/etc/scan.timely000644 007761 000765 00000000624 11476006206 015022 0ustar00kenhkenh000000 000000 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %(void(rclock{date}))\ %<(gt 15768000)%03(month{date})%(void(year{date}))%02(modulo 100)\ %?(gt 604800)%02(mday{date})%03(month{date})\ %?(gt 86400) %(day{date}) %|\ %02(hour{date}):%02(min{date})%>\ %<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}%> nmh-1.5/etc/scan.unseen000644 007761 000765 00000000374 11476006206 015016 0ustar00kenhkenh000000 000000 %4(msg)%<(cur)+%| %>%<(unseen)U%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}>>%> nmh-1.5/etc/scan.YYYYMMDD000644 007761 000765 00000000553 11476006206 015005 0ustar00kenhkenh000000 000000 %; scan.YYYYMMDD %; %; Like scan.default, but the date is printed in YYYY-MM-DD format rather than %; MM/DD. %; %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %4(year{date})-%02(mon{date})-%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ %<(zero)%17(decode(friendly{from}))%> \ %(decode{subject})%<{body}<<%{body}>>%> nmh-1.5/etc/sendfiles.in000755 007761 000765 00000003314 11713401273 015154 0ustar00kenhkenh000000 000000 #!/bin/sh # # Send multiples files and/or directories as a tar/compressed # image, in a MIME message. # DELAY=0 FROM= # compression method (none, gzip or compress) METHOD=none # compression filter COMPRESS=cat # uncompression filter UNCOMPRESS=cat # compression description to append to content-type CONVERSION= # default compression method based on installed software # prefer compress over gzip for backward compatibility if command -v compress >/dev/null 2>&1 ; then METHOD=compress elif command -v gzip >/dev/null 2>&1 ; then METHOD=gzip fi # handle command-line options to override compression method and delay while [ $# -gt 3 ]; do case "$1" in -gzip) METHOD=gzip shift ;; -compress) METHOD=compress shift ;; -none) METHOD=none shift ;; -*) DELAY="`echo $1 | sed -e 's%-%%'`" shift ;; *) break ;; esac done # set variables based on chosen compression method if [ $METHOD = compress ]; then COMPRESS=compress UNCOMPRESS=uncompress CONVERSION="; x-conversions=compress" elif [ $METHOD = gzip ]; then COMPRESS="gzip -c" UNCOMPRESS="gzip -dc" CONVERSION="; x-conversions=gzip" fi if [ ! -z "$PERSON" ]; then FROM="-from $PERSON" fi if [ $# -lt 3 ]; then echo 'usage: sendfiles: "mailpath" "subject-string" directory-or-file ...' 1>&2 exit 1; fi mailpath="$1" echo "mailpath = $mailpath" 1>&2 shift subject="$1" echo "subject-string = $subject" 1>&2 shift echo "files = $*" 1>&2 tar cvf - "$@" | $COMPRESS | \ %libdir%/viamail -to "$mailpath" -subject "$subject" \ -parameters "type=tar$CONVERSION" \ -comment "extract with $UNCOMPRESS | tar xvpf -" \ -delay "$DELAY" \ -verbose $FROM nmh-1.5/docs/ChangeLog_MH-3_to_MH-6.6000644 007761 000765 00000456277 11476006206 016744 0ustar00kenhkenh000000 000000 MHCHANGES from MH 6.1 to MH 6.6 [It appears that there may be some undocumented changes to MH 6.6 that should appear here. --Dan Harkless] Sun Jan 4 11:16:54 1987 /mtr uip/mhlsbr.c: "extras" hack for Elz Sat Jan 3 15:03:00 1987 /mtr h/formatsbr.h: parenthesize better, use case-sensitive in bucket search since hashing is case-sensitive uip/{rcvdist,replsbr}.c: CT_ADDR hacks Sat Jan 3 13:11:22 1987 /mtr conf/config/mts.c, mts/sendmail/hosts.c: BIND fix-up Fri Jan 2 23:41:19 1987 /mtr uip/rcvdist.c: touch-ups to sync with replsbr.c uip/scansbr.c: trash trailing whitespace in header components for formating Fri Jan 2 18:43:09 1987 /mtr zotnet/tws/dtimep.lex: ctime w/o TZ hack Fri Jan 2 18:42:55 1987 /mtr uip/dropsbr.c: fixes uip/msh.c, support/pop/popser.c: ditto Mon Dec 22 12:32:45 1986 /mtr (agent: Marshall Rose) -- From Stanford -- h/dropsbr.h, uip/dropsbr.c, support/pop/popser.c: support LAST command in POP service uip/{inc,mshcmds}.c: ditto Mon Dec 15 11:11:32 1986 /mtr (agent: Marshall Rose) uip/post.c: patch for MMDF-IIb submit Wed Dec 3 22:03:58 1986 /mtr support/pop/popd.c: minor fix Tue Dec 2 13:57:41 1986 /mtr (agent: Marshall Rose) support/bboards/bbtar.c: fix for sequent machines Sat Nov 22 20:36:31 1986 /mtr uip/bbc.c: set up time-bomb after HUP Fri Nov 21 14:33:28 1986 /mtr (agent: Marshall Rose) sbr/smatch.c: deref null bug Fri Nov 14 17:25:23 1986 /mtr conf/doc/mhook: typo found by Phyl Mon Nov 10 16:57:41 1986 /mtr (agent: Marshall Rose) -- More stuff from Jef -- zotnet/tws/dtimep.lex: default timezone to localone one Mon Nov 10 08:12:16 1986 /mtr -- Stuff from Jef Poskanzer -- uip/forw.c: add -[no]dashmunging, a hidden option uip/mhlsbr.c: add -[no]dashmunging, a hidden option {conf/doc/mhl.rf,uip/mhlsbr.c}: add [no]split variable Mon Nov 3 15:21:38 1986 /mtr (agent: Marshall Rose) sbr/m_sync.c: fix for sequent machines Mon Nov 3 14:11:48 1986 /mtr (agent: Marshall Rose) uip/msgchk.c: another SUN fix Thu Oct 30 13:03:02 1986 /mtr (agent: Marshall Rose) uip/{rcvtty,ttyw}.c: if no BSD42, turn off TTYD Thu Oct 30 12:57:52 1986 /mtr (agent: Marshall Rose) sbr/formataddr.c, uip/replsbr.c: another realloc() bug found by Terry West Thu Oct 9 12:52:41 1986 /mtr (agent: Marshall Rose) h/mh.h: make ruserpass nonsense based on NFS not SUN Wed Oct 8 15:59:05 1986 /mtr (agent: Marshall Rose) uip/vmh.c: more SYS5 mods from Bob Desinger Mon Oct 6 12:07:02 1986 /mtr (agent: Marshall Rose) conf/examples/encore: config file for Encore Multimax, from Mike Iglesias of UCI Thu Oct 2 12:37:57 1986 /mtr support/pop/popd.c: fixes for 4.3BSD set setsockopt Mon Sep 8 12:47:58 1986 /mtr (agent: Marshall Rose) conf/config/MakeBBoards: smarter Fri Sep 5 14:02:36 1986 /mtr (agent: Marshall Rose) zotnet/bboards/bboards.h: add BB_SEEN to fix list-handling bug in bbc uip/bbc.c: use it Fri Sep 5 09:40:35 1986 /mtr (agent: Marshall Rose) uip/msh.c: add hidden "advance" command uip/wmh.c: use it Fri Sep 5 09:08:17 1986 /mtr (agent: Marshall Rose) mts/sendmail/smail.c: define discard() as void Tue Sep 2 15:27:34 1986 /mtr uip/{bbc,burst,popsbr}.c: ULTRIX loses on ferror() vs. feof() sbr/vfgets.c: ditto Fri Aug 29 09:08:15 1986 /mtr (agent: Marshall Rose) uip/wmh.c: for pTTY() make original window the top one Thu Aug 28 19:39:47 1986 /mtr (agent: Marshall Rose) uip/send.c: handle dist in a read-only folder support/pop/popser.c: anonymous fix for DPOP/BPOP Wed Aug 20 17:23:39 1986 /mtr (agent: Marshall Rose) uip/mhlsbr.c: a bit less demanding on errors when processing the face Wed Aug 20 14:16:12 1986 /mtr (agent: Marshall Rose) conf/config/MakeBBoards: smarter rule Mon Aug 18 10:38:34 1986 /mtr (agent: Marshall Rose) uip/wmh.c: new program--Windowing MH for Integrated Solutions Graphics Workstations; not standardly installed for now since requires special load libraries conf/doc/wmh.rf: man page conf/makefiles/uip: support wmh Fri Aug 15 23:01:06 1986 /mtr sbr/advertise.c: slight touch-up Fri Aug 15 13:58:25 1986 /mtr (agent: Marshall Rose) uip/vmh.c: slight clean-up Thu Aug 14 22:25:23 1986 /mtr support/general/replcomps: add return-path to To: list Tue Aug 12 10:54:47 1986 /mtr (agent: Marshall Rose) support/pop/popser.c: small fix from Dave Cohrs Tue Aug 12 10:53:47 1986 /mtr (agent: Marshall Rose) uip/mhlsbr.c: finally stabilize it Mon Aug 11 10:10:33 1986 /mtr (agent: Marshall Rose) uip/mhlsbr.c: choose default face from from: line Fri Aug 8 12:57:35 1986 /mtr (agent: Marshall Rose) conf/config/config.c, h/mh.h, sbr/m_readefs.c, uip/mhlsbr.c: add support for "faceproc" Sun Jul 27 11:52:37 1986 /mtr conf/doc/show.rf: typos Tue Jul 15 20:26:05 1986 /mtr papers/{bboards/bboards,tutorial/tutorial}.tex: botched MTR's address Fri Jul 11 10:50:31 1986 /mtr MH 6.5 official, out of beta, released for UCI distribution Tue Jul 8 10:50:39 1986 /mtr uip/scansbr.c: split-up a statement for the RT compiler conf/mh-gen.8: add some stuff on POP conf/doc/{ADMIN,popaka}.rf: ditto Sun Jun 29 21:11:30 1986 /mtr sbr/addrsbr.c: yet another fix for the SUN (yaffts) conf/mhconfig.c: if both mts/smtp and options BERK, turn off SMTP Mon Jun 23 20:45:35 1986 /mtr uip/vmh.c: Bob gives us another sys5 fix Thu Jun 19 19:51:43 1986 /mtr zotnet/tws/dtimep.lex: fix spelling for august Wed Jun 18 19:57:09 1986 /mtr uip/vmh.c: sanitize for 8-bit whacko characters Wed Jun 18 11:05:40 1986 /mtr support/bboards/bbexp.c: create archives in BBMODE format, private bboards should have archives created by the BBoards user (just like the standard file) Tue Jun 17 15:23:27 1986 /mtr h/mh.h: add vfork for hpux Tue Jun 17 14:21:08 1986 /mtr uip/scan.c: forgot to make -header always force ATZ behavior Tue Jun 17 10:44:06 1986 /mtr uip/trmsbr.c: no TIOCGWINSZ working on 4.2BSD ULTRIX! Mon Jun 16 19:56:09 1986 /mtr sbr/{m_gmsg,pwd}.c, uip/{bbl,conflict,folder,rmf}.c: add NDIR compile-time option if -lndir include file is called instead of (non BSD systems) h/local.h: new file to make this easier Sun Jun 15 14:20:10 1986 /mtr h/scansbr.h, support/general/scan.{timely,time,size}: remove JLR's fix since it doesn't work right Fri Jun 13 20:08:36 1986 /mtr uip/aliasbr.c: not testing for relative names correctly Fri Jun 13 15:28:10 1986 /mtr sbr/addrsbr.c: another #ifdef BERK fix for the SUN Fri 13 Jun 86 10:29 John Romine h/scansbr.h, support/general/scan.{timely,time,size}: add ">>" at end of body in format string Tue 10 Jun 86 15:34 John Romine h/scansbr.h: eliminate superfluous space from default format string Fri Jun 6 10:56:40 1986 /mtr miscellany/less/screen.c: handle HP terminals better Sun Jun 1 23:07:24 1986 /mtr uip/trmsbr.c: add sc_hardcopy() uip/mhlsbr.c: use it so we don't fork a more on hardcopy ttys conf/doc/mhl.rf: document it Thu May 29 23:42:54 1986 /mtr support/general/scan.mailx: mailx scan format from Bob Simpson of plus5 support/general/mhl.body: format from mtrenv Wed May 28 16:56:40 1986 /mtr conf/examples/nrtc-gremlin: add -125 switch for GHS compiler sbr/getans.c,uip/{mhlsbr,prompter,rcvtty,sendsbr}.c: a bit more careful with the setjmp() Wed May 28 12:44:21 1986 /mtr sbr/fmtcompile.c: allow literal '%'s in format files Tue May 27 19:35:38 1986 /mtr support/pop/popd.c: support for 4.3BSD syslog Thu May 22 15:08:06 1986 /mtr support/general/replcomps: typo Thu May 22 08:13:17 1986 /mtr conf/mh-gen.rf: update Thu May 22 08:05:03 1986 /mtr -- Two New Documents from UCI -- conf/makefiles/{papers,dist}: update dist/READ-ME: remove conf/doc/MH.rf: update papers/beginners: new paper "MH for Beginners" papers/mh4mm: new paper "MH for MM Users" Wed May 21 20:51:47 1986 /mtr conf/{mh-gen.8,doc/{ADMIN,MH}.rf, papers/*/*, COVER-LETTER: update mail addresses Wed May 21 10:10:21 1986 /mtr uip/{rcvdist,replsbr}.c: malloc/free fixes from Steve Smith Tue May 20 22:51:13 1986 /mtr -- From Steve Smith -- conf/examples/ridge: config file sbr/{m_gmsg,pwd}.c: although SYS5, uses uip/show.c: not null-terminating argvector uip/{bbc,vmh}.c: although SYS5, has SIGTSTP uip/sbboards.c: pre-emptive reference of discard to help SYS5 loader conf/{mh-gen.8,mhconfig.c}: add "oldload none" Tue May 20 19:09:15 1986 /mtr uip/scan.c: free'ing a static, tsk Thu May 15 17:09:34 1986 /mtr uip/msgchk.c, conf/doc/{mh-chart,msgchk}.rf: add -[no]date, and -[no]notify type switches Thu May 15 16:36:19 1986 /mtr uip/{inc,msgchk,post,send}.c: improve #define-dependent switches declarations Tue May 13 17:44:47 1986 /mtr sbr/{fmtcompile,formatsbr}.c, support/pop/popwrd.c, uip/{ap,inc,rcvtty,post,spost,whatnowsbr}.c: add some lint stuff conf/makefiles/uip: better lint support for TMA Tue May 13 15:14:07 1986 /mtr -- Some Fixes from Hokey -- uip/vmh.c: a few more SYS5 dependencies zotnet/tws/dtimep.lex: added #include strings.h conf/makefiles/zotnet/tws: added dependency for above uip/post.c: pre-emptive reference of discard to help SYS5 loader conf/examples/plus5: update miscellany/less/Makefile: add SHELL=/bin/sh sbr/m_getfld.c: slight redeclaration for SYS5 Tue May 13 07:59:36 1986 /mtr uip/replsbr.c: some fixes from Van Mon May 12 09:12:39 1986 /mtr sbr/m_getfld.c: new version of matchc() from Van that doesn't give the SUN indigestion Sun May 11 12:40:34 1986 /mtr miscellany/scripts/READ-ME: add amhmail description miscellany/scripts/amhmail.sh: new script Thu May 8 17:50:22 1986 /mtr support/bboards/bbexp.c: set the mode on the archive file if creating it, since m_gmprot() isn't a good default for this application Wed May 7 13:16:45 1986 /mtr uip/post.c: modification for fcc:s broke stand-alone behavior for daemons, etc.; use old method as a fall-back sbr/m_foil.c: also improve modification a bit support/pop/smtpd.c: dead weight Mon May 5 16:07:12 1986 /mtr support/bboards/mmdfII/bboards/bb_wtmail.c: patch for IDIOTIC change in qu_rtxt() Mon May 5 13:32:37 1986 /mtr uip/trmsbr.c: try Van's version for a while miscellany/patch: updates from Van Sun May 4 18:08:47 1986 /mtr MH 6.5 #1[UCI] (nrtc-gremlin) made available to Van Jacobson for inclusion in 4.3BSD UNIX Sun May 4 17:49:43 1986 /mtr sbr/pidwait.c, uip/{bbc,sendsbr,vmh}.c: back off signal handling modifications Sun May 4 16:10:36 1986 /mtr conf/doc/mh.rf: forgot about TMA stuff conf/makefiles/doc: forgot rcvstore Sun May 4 14:18:15 1986 /mtr support/general/replcomps: use %tws instead of %pretty support/general/mhl.*: streamline slight Sun May 4 13:28:23 1986 /mtr uip/msgchk.c: change the "last read" message to use alpha-timezones Sat May 3 02:49:29 1986 /mtr zotnet/tws/{tws.h,dtime.c,dtimep.lex}: fixes for DST conf/makefiles/zotnet/tws: add -n to lex's invocation Sat May 3 01:37:15 1986 /mtr sbr/{m_{sync,update},pidwait}.c, uip/{bbc,sendsbr,vmh}: inspired by Van's 4.2BSD signal optimizations Fri May 2 17:02:01 1986 /mtr uip/show.c: WHATNOW botch fixed by Jim Valerio Fri May 2 16:35:11 1986 /mtr -- More Bug Fixes from Van -- uip/scansbr.c: check return from fclose() uip/inc.c: avoid locking/stat race condition sbr/m_sync.c: lock signals out during update of sequences Thu May 1 15:30:07 1986 /mtr -- From Craig Partridge -- support/pop/mmdfII/pop/READ-ME: fixes Tue Apr 29 20:17:11 1986 /mtr conf/doc/mhook.rf: extra tip with SendMail and slocal Mon Apr 28 21:00:21 1986 /mtr -- Yet Another Fix from Terry -- uip/dropsbr.c: another typo Sun Apr 27 17:23:56 1986 /mtr uip/scansbr.c: recognition of 822 Encrypted: header a bit botched h/scansbr.h, support/general/scan.*: support encrypted Fri Apr 25 13:39:55 1986 /mtr -- From Craig Partridge -- support/bboards/mmdfII/bboards/getbbent.c: bad field in BBoards file causes hang, note it and skip! Fri Apr 25 10:47:19 1986 /mtr uip/trmsbr.c: use stdout (not stderr) for termcap checking Fri Apr 25 00:01:50 1986 /mtr conf/ADMIN.rf: slight touch-up Thu Apr 24 23:53:57 1986 /mtr -- From Craig Partridge -- support/bboards/mmdfII/bboards/*: bug fixes for MMDF-IIb conf/mh-gen.8: mention that MMDF-IIb has the BBoards distribution Thu Apr 24 20:13:28 1986 /mtr uip/msgchk.c: print out last read date conf/makefiles/uip: add tws dependency Thu Apr 24 19:37:09 1986 /mtr conf/doc/ADMIN.rf: typos Thu Apr 24 10:34:06 1986 /mtr zotnet/mts/lock.c: lint touch-up support/pop/popd.c: ditto Thu Apr 24 00:19:35 1986 /mtr conf/doc/mh-chart.rf: slight mods for TMA mods Mon Apr 21 17:31:43 1986 /mtr uip/{inc,post}.c: slight mods for TMA mods conf/doc/mh-chart.rf: ditto Mon Apr 21 10:22:09 1986 /mtr zotnet/mf/mf.c: sanity check in getadrx() on string to parse Thu Apr 17 20:51:53 1986 /mtr zotnet/mts/lock.c: add some more #ifdefs to support stand-alone locking library conf/examples/udel*: update papers/myths/: remove conf/makefile/papers: update Thu Apr 17 13:25:20 1986 /mtr sbr/addrsbr.c: fix from Terry West, more alternate-mailbox misery Mon Apr 14 23:52:03 1986 /mtr sbr/m_getfld.c: locc() not range checking on cnt Mon Apr 14 22:56:46 1986 /mtr support/bboards/bbexp.c: not ending msh correctly, msh tried to update the maildrop even though it was already locked by bbexp Sat Apr 12 16:32:21 1986 /mtr uip/post.c: try to keep fcc:s under MH-directory so links are maintained Thu Apr 10 15:06:59 1986 /mtr conf/config/bboards.*: mail reports to PostMaster Thu Apr 10 10:42:25 1986 /mtr uip/scansbr.c: recognize the 822 "Encrypted:" header instead of doing a uprf() on the body uip/{scan,mshcmds}.c: recognize SCNENC return from scan () Thu Apr 10 03:47:48 1986 /mtr sbr/m_getfld.c: Van fixes Marshall's fix Thu Apr 10 02:26:52 1986 /mtr Makefile: touch-up "make distribution" conf/examples/nrtc-*-mtr: remove conf/makefiles/uip: touch-up conf/doc/MH.rf: add TMA stuff, conditionally Wed Apr 9 22:08:37 1986 /mtr uip/vmh.c: output non-standard control characters in carat format Wed Apr 9 12:36:58 1986 /mtr -- MTR actually gets to fix something! -- sbr/m_getfld.c: messages with an empty body caused inc to prematurely think the maildrop had reached EOF. Believe it or not, the mhmail fix last month exercised this! Wed Apr 9 12:04:56 1986 /mtr -- Van fixes some more bugs -- sbr/m_getfld.c: not handling buffer boundary cases right uip/replsbr.c: not adding "," correctly when concatenating an address string during message scan sbr/formatsbr.c: mymbox test dumped core if address parse failed h/{fmtcompile,formatsbr}.h, sbr/{fmtcompile,formatsbr}.c: more enhancements Mon Apr 7 09:55:23 1986 /mtr mts/sendmail/smail.c: slight "client" check Sun Apr 6 19:22:52 1986 /mtr uip/inc.c: forgot to initialize some FILE*'s; dumps core on celerity Wed Apr 2 17:17:32 1986 /mtr sbr/addrsbr.c: slight typo in comment Mon Mar 31 15:07:26 1986 /mtr uip/replsbr.c: handle bad addresses with better diagnostics Sat Mar 22 18:24:35 1986 /mtr uip/mhmail.c: handle -body better Sat Mar 22 11:51:45 1986 /mtr -- Fixes from Phyllis Kantar -- uip/dropsbr.c: typo conf/doc/{send,pick}.rf: typos conf/makefiles/doc: forgot $(OPTIONSn) in $(MAN1) definition Fri Mar 21 21:12:39 1986 /mtr conf/doc/{MH,mh-format}.rf: typos Thu Mar 20 23:05:10 1986 /mtr uip/mhlsbr.c: mhl enhancement from JLR permitting a prefix string for each line of the body (e.g, "component=" > ") Wed Mar 19 23:12:54 1986 /mtr -- Changes for MMDF-IIb -- uip/post.c, support/bboards/mmdfII/bboards/bb_wtmail.c: know about new mm_winit protocol and RP_NS/RP_DOK responses Wed Mar 19 23:00:53 1986 /mtr support/pop/popser.c: one last fix for ENOENT mailboxes Sun Mar 16 15:20:27 1986 /mtr miscellany/mem: appointment diary support from Ken Yap Tue Mar 11 19:43:27 1986 /mtr h/dropsbr.h, uip/dropsbr.c: new routines mbx_read() and mbx_write() uip/{msh,mshcmds}.c, support/pop/popser.c: use it h/{addr,format,scan}sbr.h, sbr/addrsbr.c: slight touch-up uip/inc.c: slight touch-up Mon Mar 10 18:08:37 1986 /mtr uip/post.c: fix handling of (in)visible addresses uip/rcvdist.c: re-do to use format facility uip/{replsbr,forw}.c: touch-ups conf/config/config.c, h/mh.h: new variable rcvdistcomps conf/{makefiles/{uip,support/general},doc/mhook.rf}: update sbr/m_getfld.c: bstring() support for non BSD42, SYS5 systems conf/doc/ADMIN.rf: update Mon Mar 10 10:17:29 1986 /mtr {sbr/formatsbr,uip/scansbr}.c: more optimizations from Van! sbr/m_getfld.c: Van fixes problems due to losing vanilla-4.2 C optimizer! sbr/m_getfld.c: slight touch-up by MTR uip/bbc.c: remove #ifdef MTR bracketing, code works fine uip/refile.c: slight touch-ups sbr/m_getfld.c: on xxxERR returns, forgetting to zero value buffer Mon Mar 10 00:43:19 1986 /mtr uip/{msh,mshcmds}.c: packf hack, ala refile hack uip/{post,rcvdist}.c, support/bboards/mmdfII/bboards/bb_wtmail.c: MMDF-II nameserver support from Steve Kille Sun Mar 9 20:09:35 1986 /mtr zotnet/bboards/bboards.h: add BB_REMOTE flag for bbc uip/bbc.c: support BB_REMOTE, under #ifdef MTR for the moment uip/bbc.c: allow bb_aka (again?!?) Sun Mar 9 18:52:37 1986 /mtr h/scansbr.h, support/general/{digestcomps,mhl.forward,scan.*}: update Sun Mar 9 14:06:54 1986 /mtr h/scansbr.h, sbr/fmtcompile.c: better versions from Van support/general/{replcomps,scan.timely}: better versions from Van (snuck the %pretty instead of %tws in, eh Van?) support/general/{digestcomps,mhl.forward,scan.{size,time}}: update Sun Mar 9 14:04:26 1986 /mtr conf/mh-gen.8: add a line about chown and sys5 sbr/m_convert.c: better BADRNG diagnostic uip/mshcmds.c: oops, typo Thu Mar 6 13:36:26 1986 /mtr uip/addrsbr.c: yet another fix for ismymbox() uip/replsbr.c: #ifdef ISI code to avoid duplicate replies (due to Jim Koda) Wed Mar 5 12:48:58 1986 /mtr dist/READ-ME: oops, forgot usenix name change conf/makefiles/uip: hmm, interesting loader problem Tue Mar 4 09:53:31 1986 /mtr papers/usenix/: change to realwork/ Tue Mar 4 08:15:17 1986 /mtr -- Van sends fixes to my updates -- uip/mhlsbr.c: not resetting mhlsbr for formatting zotnet/tws/dtimep.lex: not getting MIL-TZ's right Mon Mar 3 16:53:19 1986 /mtr uip/sendsbr.c: oops, close() on an uninitialized variable! (thanks to Jim Koda) Mon Mar 3 10:18:40 1986 /mtr -- Van sends fixes to my updates -- uip/mshcmds.c: not resetting scansbr for formatting uip/scansbr.c: oops, typo! Thu Feb 27 22:16:43 1986 /mtr sbr/formataddr.c: remove sbr/addrsbr.c: Van doesn't like "user*" instead of "user" as the default is-my-mailbox for BERK. Since he's the BERK-author, I'll assume he knows what he's doing... support/general/replcomps: Use "tws", instead of "pretty" for in-reply-to: uip/whatnowsbr.c: If -draft{folder,message} and -nodraftfolder are added as no-ops, make them "hidden" from -help output uip/{{a,d}p,forw,mhlsbr}.c: update Thu Feb 27 22:12:53 1986 /mtr -- Van sends updates -- conf/makefiles/uip, h/fmtcompile.h, sbr/{format{addr,sbr},fmtcompile,addrsbr}.c, support/general/replcomps, uip/{repl,mhl,scan,whatnow}sbr.c Wed Feb 26 21:05:46 1986 /mtr uip/sendsbr.c: better diagnostics when post fails Tue Feb 25 17:45:28 1986 /mtr h/mshsbr.h, uip/msh*.c: add direct folder support for symmetry's sake, ugh! Tue Feb 25 09:47:09 1986 /mtr uip/{scan,mshcmds}.c: slight touch-ups uip/mhlsbr.c: fix up SIGPIPE handling, again support/general/scan.time: fix up for numeric timezone uip/scansbr.c: re-support "encrypted" uip/msh.c: add "exit" command for Dave Farber miscellany/convert: new directory Tue Feb 25 08:08:43 1986 /mtr uip/burst.c: another realloc() fix from Terry West sbr/vfgets.c: ditto support/pop/popser.c: enhancmenets from Dave Cohrs conf/doc/pop5.rf: document it conf/mhconfig.c: support "debug" directive makefiles/*: use it Mon Feb 24 17:14:39 1986 /mtr uip/inc.c: have -host/-file ask if file doesn't exist uip/{packf,mshcmds}.c: ditto Sun Feb 23 13:59:46 1986 /mtr sbr/m_gmsg.c: big bug fix from Terry West. Thanks, Terry! h/strings.h: System5 bcopy-equivalents from Doug Gwyn zotnet/tws/tws.h: support #ifdef ATZ conf/makefiles/uip: slight lint botch Thu Feb 20 22:57:33 1986 /mtr MH 6.4 #1[UCI] (nrtc-gremlin) made available to Van Jacobson for inclusion in 4.3BSD UNIX Thu Feb 20 19:55:20 1986 /mtr uip/mhlsbr.c: add formatsbr support sbr/addrsbr.c: use better default matching in ismymbox miscellany/mtrenv: update support/general/mhl.*: update Thu Feb 20 08:07:49 1986 /mtr uip/{a,d}p.c: start working on it h/formatsbr.h: new variable fmt_norm sbr/formatsbr.c: use it h/fmtcompile.c, sbr/{fmtcompile,formatsbr}.c: define "pretty" sbr/formataddr.c: sight touch-up uip/formatsbr.c: oops, bug in PUTD() uip/{fmtcompile,formatsbr}.c: init mn structures in case of error. This is still buggy since: 1) the structure still doesn't get reset on errors, and 2) you can still dereference nulls zotnet/tws/dtimep.lex: slight touch-up Wed Feb 19 10:50:04 1986 /mtr papers/mh6.4: new interim documentation directory, for 4.3BSD conf/doc/{MH,ap,dp,mh,mh-chart,mhl,repl,scan}.rf: update conf/doc/mh-format.rf: new file support/general/replcomps: oops, should call formataddr on all addrs Wed Feb 19 03:11:42 1986 /mtr sbr/{formataddr,fmtcompile,m_{draft,getfld,maildir},printsw,pwd}.c: lint it uip/{formatsbr,forw,msh,replsbr,scan,scansbr,spost}.c: lint it support/pop/popser.c: lint it sbr/formatsbr.c: remove MHFMTDEBUG code */Makefile: depend 'em Wed Feb 19 01:55:40 1986 /mtr h/mh.h: add msg_* vars in m_getfld() as externs uip/{msh,{repl,scan}sbr}.c: remove msg_* declarations sbr/m_getfld.c: add a bit of BODYEOF support (without slowing it down, wouldn't want to upset Van!) Wed Feb 19 00:56:30 1986 /mtr sbr/m_getfld.c: different fix for packf'd files from Van Wed Feb 19 00:16:55 1986 /mtr uip/dist.c, support/general/distcomps, sbr/fmtcompile.c: updates from Van sbr/formatsbr.c: remove ismymbox prime sbr/fmtcompile.c: use adios(), not exit()! Tue Feb 18 22:14:51 1986 /mtr sbr/m_getfld.c: eom_action() lacking argument sbr/m_getfld.c: not working right on packf'd files uip/{msh,mshcmds}.c: under BPOP, need to fix things so m_getfld() doesn't dump core! Tue Feb 18 02:15:00 1986 /mtr uip/bbc.c: upgrade for new m_getfld() support/general/scan.*, h/scansbr.h: still more changes support/general/replcomps: still more changes Tue Feb 18 01:13:51 1986 /mtr h/formatsbr.h: updates from Van Mon Feb 17 20:14:35 1986 /mtr support/general/scan.{time,size}: mday/month inverted sbr/{formatsbr,fmtcompile}.c: bring upto date with MH 6.3+ sbr/formatsbr.c: missing tzone/sday/dst handling! h/scansbr.h: slight update uip/scansbr.c: try using formataddr() routine to do "correct" formatting of scan'd addresses, didn't work! use friendly zotnet/tws/dtimep.lex: tsk, use lint! also, fix numeric timezones sbr/addrsbr.c: some ismymbox fixes for non-BERK code (from 6.3) sbr/formatsbr.c: not priming the pump! h/fmtcompile.h, sbr/{formatsbr,fmtcompile}.c: add "friendly" support/general/scan.time2: call it scan.timely conf/makefiles/support/general: support scan.timely Sun Feb 16 23:04:34 1986 /mtr zotnet/fmt/: move into sbr/ to avoid loading problems sbr/{addrsbr,formatsbr,fmtcompile,formataddr}.c: new files h/fmtcompile.h: new file conf/makefiles/{sbr,zotnetM}: update sbr/llib-lmh: update Sun Feb 16 19:11:33 1986 /mtr -- Incorporate Berkeley enhancements, courtesy of Van Jacobson -- h/{format,scan}sbr.h: updated for new formatsbr stuff h/mh.h: updated for new m_getfld conf/MH: new default file conf/config/config.c: support spost under BERK and SENDMTS conf/mhconfig.c: support new zotnet/fmt/ directory conf/makefiles/uip: support spost conf/makefiles/zotnetM: support new zotnet/fmt/ directory conf/makefiles/zotnet/fmt: new Makefile conf/makefiles/zotnet/tws: support for new lex-based date parser sbr/m_gmsg.c,uip/msh.c: change init of READONLY sbr/m_getfld.c: re-written, super optimized! support/general/{digestcomps,mhl.digest,mhl.forward,scan.*}: use new fmt stuff zotnet/fmt/: new directory zotnet/tws/{dtimep.lex,lexedit.sed,lexstring.c}: new files zotnet/tws/dtime.c: update uip/{forw,scan,scansbr}.c: use new format stuff uip/{inc,mhlsbr,mshcmds,replsbr}.c: use new format stuff uip/trmsbr.c: use stderr for ioctl()s uip/spost.c: new file uip/{addr,format}sbr.c: remove, they're in zotnet/fmt/ Sun Feb 16 15:40:20 1986 /mtr sbr/m_setvis.c: oops, fix-up unseen sequence stuff uip/whatnowsbr.c: oops, a couple of typos Sun Feb 9 22:14:10 1986 /mtr support/pop/syslog.c: #ifdef BSD43 means use standard syslog Wed Feb 5 14:42:55 1986 /mtr zotnet/tws/{tws.h,dtime.c}: new argument to dasctime() uip/{format,pick}sbr.c: make use of it Wed Feb 5 11:25:05 1986 /mtr MH 6.3 #1[UCI] (nrtc-gremlin) is official, still awaiting Berkeley enhancements Wed Feb 5 09:32:08 1986 /mtr support/bboards/mmdfII/READ-ME: update Mon Feb 3 11:21:49 1986 /mtr uip/whatnowsbr.c: oops, slight dist botch support/general/mhl.format: make date display user-friendly conf/mh-gen.8: clean-up descriptions of options uip/sbboards.c: normalize code wrt to MMDF-II BBoards channel uip/msh.c: when running under vmh and not in control of TTY, ignore TSTP so BPOP can spool ahead! papers/{usenix/usenix,multifarious/multifarios,trusted/trusted}.tex: fix up banners a bit Sun Feb 2 20:47:36 1986 /mtr miscellany/replies/: new directory Sun Feb 2 14:01:28 1986 /mtr zotnet/tws/dtime.c: twsort() fix from John Romine for ALTOS uip/addrsbr.c: smarter ismymbox for default case conf/{mh-gen.8,doc/repl.rf}, uip/repl.c: add #ifdef ATHENA code Fri Jan 31 13:25:17 1986 /mtr COVER-LETTER: update support/general/mhl.format: Remove length/width constraints Mon Jan 27 17:51:07 1986 /mtr uip/whatnowsbr.c: forgot to put -[no]push for built-in send h/addrsbr.h, uip/{addrsbr,post}.c: introduce auxformat(), the back-end to adrformat(); post calls auxformat directly in certain cases uip/{dp,forw}.c: was cheating on adrformat, now on auxformat Sun Jan 26 16:57:18 1986 /mtr {conf/makefiles/uip,uip/post.c}: lint touch-up conf/doc/{inc,mh-chart,send,post}.rf: add the #ifdef TMA stuff sbr/m_remsg.c: tuning uip/mark.c: re-arrange debug output slightly h/mh.h: add some padding to fix some m_remsg bugs uip/{inc,rcvstore}.c: oops, mp -> hghmsg not keeping pace with m_remsg! Wed Jan 22 11:13:08 1986 /mtr support/pop/popwrd.c: squash bug h/mh.h: remove sigmask definition uip/{bbc,vmh}.c: add sigmask if not defined in (4.3BSD finally wised up!) Fri Jan 17 13:19:23 1986 /mtr uip/ali.c: add -noalias for RaJ Wed Jan 15 23:15:54 1986 /mtr support/pop/popsbr.c: pophack on PASS command Wed Jan 15 19:03:54 1986 /mtr COVER-LETTER: update Wed Jan 15 18:44:32 1986 /mtr uip/addrsbr.c: ismymbox() losing under #ifdef DUMB, oops! Wed Jan 15 04:43:33 1986 /mtr miscellany/netnews/: more stuff Sun Jan 12 22:58:34 1986 /mtr uip/bbc.c: getbbvis a bit too agressive, use popd algorithm Sun Jan 12 14:01:25 1986 /mtr miscellany/mh-e: new version from James Larus Fri Jan 10 10:17:57 1986 /mtr uip/sbboards.c: botch multiple bboard handling (forgot to rewind input, thanks to Larry Henry) support/bboards/mmdfII/bboards/bb_wtmail.c: not handling errors right sbr/cpydgst.c: stay symmetric with change to bb_wtmail.c, the code worked fine, adding matching braces for clarity (!!) Thu Jan 9 22:37:29 1986 /mtr MH 6.2 is official, awaiting enhancements Berkeley! Thu Jan 9 16:31:28 1986 /mtr uip/mshcmds.c: don't rmm() messages which don't get refiled uip/vmh.c: truncate stuff on Scan window (finally) uip/scansbr.c: work on diagnostics a bit Thu Jan 9 15:29:09 1986 /mtr -- Fixes Suggested by Craig Partridge -- support/bboards/mmdfII/bboards/mmdfonly.h: if V4_2BSD on, set BSD42 conf/doc/{mhl,show}.rf: talk more about moreproc uip/mhlsbr.c: have INTR work as advertised uip/{send,whatnowsbr}.c: link on dist botched, oops! Wed Jan 8 23:16:10 1986 /mtr uip/trmsbr.c: better defaults for "li" and "co" Tue Jan 7 15:06:05 1986 /mtr uip/bbc.c: got the SIGTSTP problem, now wait on child to stop prior to stopping ourselves... Mon Jan 6 15:25:20 1986 /mtr uip/{msh,mshcmds}.c: work on refile uip/{vmh,msh}.c: support FAST quit (no final refresh on updated mailbox) Sun Jan 5 20:06:03 1986 /mtr (agent: Marshall Rose) -- Interface TTI TMA to MH #6.2 -- [ N.B.: The TTI TMA is NOT in the public domain; the MH support for the TTI TMA IS in the public domain! ] conf/{mh-gen.8,mhconfig.c,doc/ADMIN.rf}: support "tma on" conf/makefiles/{doc,uip}: ditto Makefile: for the moment Fri Jan 3 13:11:03 1986 /mtr uip/bbc.c: SIGTSTP race condition, #undef for now Tue Dec 31 23:21:21 1985 /mtr uip/mhlsbr.c: a bit more pipe trickyness (this gets old real fast) conf/doc/ADMIN.rf: talk about popd and /etc/rc.local papers/{myths,mznet}/Makefile: update uip/bbc.c: augment XTND2 botch diagnostic uip/msh.c: if popd says BBoard-ID: for a message is 0, read it ourselves Tue Dec 31 22:23:43 1985 /mtr conf/doc/mhook.rf: minor typos miscellany/rcvtrip/*: update Tue Dec 31 19:16:23 1985 /mtr zotnet/tws/{dtime,dtimep}.c: dst fix-ups conf/doc/send.rf: append, not prepend uip/rmail.c: slight touch-up uip/ap.c: oops, not printing all info zotnet/mf/mf.c: botching trailing comment handling! uip/scansbr.c: have cpy() omit trailing >>blank<< sbr/m_gmsg.c: not zero'ing msgstats[] under non-MTR code Tue Dec 31 13:53:14 1985 /mtr conf/doc/whatnow.rf, uip/whatnowsbr.c: remove "headers" option conf/doc/ADMIN.rf: clear-up post -debug documentation conf/doc/{mh-chart,send,post}.rf, uip/{post,send,whatnowsbr}.c: remove -[no]remove switches uip/{repl,post}.c: some touch-ups Tue Dec 31 10:13:44 1985 /mtr conf/doc/vmh.rf: back-down last update conf/mh-gen.8: forgot an \& conf/examples/nrtc-{gw,mtr}, h/rcvmail.h: tsk, NRTC running an old MMDF-II Mon Dec 30 20:03:25 1985 /mtr conf/Makefile: options mangled(!?!) uip/msh.c: if update of mailbox fails, it gets zero'd(!!) (oops, not checking error condition) support/pop/popser.c: if update of mailbox fails, clean-up correctly (no zero problem here!) uip/inc.c: on truncate of maildrop, remove mailbox map (XXX) conf/makefiles/uip, uip/{send,whatnowsbr}.c: move send into the WhatNow shell uip/sendsbr.c: new file conf/doc/whatnow.rf: update Sun Dec 29 19:58:43 1985 /mtr zotnet/mts/client.c: fix #ifdef BIND stuff a bit h/mshsbr.h, uip/{mhlsbr,msh,mshcmds}.c: try to fix lost peer problems... conf/doc/vmh.rf: update zotnet/drop/lock.c: not returning right errno uip/dropsbr.c: ditto, plus not trying enough conf/makefiles/doc: "make tar" forgetting tmac.h uip/addrsbr.c: strcpy de-referencing NULL uip/refile.c: got rid of a spurious \n (!!) conf/examples/{udel,nrtc-mtr}: new files h/mh.h, sbr/m_{convert,gmsg}.c, uip/{msh,rcvstore,refile}.c: fix LOWSEL logic uip/vmh.c: fix slight bug in sideground handling (misspelled #ifdef, oops!) conf/{mh-gen.8,config/mts.c},mts/*/hosts.c: remove the NETWORK option Thu Dec 19 23:58:44 1985 /mtr Release MH 6.2 to selected sites, including Berkeley for 4.3BSD testing Thu Dec 19 22:34:23 1985 /mtr zotnet/mts/client.c: #ifdef BIND code when no gethostent() conf/{mh-gen.8,doc/mh-tailor.rf}: document it Thu Dec 19 08:16:54 1985 /mtr uip/refile.c: better diagnostic from Fred Blonder Wed Dec 18 22:51:58 1985 /mtr uip/bbc.c: optimize on calling mshproc, check size of maildrop first; if empty, don't invoke it! Wed Dec 18 20:27:38 1985 /mtr uip/slocal.c: minor touch up uip/umhook.c: moved from zotnet/mf Wed Dec 18 13:37:09 1985 /mtr uip/bbc.c: make second, optimized pass to catch private bboards that the user knows about uip/popsbr.c: ditto uip/popser.c: slight tune-up Tue Dec 17 21:42:44 1985 /mtr conf/makefiles/sbr, h/mh.h, sbr/llib-lmh: cndfree() removed sbr/{add,m_{delete,replace}}.c, uip/{mhl,vmh}sbr.c: replace cndfree sbr/m_foil.c, uip/install-mh.c: compensate Tue Dec 17 18:26:34 1985 /mtr sbr/m_getfld.c, uip/{format,mhl,pick}sbr.c: clean-up indirection code for less tolerant compilers uip/bbc.c: add -[no]rcfile switch uip/msh.c: clean up a diagnostic Tue Dec 17 08:53:52 1985 /mtr conf/makefiles/sbr, sbr/cndfree.c: clean-up a bit Tue Dec 17 08:36:59 1985 /mtr uip/send.c: different alert announcement based on -forward Wed Dec 11 19:08:20 1985 /mtr miscellany/libndir: -lndir for non-BSD sites, graciously supplied by Kirk McKusick Tue Dec 10 23:28:20 1985 /mtr uip/sbboards.c: oops, typo found by lint Tue Dec 10 22:38:23 1985 /mtr uip/addrsbr.c: normalize a bit (finally) uip/addrsbr.c: new routine adrsprintf() to remove #ifdef BANG dependencies uip/{post,rcvdist,replsbr,sbboards}.c: use adrsprintf() uip/post.c: remove #ifdef MF dependency for stand-alone MH, remove #ifdef DUMB dependency by making addrsbr.c smarter about being dumber mts/mmdf/hosts.c: remove #ifdef DUMB dependency (right now, addrsbr:getm() is the only one that calls it and it doesn't call it under #ifdef DUMB... Tue Dec 10 21:11:45 1985 /mtr conf/mh-gen.8: clear up some sys5 stuff zotnet/mf/umhook.c: sys5-ize uip/addrsbr.c: alternate-mailboxes: defaulted wrong under #ifdef BERK, it's now "*" conf/doc/mh-profile.rf: fix documentation to reflect reality Tue Dec 10 18:39:37 1985 /mtr zotnet/mts/client.c: moved from mts/sendmail/client.c conf/makefiles/{mts/sendmail,zotnet/mts}: changed mts/support/llib-lsendmail, zotnet/mts/llib-lmts: changed mts/sendmail/client.c: 4.2BSD specific only! conf/config/mts.c, zotnet/mts/mts.h: update conf/mhconfig.c: update conf/Makefile: simplify Sun Dec 8 18:39:01 1985 /mtr uip/send.c: always remove dist file uip/vmh.c: work on erase-word handling, a bit uip/folder.c: -fast -vs- -pack fixup uip/mhlsbr.c: %text defined for date fields Fri Dec 6 11:08:20 1985 /mtr support/bboards/mmdfII/gen: wrong filename Thu Dec 5 19:55:11 1985 /mtr uip/scansbr.c: fix machine dependency pointed out by Chuck Collins dist/READ-ME: new file talking about make bug COVER-LETTER, conf/{mh-gen.8,doc/MH.rf}: change UCI -> UCI.EDU Wed Dec 4 23:38:06 1985 /mtr zotnet/mts/mts.h: oops for MMDFONLY conf/{mh-gen.8,makefiles/zotnet/mts}: talk about -Dlocname Sun Dec 1 16:11:03 1985 /mtr uip/inc.c: more idiotic de-referncing of NULL, found on SUNs uip/replsbr.c: ditto uip/show.c: recognize more of mhl's switches Sun Dec 1 07:58:50 1985 /mtr uip/vmh.c: remove double-scroll uip/annosbr.c: oops, closing fd: without unlocking! sbr/makedir.c: plug an obscure security hole in inc uip/mhlsbr.c: read_termcap being called prematurely zotnet/tws/dtime.c: load tw_sday appropriately zotnet/tws/*.c: try using numeric timezone for official renditions, under #ifdef MTR for now Sat Nov 30 22:36:49 1985 /mtr zotnet/tws/dtime.c: add #ifdef INETONLY uip/post.c: for #ifdef BERK don't say {Local,UUCP,Network} Recipients conf/doc/sortm.rf: note problem with errors uip/bbc.c: for getbbvis() insist on readability support/bboards/bbexp.c: oops, calling pick wrong conf/doc/pick.rf: document -datefield anomaly conf/makefiles/support/bboards: oops, left context owned by root h/mh.h: ruserpass -> _ruserpass for SUN. why? Tue Nov 26 00:22:17 1985 /mtr uip/refile.c: oops, forgot copy-back on optimzied m_remsg Sun Nov 24 18:58:41 1985 /mtr uip/slocal.c: some tuning, also fix a bug in usr_pipe() uip/dropsbr.c: have mbx_copy support noisy uip/{packf,post,rcvpack,sbboards,slocal}.c: use this change Wed Nov 20 10:58:40 1985 /mtr MH 6.1 covert update for sbr/m_convert.c, uip/send.c Tue Nov 19 23:06:16 1985 /mtr uip/send.c: de-referencing NULL due to bad precedence, tsk Sun Nov 17 16:28:23 1985 /mtr conf/doc/{ap,mhl,repl,scan}.rf: note that #ifdef BERK kills address parsing conf/makefiles/{doc,uip,support/*,zotnet/*}: make tar command visible sbr/m_convert.c: oops, new message numbering resulted in bad diagnostic papers/*/Makefile: fix LaTeX rule for v2.08 Fri Nov 15 19:14:44 1985 /mtr uip/{rcvtty,slocal}.c: touch-ups Tue Nov 12 11:24:46 1985 /mtr MH 6.1 is official. MHCHANGES from mh.5 to mh.6 Mon Nov 11 07:47:05 1985 /mtr uip/slocal.c: implemenet MailDelivery, ala MMDF-II uip/rcv*.c: take advantage of it uip/rcvs{br,elect}.c: no longer needed uip/{folder,inc,refile}.c: done(1) if user doesn't want to create folders Sun Nov 10 16:30:46 1985 /mtr uip/refile.c: set previous sequence on destination folders uip/rcvsbr.c: new file uip/rcvpack.c: change Cron-Date: to Delivery-Date: Sun Nov 10 11:52:50 1985 /mtr uip/send.c: oops, annotations botched for forw! Thu Nov 7 00:31:45 1985 /mtr sbr/m_tmpfil.c: new routine uip/*.c: use it if necessary Wed Nov 6 23:05:00 1985 /mtr uip/inc.c: add -[pa]ck file switches to packf(1) with the POP uip/bbc.c: add $MHBBRC support Wed Nov 6 20:47:55 1985 /mtr uip/msh.c: more msh-using-POP-to-read-BBoards speed improvements Wed Nov 6 14:08:08 1985 /mtr uip/mshcmds.c: burst wasn't resetting scan listing cache mts/sendmail/client.c: don't use servers defaulting if name of service host is explicitly given Wed Nov 6 01:55:16 1985 /mtr support/bboards/mmdfII/bb_wtmail.c, uip/sbboards.c: use encapsulation format when returning failed mail Tue Nov 5 22:43:50 1985 /mtr zotnet/bboards/{bboards.h,getbbent.c}: new routine getbbtime() support/pop/{popd,popser}.c: use getbbtime() to speed start-up time, a major win! conf/makefiles/uip: oops, sbboards installed in wrong area! Tue Nov 5 22:29:29 1985 /mtr sbr/m_replace.c: fix logic glitch: not using getcpy() on update! Tue Nov 5 16:15:52 1985 /mtr zotnet/bboards/getbbent.c: optimize a bit zotnet/bboards/{bboards.h,getbbent.c}: new routine setpwinfo() support/{bboards/mmdfII/bboards/bb_wtmail,pop/pop{ser,wrd}}.c, uip/sbboards.c: use setpwinfo () uip/mshcmds.c: slight typo in msh$pick Mon Nov 4 16:00:56 1985 /mtr uip/vmh.c: Wgetstr() now minibuffer-exit's right Mon Nov 4 09:16:56 1985 /mtr uip/send.c: oops, bug in dist handling conf/{mhconfig.c,mh-gen.8}: warn about mhconfig requiring make clean later Sun Nov 3 22:06:58 1985 /mtr uip/vmh.c: work-around standout bug in curses, under #ifdef XYZ uip/vmh.c: try slight work-around for double-scroll'ing effect Sun Nov 3 13:12:51 1985 /mtr uip/version.sh: smarter wrt finding hostname uip/msh.c: finally got re-direction under vmh right! uip/mhlsbr.c: for moreproc, get signal handling right Thu Oct 31 21:40:50 1985 /mtr Makefile, conf/makefiles/*: rm core in unclean sbr/m_atoi.c: renamed from mu_atoi() uip/bbc.c: minor add_bb() logic fix uip/new.c, support/news/: de-supported! uip/msh.c: re-direction under vmh was losing Wed Oct 30 18:20:11 1985 /mtr -- Suggested by James M. Galvin -- uip/bbl.c: invoke inc with -file not -ms Wed Oct 30 18:19:49 1985 /mtr -- Suggested by Douglas P. Kingston -- mts/mmdf/hosts.c: remove bogus gethostname() logic, let the mtstailor file handle it. Wed Oct 30 16:39:56 1985 /mtr Makefile: add "make checkout" for MH maintainers only! uip/version.sh: extend Tue Oct 29 22:33:45 1985 /mtr h/dropsbr.h: new routine map_read() uip/dropsbr.c: performance improvement in map_read() uip/msh.c: -[no]topcur for vmh usage Tue Oct 29 01:25:36 1985 /mtr uip/addrsbr.c: freeing a couple of things twice! uip/msh.c: a malloc() bug! Mon Oct 28 19:31:13 1985 /mtr uip/vmh.c: don't read tty modes unless in foreground Sun Oct 27 22:13:23 1985 /mtr h/dropsbr.h, uip/dropsbr.c: add new field, m_size, to maildrop structure (and bump version number). This keeps track of the number of ARPA Internet octets in the message support/bboards/mmdf*/bboards/bb_wtmail.c, support/pop/popser.c, uip/dropsbr.c, uip/mshcmds.c, uip/rcvpack.c, uip/sbboards.c: all affected... Sun Oct 27 17:40:20 1985 /mtr zotnet/bboards/{bboards.h,getbbent.c}: make make_lower() integral uip/vmh.c: avoid ~'s when possible (actually forever owing to pWIN logic!) uip/vmh.c: make STATUS window be reverse-video, make prompt not be reverse-video uip/vmh.c: have EOT work as expected under bbc uip/vmh.c: if CE set, then don't scroll on exit uip/msh.c: make readids() logic smarter in the degenerate case h/mshsbr.h, uip/{msh,mshcmds}.c: keep scan line cached uip/{msh,mshcmds}.c: clean-up handling under vmh a bit uip/{bbc,inc,msgchk}.c: improve defaulting for nullifying host conf/config/mts.c: with flock() retry 5 times at 5 second intervals Fri Oct 25 08:38:35 1985 /mtr support/pop/popser.c, uip/bbc.c: don't recognize bb_aka's in name lookups Thu Oct 24 21:07:37 1985 /mtr conf/config/mts.c: new variable popbblist which, if present, lists only thoses hosts that can use BBoards over POP Wed Oct 23 20:46:17 1985 /mtr uip/prompter.c: -prepend is the default now uip/burst.c: -noinplace is the default now Wed Oct 23 12:34:04 1985 /mtr conf/config/mts.c: two new variables: popbbhost and popbbuser, under #ifdef BPOP uip/bbc.c: use same support/pop/pop.txt: revise remove HEAD in favor of more general TOP Wed Oct 23 01:34:54 1985 /mtr conf/mhconfig.c: change default bbhome to /usr/spool/bboards support/pop/popser.c: support maildrop mapping uip/dropsbr.c: some optimizations support/pop/popsbr.c: link into uip/ directory to simplify top-level Makefile Tue Oct 22 21:47:01 1985 /mtr uip/bbc.c: don't have -help imply -topics Mon Oct 21 18:45:29 1985 /mtr conf/mh-gen.8: mention gould stuff conf/doc/*.rf: talk about quoting of arguments Mon Oct 21 12:26:56 1985 /mtr uip/{msh,vmh}.c: some tuning uip/bbc.c: know about SIGTSTP Sun Oct 20 22:11:58 1985 /mtr -- Suggested by Hokey for SYS5 -- conf/mh-gen.8: mention -lndir for SYS5 sbr/m_gmsg.c: fix stand-alone continue makefiles: add SHELL=/bin/sh Sun Oct 20 13:03:13 1985 /mtr conf/config/bboards.*: fix to work under sh or csh Sun Oct 20 13:02:59 1985 /mtr uip/rmf.c: add -[no]interactive switch Thu Oct 17 19:41:18 1985 /mtr -- Suggested by Dave Yost -- uip/install-mh.c: new variable, mh_defaults, to default user's profile Thu Oct 17 16:02:25 1985 /mtr uip/msh.c: move pgmwait out of msh and into it's own sbr/ file h/mh.h, {sbr,uip}/*.c: normalize pidwait stuff sbr/m_foil.c, uip/{post,send,whom}.c: fix bug in alias mechanism when following included files uip/{inc,post,send,whom}.c: normalize switch handling a bit Tue Oct 15 18:52:49 1985 /mtr uip/prompter.c: add hidden -[no]body switch sbr/vfgets.c: slight logic botch Tue Oct 15 17:14:11 1985 /mtr h/mh.h, sbr/m_{convert,gmsg,remsg}.c, uip/{burst,inc,rcvstore,refile}.c: final XYZ check-out, remove #ifdefs Mon Oct 14 12:03:39 1985 /mtr uip/send.c: still more work on annotation logic... Sun Oct 13 18:17:10 1985 /mtr sbr/vfgets.c: oops, minor typo sbr/m_gmsg.c: re-think alloc strategy a bit sbr/m_gmsg.c: use #ifdef XYZ experimental code for no limits to #-messages in a folder! sbr/m_file.c: move into uip/refile.c h/folder.h: remove Sun Oct 13 14:17:10 1985 /mtr h/mshsbr.h, uip/{msh,mshcmds,vmh}.c: fix signal handling for forks under vmh support/bboards/mmdf*/bboards/ch_bboards.c: remove some logging info Wed Oct 9 19:49:04 1985 /mtr uip/send.c: fix bogus annotation handling, e.g., send -push; rmm; folder -pack uip/{forw,mhlsbr}.c: add extra blank line after final EB so user can add suffix text with an editor (e.g., prompter) and not screw-up conf/doc/burst.rf: warn about text after final EB being lost with -inplace Sun Oct 6 20:38:29 1985 /mtr uip/msh.c: fseek() too tricky for our own good... uip/{burst,mshcmds}.c: try to recover from errors more gracefully (ha!) Sun Oct 6 11:46:11 1985 /mtr uip/{folder,scan}.c: context changes ASAP sbr/remdir.c: clean-up h/mh.h, uip/{mhlsbr,mhmail,msh,post,prompter}.c: fix up signal handling when in background Sat Oct 5 23:17:39 1985 /mtr Makefile, conf/makefiles/*: fix "make tar" uip/mshcmds.c: finally track down that mhl pipe problem Makefile, conf/makefiles/*: clean->unclean,squeaky->clean Sat Oct 5 17:22:56 1985 /mtr -- Suggested by Dave Yost -- h/mh.h, conf/config/config.c: define globals in config.c, extern 'em in mh.h conf/mhconfig.c: rm files prior to creating 'em for CTM uip/version.sh: ditto Sat Oct 5 14:20:02 1985 /mtr uip/{post,rcvdist}.c: add call to mmdf_init() under #ifdef MMDFII h/mh.h, *: XYZ becomes the "real thing" Fri Oct 4 21:08:26 1985 /mtr uip/{comp,dist,forw,repl}.c: -[no]whatnow changed to -[no]whatnowproc uip/{next,prev,show}.c: -[no]show changed to -[no]showproc uip/vmh.c: -[no]visual changed to -[no]vmhproc uip/rmm.c: Delete-Prog: changed to rmmproc Fri Oct 4 19:36:56 1985 /mtr h/mh.h, conf/config/config.c, sbr/m_getdefs.c: make vmhproc a built-in uip/vmh.c: ditto, also better help message Thu Oct 3 23:43:35 1985 /mtr uip/inc.c: change "-ms ms-file" to "-file name" to be more consistent uip/inc.c: also, if -notruncate, don't zero POP maildrop! Wed Oct 2 21:34:44 1985 /mtr uip/vmh.c: a bit more tuning Wed Oct 2 11:31:49 1985 /mtr -- Suggested by Dave Yost -- sbr/m_getdefs.c: avoid a cast (and structure dependencies) by using a popular C idiom (taught to Dave by Bakul Shah). [This also makes MH work on the Gould...] h/mh.h,sbr/m_delete.c: take the opportunity to clean things up a bit Wed Oct 2 11:12:52 1985 /mtr uip/{burst,mshcmds}.c: oops, another "slight" typo Wed Oct 2 10:03:12 1985 /mtr -- Pointed out by Bob Designer -- uip/slocal.c: oops, typo! Wed Oct 2 02:48:02 1985 /mtr uip/vmh.c: add less-like interface to command handling Tue Oct 1 22:08:32 1985 /mtr h/mh.h, sbr/m_gmsg.c: slight XYZ tuning Tue Oct 1 14:31:54 1985 /mtr conf/makefiles/doc: oops, version.me -> version.rf uip/msh.c: oops, zero'd name of BBoard prior to putenv of mhfolder conf/mhconfig.c: support ldflags for options to ld at beginning of command Tue Oct 1 10:15:24 1985 /mtr sbr/m_getdefs.c: set[ug]id() to real [ug]ids prior to exec of install-mh uip/install-mh.c: don't need set[ug]ids, also if -auto, don't ask questions, say what you're going to do and do it! zotnet/mts/mts.h: remove reference to "../h/strings.h" conf/config/mts.c,support/bboards/bbaka.c: ask for "../h/strings.h" mts/{mh/{hosts,netmail},sendmail/{client,hosts,smail},mmdf/hosts}.c: ditto zotnet/mf/mf.h: ditto Thu Sep 26 11:42:18 1985 /mtr uip/addrsbr.c: change Alternate-Mailboxes: defaulting Tue Sep 24 19:18:49 1985 /mtr uip/burst.c: make static structure an alloc'd structure uip/{burst,mshcmd}.c: trim extra trailing newline if present Mon Sep 23 10:42:18 1985 /mtr support/bboards/mmdf*/bboards/bb_wtmail.c: remove bogus ch_host hackery; use the BBoard file instead! uip/bbc.c: add -[no]protocol to tell bbc if mshproc knows about bbc protocol Mon Sep 23 04:25:33 1985 /mtr uip/show.c: normalize showproc handling; remove -[no]format and -[no]pr, add -show program and -noshow Sun Sep 22 21:06:21 1985 /mtr uip/{msh,mshcmds}.c: interface to vmh Sat Sep 21 00:12:47 1985 /mtr h/vmhsbr.h, uip/{vmh,vmhsbr,vmhtest}.c: experimental new visual front-end to msh sbr/*.c: break many aggregate files into smaller ones Fri Sep 20 22:35:56 1985 /mtr uip/msh.c: have "quit" command update msgbox after confirmation if changed uip/{mhlsbr,repl}.c: on forwardings/replies force -noclear (HACK) uip/prompter.c: fold in SYS5 terminal handling better Fri Sep 20 21:22:55 1985 /mtr conf/mhconfig.c: add mandir entry to overrid /usr/man zotnet/mf/uumm.c: simplify a conditional for the ALTOS Fri Sep 20 20:59:19 1985 /mtr uip/msh.c: split into h/mshsbr.h, uip/{msh,mshcmds}.c uip/mshcmds.c: on refile, without -link, mark messages as deleted Fri Sep 20 09:48:06 1985 /mtr miscellany/mh-e: GNU Emacs front-end to MH from James Larus Wed Sep 18 23:23:28 1985 /mtr conf/mhconfig.c: oops, toss (void)'s Wed Sep 18 07:49:27 1985 /mtr sbr/discard.c: oops, logic was botched for all versions of UNIX! Tue Sep 17 09:47:55 1985 /mtr uip/addrsbr.c: slight tuning to #ifdef BERK Mon Sep 16 21:50:01 1985 /mtr -- Suggestion from John Shepherd -- uip/slocal.c: handle idiotic multiple "From " lines Mon Sep 16 20:53:18 1985 /mtr -- Fixes from Hokey (mostly SYS5) -- uip/version.sh: generate version.rf not version.me so it stays around conf/doc/{ADMIN,MH}.rf: use same conf/mhconfig.c: new option "ranlib" for BSD or SYS5 conf/makefiles/*: use same Mon Sep 16 20:50:32 1985 /mtr miscellany/less: sources to Mark Nudelman's "less" program included Thanks, Mark! zotnet/tws/dtime.c: support illegal GreyBook timezone strings Wed Sep 11 22:02:17 1985 /mtr -- Suggested by John A. Dilly -- mts/sendmail/smail.c: fix bug with intermittant dot being added during sm_wtxt(); thanks, John! conf/config/config.c: support ~/.mhrc by allowing libpath() recognize the CShell ~-construct. This is under #ifdef MHRC Wed Sep 11 11:03:29 1985 /mtr conf/makefiles/*, conf/makefiles/*/*: unifdef stuff wasn't working out, remove it Wed Sep 11 10:10:33 1985 /mtr -- More doc fixes from Phyllis Kantar -- conf/doc/{comp,dist,mh,mhl,repl,whatnow}.rf: doc fixes Tue Sep 10 17:47:35 1985 /mtr conf/{mhconfig.c,mh-gen.8}: change "uucp" option to "mf" option conf/{examples,tailor}/READ-ME: remove since mh-gen.8 contains this information now Tue Sep 10 16:23:23 1985 /mtr Makefile, conf/Makefile, conf/makefiles/*: implement "make squeaky" and "make tar" Mon Sep 9 22:12:59 1985 /mtr zotnet/bboards/{bboards.h,getbbent.c}: flags for setbbent() uip/bbc.c, support/{bboards/*,pop/*}.c: use 'em Mon Sep 9 19:42:13 1985 /mtr conf/doc/{MH,comp,dist,forw,mh-mail,mhl,repl}.rf: better verbatim mode in roff zotnet/tws/dtime*.c: more SYS5 cleanup conf/doc/{ADMIN,MH,mh-mts,popd}.rf: more doc hackery uip/post.c: remove tmpfil/bccfil when dying() Sat Sep 7 17:43:53 1985 /mtr -- Major Directory Tree Re-Organization -- papers/: new directory, move TeX stuff from othersupport/ there conf/{mhconfig.c,makefiles/{othersupport,papers}}: support this config/*.h, */*.c: move .h files to new directory h/, update .c files accordingly h/strings.h: new .h file to define all those string functions once and for all! {bboards,mts,mf,tws}/: move under zotnet/ mts/: new directory {mhmts,sendmts,mmdf}/: move under mts/ {support,popsupport,newsupport,bbsupport}: move under support/ Sat Sep 7 17:43:24 1985 /mtr uip/msh.c: advise of gap when BBoard reading Sat Sep 7 16:42:06 1985 /mtr conf/config/mts.c, config/mh.h, mf/mf.h: remove dup2() define for SYS5 and add it as a real routine conf/doc/{MH,bbleader,burst,forw,mf,mh-profile,scan}.rf: doc fixes Sun Sep 1 17:12:54 1985 /mtr conf/doc/MH.rf: minor typo and change the names of a few chapters Thu Aug 29 20:13:47 1985 /mtr bboards/getbbent.c, tws/dtimep.c: normalize Thu Aug 29 15:09:25 1985 /mtr uip/{ali,post}.c: load system aliases file last instead of first. This lets users override system aliases AND rely on host-specific alias for final resolution! Thu Aug 29 10:52:41 1985 /mtr -- Merge in changes for SYS5 -- conf/examples/READ-ME: all non-sprintf changes under #ifdef SYS5 conf/{mhconfig.c,config/{config,mts}.c}, sbr/*.c, tws/dtime*.c, uip/*.c: sprintf() returns an int, so always (void) it tws/dtime*.c: no ftime() conf/mhdoc: echo works differently, ridiculous! config/mh.h: dup2() doesn't exist, so define it conf/mhconfig.c, uip/post.c: enums might not exist sbr/discard.c, uip/{prompter,trmsbr}.c: ioctl()'s different Thu Aug 22 20:12:05 1985 /mtr uip/{forw,mhlsbr}.c: let mhl know about digest handling so forw becomes less complicated (mhl already knows about forwarding)! Wed Aug 21 11:12:33 1985 /mtr conf/{config/config.c,makefiles/{support,uip}}, config/mh.h, conf/doc/{MH,forw,mh-profile}.rf,uip/forw.c: use formatsbr to do digestifying uip/formatsbr.c: fix minor typo tws/{tws.h,dtime.c}: new routine, twsnow() mf/uumm.c, tws/dtime.c, uip/{msh,picksbr,scansbr,sortm}.c: use twsnow() Tue Aug 20 22:19:18 1985 /mtr Makefile,conf/makefiles/{sbr,zotnet}: clean-up make clean a bit Tue Aug 20 15:59:46 1985 /mtr conf/doc/{ADMIN,pop8,rcvstore}.rf: minor clean-up Tue Aug 20 11:27:22 1985 /mtr othersupport/Mail: new directory, unsupported Mon Aug 19 20:07:50 1985 /mtr conf/{mhconfig.c,mh-gen.8}: new config option "bbhome" conf/config/bboards.{daily,weekly}: moved from bbsupport/ conf/{config/crontab,doc/{ADMIN,bbc}.rf,makefiles/{bbsupport,uip}}: support bbhome conf/examples/nrtc-isc: renamed to nrtc-gremlin conf/MAKE: modified accordingly Sun Aug 18 20:22:17 1985 /mtr uip/{burst,msh,picksbr}.c: augment botch message a bit Fri Aug 16 05:48:51 1985 /mtr mf/{mf.h,{mf,mmuu,umhook,uumm}.c}: change vfgets() to mfgets(), and slight bug fix in the process conf/makefiles/sbr, config/mh.h, sbr/llib-lmh: new vfgets() sbr/vfgets.c: new routine to support virtual-fgets uip/{alias,format,mhl}sbr.c: call vfgets to handle continuation lines conf/doc/{ap,dp,mh-alias,mhl,repl,scan}.rf: continuation lines now supported support/replcomps conf/config/mts.c, sbr/m_{draft,getdefs,whatnow}.c, sendmts/smail.c, tws/dtime.c, uip/{comp,inc,mark,mhpath,msh,post,rcvstore,refile,send}.c: notdef cleanup sendmts/hosts.c, uip/{aliasbr,dropsbr,rcvdist,send}.c: minor cleanup sbr/{add,m_replace}.c: ditto uip/mhlsbr.c: minor parenthization for ALTOS Fri Aug 16 04:48:13 1985 /mtr conf/{mhconfig.c,mh-gen.8,makefiles/uip}: fix long standing bug about sbboards, slocal, and spop being installed even for MMDF configurations Fri Aug 16 03:55:21 1985 /mtr sbr/m_getfld.c, uip/msh.c: fix trailing newline bug with mhl+no moreproc uip/addrsbr.c: slight touch-up Thu Aug 15 16:58:13 1985 /mtr conf/doc/{bbleader,bboards,mh-profile,prompter,show}.rf: minor touch-up Thu Aug 15 16:42:26 1985 /mtr CMP: shell script to aid Bug-MH in figuring out what's changed Thu Aug 15 11:19:26 1985 /mtr uip/inc.c: forgot an #ifdef for POP Wed Aug 14 21:54:20 1985 /mtr conf/config/mts.c, config/aliasbr.h, sbr/{m_getdefs,path}.c, popsupport/popd.c, uip/{ali,aliasbr,msh,picksbr,post}.c: a couple more touch-ups Wed Aug 14 17:27:41 1985 /mtr config/aliasbr.h: optimize structures for ALTOS uip/aliasbr.c: optimize for ALTOS and UNIX in general Mon Aug 12 19:42:28 1985 /mtr uip/mhlsbr.c: slight clarification for ontty == NOTTY and -clear at termination; also, try to get signals right again Thu Aug 8 00:00:00 1985 /mtr MH #6.59 enters beta Wed Aug 7 21:14:19 1985 /mtr uip/mhlsbr.c: m_popen_pid -> m_pid for 7limit Tue Aug 6 17:22:59 1985 /mtr -- From John Romine -- conf/makefiles/mmdf: slight typo mmdf/LN: better version conf/{mh-gen.8,mhconfig.c,makefiles/doc}: support two new options for manual pages: "none" and "gen" Mon Aug 5 20:57:47 1985 /mtr sbr/m_gmsg.c, uip/{bbl,mhlsbr,post,refile}.c: minor notdef touch-up conf/doc/inc.rf: slight touch-up conf/mhconfig.c: support some invocation arguments uip/sortm.c: alloc structure dynamically Mon Aug 5 20:27:12 1985 /mtr uip/rcvstore.c, conf/doc/rcvstore.rf: new program from Julian Onions conf/{makefiles/uip,doc/{MH,mh,mh-chart,mhook}.rf}: upgrade Mon Aug 5 12:29:56 1985 /mtr -- From John Romine -- conf/config/mts.c: do lock structure allocation dynamically and free up 25K of static data space (which may never even be referenced!) Sun Aug 4 14:23:35 1985 /mtr -- Suggested by Phyllis Kanter -- conf/doc/*.rf: doc fixes Sun Aug 4 14:23:58 1985 /mtr conf/doc/{ADMIN,mh-mts,bboards8}.rf: doc fixes Thu Aug 1 21:30:36 1985 /mtr uip/inc.c: fix conflict between -ms and POP Wed Jul 31 10:44:22 1985 /mtr conf/doc/{tmac.h,{ADMIN,MH,bbl,folder,mh-profile,msh,scan,whatnow}.rf}: documentation fixes conf/doc/{mhpath,show}.rf: ditto uip/msh.c: slight typo Tue Jul 30 21:44:00 1985 /mtr -- Suggested by Phyllis Kanter -- uip/folder.c: fix -fast and -recurse mis-interaction uip/burst.c: fix non-existant message handling when expanding the folder conf/config/config.c: fix comment re: whatnowproc config/mh.h, sendmts/smail.c: declare a couple of things that should be in sbr/m_getdefs.c: don't complain if "context: file" isn't there. sbr/m_{convert,file,gmsg,name}.c: fix boundary handling of MAXFOLDER conf/mh-gen.8: say a few words about chown, remove in MH config file conf/{config/config.c,examples/READ-ME}: two new options, FOLDPROT, MSGPROT conf/{config/config.c,doc/mh-profile.rf}, config/mh.h: add the "unseen-sequence" sbr/{m_setcur.c,llib-lmh}, uip/{inc,show}.c: do the UNSEEN business Sat Jul 27 12:55:27 1985 /mtr sbr/m_sync: slight adjustment uip/{addr,format,pick}sbr.c: a bit more debug info Sat Jul 27 12:46:12 1985 /mtr -- Documentation Fixes from Bob Designer -- conf/doc/{post,mh-profile,show,send,repl,next,folder}.rf: typos uip/whatnowsbr.c: back to the old prompt Sat Jul 27 00:33:39 1985 /mtr conf/doc/{mhl,show}.rf: upgrade a bit conf/makefiles/uip, uip/{mhl,mhlsbr,show}.c: add address/date parsing on demand conf/doc/{dp,scan}.rf, uip/formatsbr.c: slight upgrade support/mhl.{format,forward}: update a bit Fri Jul 26 11:09:35 1985 /mtr sendmts/smail.c: slight fix for major bug with #ifdef BERK Thu Jul 25 21:31:00 1985 /mtr conf/doc/pick.rf: finally get documentation right conf/makefiles/dist: a few more things Thu Jul 25 17:00:17 1985 /mtr conf/doc/ADMIN.rf, uip/{inc,msgchk}.c: minor re-work POP debug features Thu Jul 25 00:00:00 1985 /mtr MH #6.24 enters beta Wed Jul 24 23:42:41 1985 /mtr uip/addrsbr.c: bug with #ifdef BERK, mp -> m_nohost not getting set so no aliasing done! conf/config/mts.c: lockfile name building botched! Wed Jul 24 21:01:15 1985 /mtr uip/forw.c: -build logic botched Wed Jul 24 14:07:31 1985 /mtr conf/mh.h, sbr/m_getfld.c, uip/{msh,{mhl,scan}sbr}.c: fix broken msh message delimiting behavior and broken mhl behavior under msh Tue Jul 23 20:30:39 1985 /mtr uip/whom.c: pass more switches to post. Since they're ALL secret, no documentation needed! Mon Jul 22 16:50:54 1985 /mtr uip/picksbr.c: logic for handling "--header value" botched Sun Jul 21 15:36:24 1985 /mtr conf/doc/{send,whom,mh-alias}.rf: aliasing hints conf/doc/{{MH,tmac}.h,template}: support hints section conf/doc/mh-mts.rf: minor fix Thu Jul 18 15:59:19 1985 /mtr conf/mh-gen.8: typo Wed Jul 17 09:47:19 1985 /mtr bboards/mmdf/mmdf.2/bboards/bb_wtmail: change dist_address to ds_address, dist_log to ds_log Tue Jul 16 12:41:54 1985 /mtr uip/ali.c: forgot to call mts_init() to get "everyone", and "noshell" Sun Jul 14 18:51:22 1985 /mtr uip/formatsbr.c: handle the blank line bug by hacking it (see the "echo controversy" discussed above). The solution is to insert a space in truly blank lines... Sun Jul 14 13:44:13 1985 /mtr othersupport/bboards: version #2.1 as suggested by Jerry Sweet conf/doc/{ADMIN,mf,mh-{mts,tailor},bb{exp,oards5,tar},pop8}.rf: fixes suggested by Jerry Sweet Sun Jul 14 13:23:49 1985 /mtr tws/dtimep.c: have "BST" mean British Summer Time not Bering Standard Time Sun Jul 14 12:54:55 1985 /mtr -- Enhancements from John L. Romine -- uip/mhlsbr.c: minor cleanup Fri Jul 12 10:32:40 1985 /mtr config/mh.h,sbr/uleq.c: change strindex() -> stringdex () to avoid MMDF name conflict uip/{addrsbr,dropsbr,msh,rcvpack,sbboards}.c: ditto Thu Jul 11 12:34:15 1985 /mtr conf/makefiles/uip: oops, forgot a @END: SENDMTS inside an @BEGIN: POP Wed Jul 10 20:40:53 1985 /mtr conf/config/config.c,config/mh.h,sbr/m_getdefs.c,uip/mhlsbr.c: mhl's choice of mhlproc was confusing to forw. Add new variable moreproc to fix the problem. Note as a result, the old BERK behavior is the default, you have to turn off moreproc in your .mh_profile if you don't want mhl to use it Wed Jul 10 14:48:05 1985 /mtr uip/mhlsbr.c: don't SIG_DFL signals on start-up; if run from msh, this loses big, if not run from msh, then signals are SIG_DFL anyway... Wed Jul 10 14:08:39 1985 /mtr conf/makefiles/popsupport,popsupport/popd.{c,8c}: a bit of clean-up Wed Jul 10 12:07:42 1985 /mtr uip/addrsbr.c: another de-reference of NULL fixed Wed Jul 10 09:04:04 1985 /mtr uip/send.c: typo defining LISTDSW Tue Jul 9 18:59:21 1985 /mtr -- Suggested by Thomas Scott Christiansen -- uip/msh.c: move big Msgs[] structure from auto to static othersupport/netnews/{.,mhbox}/: new directories othersupport/netnews/{mh_profile,mhbox/flupcomps} new files Sun Jul 7 13:31:01 1985 /mtr othersupport/scripts/: new directory for scripts. First is Bob Designer's modifications to JLR's append script. othersupport/mtrenv/bin/append: remove Sun Jul 7 13:26:28 1985 /mtr uip/{addsbr,post,rcvdist,replsbr,sbboards}.c: support #ifdef BANG conf/examples/READ-ME: ditto Thu Jul 4 17:36:34 1985 /mtr uip/msh.c: "pack" should be called "packf". Thu Jul 4 16:00:38 1985 /mtr othersupport/mtrenv/mhbox/dp.debug: new file Thu Jul 4 08:38:01 1985 /mtr tws/{dtime,dtimep}.c: know about J{D,S}T, also under #ifdef HUJI generate it if appropriate. (from Danny Braniss) Thu Jul 4 08:29:11 1985 /mtr conf/doc/ADMIN.rf: put in a word or two about running conflict conf/makefiles/dist: add rules for .imp files Mon Jul 1 22:22:49 1985 /mtr conf/doc/mhl.rf, uip/mhlsbr.c: remove the #ifdef BERK stuff and generalize it. If the MH profile entry mhlproc is defined, then you get the BERK behavior using the mhlproc as the output filter. Otherwise, you get the old behavior. If this works nice, I'll make "more" the default mhlproc and set-up config.c, mh.h, and m_getdefs.c as appropriate (with the documentation mh-profile.rf) For the moment, I'm using "less" as my mhlproc and it works fine. Mon Jul 1 09:18:42 1985 /mtr sbr/m_{file,gmsg}.c, uip/{msh,refile,rmm,send}.c: #ifdef notdef the stuff marking messages as DELETED, since it's not used Mon Jul 1 06:26:38 1985 /mtr -- Suggestions from Bob Desinger -- config/mh.h, sbr/m_backup.c: locate SBACKUP definition in mh.h sbr/m_gmsg.c, uip/rmf.c: handle SBACKUP prefix files appropriately, also, slight optimizations Wed Jun 26 12:36:38 1985 /mtr MH #5.457 becomes MH #6.1 in beta Mon Jun 24 23:31:42 1985 /mtr uip/send.c: try to prevent confused annotations. The algorithm works for dist and repl, but not forw Mon Jun 24 14:58:25 1985 /mtr conf/doc/*.rf: Numerous documentation fixes suggested by Jerry Sweet. conf/doc/ADMIN.rf: New document: Administrator's Guide Fri Jun 21 13:09:29 1985 /mtr uip/addrsbr.c: liked the wild-carding, so even for #ifndef BERK you get it. Of course in this case, you can wildcard on both the mbox and the host. It turns out that this is really useful for people who have many mailboxes and get a lot of munged mail. Thu Jun 20 19:55:23 1985 /mtr -- Performance Enhancements from the 4.3BSD folks (by Van Jacobson) -- config/mh.h: define vfork for systems without it sbr/{refile,showfile}.c,uip/{replsbr,send,whatnowsbr}.c: replace fork() with vfork() config/mh.h: move Van's getfld.h definitions into here sbr/m_getfld.c: major performance tuning! (use -DRPATHS to get Return-Path: info from UNIX from: line) uip/{inc,msh}.c: m_unknown parameter added uip/trmsbr.c: support for TIOCGWINSZ in 4.3BSD(!!) uip/scan.c: -[no]reverse under #ifdef BERK (I really HATE this) also, update context prior to scan, again under #ifdef BERK uip/scansbr.c: performance enhancements plus inline copy of message body to output file for inc uip/mhlsbr.c: under #ifdef BERK pipe output to /usr/ucb/more if stdoutput is a terminal. uip/post.c: #ifdef DUMB a bit dumber for Berkeley addrsbr (actually these changes were made earlier for other reasons) uip/addrsbr.c: use prescan-like routine in SendMail under #ifdef BERK, also enable wild-carding. The former probably breaks the stuff in ap, et. al. Sun Jun 16 10:21:33 1985 /mtr uip/{ap,dp,{repl,scan}sbr}.c: the old echo controversy raises it's ugly head: suppose we have a line in a replcomps file which is entirely in a %<...%> conditional and the conditional is false. In that case, we still get a blank line. This is very BAD if it occurs in the headers. Two solutions possible: 1. If a call to FSprintf() returns a empty string, don't put out a \n. 2. In new_fs, put the \n's in and just return one big string instead of an array of strings. Option [2] was implemented initially because it lets conditionals span multiple lines in the file. In order to keep the format files from looking too complicated, EOL was ignored in format files, \n's should be embedded where appropriate. A single format string argument is considered to have an implicit \n. This is inconsistent, but it keeps the format files readable. Option [2] was discarded though since it required a \n at the end of each line in the format file if there was no conditional stuff there. So, option [1] got implemented even though it doesn't allow conditionals to be multi-line (which is okay, since you can use \n in a line). Sun Jun 9 16:37:40 1985 /mtr uip/dropsbr.c, uip/sbboards.c: .cnt mechanism broken, introduce new routine mbx_openX() in dropsbr.c and use that instead of mbx_open when opening an .cnt file Sun Jun 9 14:44:36 1985 /mtr conf/makefiles/uip,uip/show.c: make show/next/prev one program uip/{show,next,prev}hdr.c: remove as a result of above conf/doc/{next,prev}.rf: update Thu Jun 6 23:03:09 1985 /mtr uip/{format,mhl}sbr.c: add some definitions for sprintb() bboards/bboards.h: define BBITS there instead of uip/bbc.c Tue Jun 4 20:00:32 1985 /mtr -- Suggested by Dave Yost -- conf/doc/tmac.h: use ".nf" after ".SH" inside various macros (since ".SH" tends to set ".fi") sbr/m_{gmsg,sync}.c: some .mh_sequences optimizations for hm conf/config/config.c: support #ifdef NOMHSEQ Tue Jun 4 13:30:27 1985 /mtr uip/trmsbr.c: optimize a bit, the ontty test in clear_screen () isn't needed Mon Jun 3 22:15:18 1985 /mtr conf/doc/packd.rf, uip/packd.c: de-implement, essentially useless under 4.2BSD Mon Jun 3 14:54:30 1985 /mtr othersupport/usenix: new directory containing the MH paper presented at the 1985 Summer Usenix Conference Mon Jun 3 11:28:46 1985 /mtr TODO: remove since there's nothing worth left doing in it! Sun Jun 2 18:36:19 1985 /mtr conf/doc/*.rf: more clean-up uip/ali.c: change help messages a bit, and add -[no]normalize switches conf/doc/mh-tailor.rf: new file config/mh.h,uip/{post,repl}.c: move definition of OUTPUTLINELEN to mh.h so sbr/help.c can use it sbr/help.c: smarter output routine for options Sun Jun 2 14:07:46 1985 /mtr uip/whatnowsbr.c: don't say the draft's left around if it isn't (suggested by Mike O'Brien) uip/whatnowsbr.c: return value from non-initial calls to m_edit() not handled right (pointed out by Richard Johnson) sbr/m_getfld.c: be a bit smarter when recognizing that idiotic "From " line from silly UNIX-style maildrops Sat Jun 1 14:45:25 1985 /mtr uip/{pick,picksbr,msh}.c: bite the bullet and have pick allow complex booleans conf/doc/{mh-chart,pick}.rf: ditto Sat Jun 1 11:18:06 1985 /mtr mf/mf.c, uip/*sbr.c: more register declarations Sat Jun 1 01:35:06 1985 /mtr conf/doc/mhook.rf, uip/rcv*.c: account for MMDF-II change regarding rcvmail hooks and maildelivery(5) Fri May 31 23:33:59 1985 /mtr conf/doc/*.rf: more doc fixes; document WHATNOW, OVERHEAD sbr/m_getdefs.c: more OVERHEAD code to optimize MH subforks Fri May 31 22:19:15 1985 /mtr uip/replsbr.c: bite the bullet and have repl use the format string routines as well Wed May 29 16:38:49 1985 /mtr Makefile, conf/makefiles/*: support depend. N.B.: This is for DEVELOPMENT WORK ONLY. "make depend" runs unifdef because some #include files are configuration specific. Sadly, unifdef isn't on all systems (it originated at Rand and migrated to 4.2BSD). As a result, unless you have unifdef, don't run make depend. The dependencies listed in the conf/makefiles/* files are "generic". Wed May 29 14:53:33 1985 /mtr othersupport/mtrenv/*: update Tue May 28 19:45:36 1985 /mtr config/scansbr.h,uip/{inc,msh,rcvtty,scan,scansbr}.c: bite the bullet and have scansbr use a format string uip/{inc,scan}.c: no more -[no]numdate, -[no]size, -[no]time and use -format string and -width columns instead Mon May 27 21:45:23 1985 /mtr uip/{ap,addrsbr}.c: upgrade ap to use formatsbr; required a new param to getm(), so modules which call getm() got changed as well othersupport/rcvtrip/rcvtrip: upgrade Mon May 27 17:05:18 1985 /mtr tws/dp.c: move to uip/ uip/formatsbr.c: new module config/scansbr.h: define stuff for formatsbr Mon May 27 11:33:32 1985 /mtr config/mh.h, sbr/{closefds,m_getdefs}.c: #ifdef OVERHEAD experimental code Thu May 23 22:06:25 1985 /mtr conf/makfiles/uip,uip/*.c: next step in the lint process config/mh.h, sbr/llib-lmh, uip/rmf.c: move remdir() to sbr/makedir.c Thu May 23 09:06:32 1985 /mtr conf/makefiles/{mts,uip}, uip/msgchk.c: moved from mts/ Wed May 22 19:49:43 1985 /mtr Makefile, config/mh.h, conf/makefiles/*, bboards/getbbent.c, */llib-l*, tws/{dtime,dtimep}.c: start the linting process, lint everything except the uip/ directory sendmts/smail.c, uip/trmsbr.c: move discard to sbr/ library mf/mf.c: lint fixes sbr/{getans,m_{gmsg,setcur},refile,showfile}.c: lint fixes sbr/{putenv,sprintb}.c: #include mh.h sbr/*: VOID -> (void) bbsupport/bb{aka,exp,tar}.c: lint fixes Wed May 22 15:29:25 1985 /mtr popsupport/popser.c: if maildrop doesn't exist, note it and continue conf/doc/bbc.rf, uip/bbc.c: add -user switch to help POP debugging bboards/getbbent.c: have getbberr() return useful info for setbbfile (), setbbinfo (), and setbbent () popsupport/{popaka,popser,popwrd}.c, uip/{bbc,spop}.c: take advantage of getbberr() Wed May 22 10:16:17 1985 /mtr sbr/m_getfld.c: Eom() was botching gathering the UNIX from line (fix from Matt Crawford ) sendmts/smail.c: sm_end(NOTOK) was clobbering sm_reply Tue May 21 22:33:58 1985 /mtr uip/scansbr.c: when copying characters to the scan listing, know about underlining conventions Tue May 21 21:29:18 1985 /mtr Begin work on research-version of MH (#5.380[NRTC]). This version won't be sent out to the MH-Workers list, so I can do some power coding for a change. -- WHATNOW changes -- uip/{refile,send,show,whom}.c: #ifdef WHATNOW experimental code sbr/m_whatnow.c, uip/{whatnow,whatnowsbr}.c: default whatnow is a built-in for comp, et. al. sbr/{m_{edit,send},showhom}.c: removed since whatnowsbr has 'em sbr/showfile.c: likewise, showhead function removed -- POP changes -- conf/doc/inc.rf, uip/inc.c: pop now lives in inc uip/spop.c: link to sbboards.c, the POP mailer for SendMail popsupport/: new directory from the ashes of othersupport/popsupport/, containing many new programs, files, and documentation bboards/{bboards.h,getbbent.c}: new functions to support popsupport/mmdfII/: the POP channel for MMDF-II, linked to the BBoards channel, as appropriate conf/doc/msgchk.rf, mts/msgchk.c: support POP -- Bug Fixes -- uip/post.c: for path code, fixed a couple of dumb typos. uip/replsbr.c: if -noformat, don't worry about no addresses uip/bbc.c: another couple of nasty bugs fixed sendmts/smail.c: don't send HELO if talking to SendMail on the local host conf/doc/{MH,repl,forw,comp,dist,show,mh,mh-chart,whom}.rf: bug fixes -- Configuration and Clean-up -- conf/mhconfig.c: support new options: pop, chown, remove conf/makefiles/*: more chmods where appropriate config/config.c, sbr/help.c: include compile-time options in help listing. sbr/m_backup.c,uip/forw.c: remove makename in favor of mktemp sbr/pr_array.c: removed, since no one was using it config/mh.h, sbr/llib-lmh: update for all this othersupport/patch/: the latest version Thu May 2 21:14:56 1985 /mtr (agent: Marshall Rose) MH #5.360[UCI] (uci-750a) released to MH-Workers Thu May 2 21:13:32 1985 /mtr (agent: Marshall Rose) conf/makefiles/uip: make whatnow chmod +t'd Thu May 2 21:13:32 1985 /mtr (agent: Marshall Rose) uip/post.c: a few more back-offs with #ifdef DUMB... Thu May 2 21:13:03 1985 /mtr (agent: Marshall Rose) uip/sbboards.c: fdopen() called with wrong arg! Wed Apr 24 22:45:39 1985 /mtr (agent: Marshall Rose) conf/doc/MH.rf: just a few more fixes... Wed Apr 24 22:44:30 1985 /mtr (agent: Marshall Rose) sbr/m_whatnow.c, uip/{dist,forw,repl}.c: fix obscure "@" bug. Sat Apr 20 14:46:10 1985 /mtr (agent: Marshall Rose) sbr/m_send.c, uip/whatnow.c: on "push", let send do push() instead of whatnow Fri Apr 19 19:44:25 1985 /mtr (agent: Marshall Rose) uip/send.c: on annotations, if push'd avoid getting upset if message to annotate isn't there uip/send.c: fix "typo" for r1bindex () uip/send.c: put ~/.signature support back in under #ifdef UCI uip/send.c: use mktemp() instead of bogus makename! uip/send.c: fix screwy interaction between msh, dist, whatnow, and send (oh no!) Fri Apr 19 19:23:39 1985 /mtr (agent: Marshall Rose) uip/whatnow.c: if edit fails, it's time to go away sbr/m_edit.c: minor cosmetic change Fri Apr 19 19:13:44 1985 /mtr (agent: Marshall Rose) uip/post.c: more #ifdef DUMB madness, for local addresses, if no host portion given, then don't give it to sm_wadr() uip/post.c: back #ifdef DUMB off a bit in From: for MMDFMTS Fri Apr 19 18:32:13 1985 /mtr (agent: Marshall Rose) conf/doc/MH.rf, sbr/m_send.c: de-implement "push" in whatnow having send look for profile-entry of "push" rather than "send" to confusing to the user "community" Fri Apr 19 18:28:44 1985 /mtr (agent: Marshall Rose) bboards/bboards.h, uip/bbc.c: support BB_INVIS for "hidden" BBoards in -topic uip/bbc.c: catch a long name that got past us uip/bbc.c: fix -topics logic when BBoards given Fri Apr 19 18:27:16 1985 /mtr (agent: Marshall Rose) conf/{config/mts.c,tailor/READ-ME}, mts/mts.h, uip/inc.c: support the new MTS variable "pophost" Sat Apr 6 16:17:23 1985 /mtr (agent: Marshall Rose) MH #5.348[UCI] (uci-750a) released to MH-Workers Wed Apr 3 23:53:12 1985 /mtr (agent: Marshall Rose) ohtersupport/mtrenv/bin/whatnow: new file Wed Apr 3 23:52:13 1985 /mtr (agent: Marshall Rose) sendmts/smail.c: comment out an extra RSET for UCI's losing MMDF-I SMTP server Tue Mar 26 18:32:49 1985 /mtr (agent: Marshall Rose) conf/{config/mts.c,tailor/READ-ME}, config/aliasbr.h, mts/mts.h, uip/aliasbr.c: make "*" logic mts-tailorable (ugh), you get to choose highest non-user uid and non-user shell Tue Mar 26 18:02:52 1985 /mtr (agent: Marshall Rose) conf/doc/repl.rf: document bug in replcomps Mon Mar 25 18:06:48 1985 /mtr (agent: Marshall Rose) mf/mf.c: avoid (incorrectly) recognizing " at " for "@" by using a heuristic suggested by JSol. Sun Mar 24 18:32:47 1985 /mtr (agent: Marshall Rose) sbr/m_draft.c, uip/{comp,dist,forw,refile,repl,send,show,whatnow,whom}.c: have -nodraftfolder override "Draft-Folder:" profile entry Sat Mar 23 12:48:30 1985 /mtr (agent: Marshall Rose) -- Support the WhatNow shell -- conf/makefiles/{sbr,uip}: updates for all of this uip/{comp,dist,forw,repl}.c: remove What now? code, add -whatnow program, -nowhatnow sbr/m_whatnow.c: new module conf/config/config.c,config/mh.h,sbr/m_getdefs.c: new variable whatnowproc sbr/llib-lmh: update uip/whatnow.c: new program, the first WhatNow shell conf/doc/{mh-chart,whom}.rf, uip/whom.c: upgrade to take draftfolder arguments sbr/putenv.c: update for above sbr/m_send.c: undo previous edits, m_whatnow() takes care of it uip/distsbr.c: new module for dist-style support uip/{send,whom}.c: call distout() in distsbr.c conf/doc/whatnow.rf: new file conf/doc/{MH,comp,dist,forw,mh,mh-{chart,profile},repl}.rf: updates conf/doc/template: fix Thu Mar 21 08:45:11 1985 /mtr (agent: Marshall Rose) sendmts/smail.c: fix logic error in sm_end(); MMDF-I has this problem, MMDF-II might! Tue Mar 19 18:16:33 1985 /mtr (agent: Marshall Rose) conf/doc/msgchk.rf: new file conf/{doc/{mh,mh-chart,MH}.rf,makefiles/doc}: update for msgchk Tue Mar 19 17:31:14 1985 /mtr (agent: Marshall Rose) conf/doc/{ap,mh-chart}.rf, uip/ap.c: accept -help switch Tue Mar 19 14:17:30 1985 /mtr (agent: Marshall Rose) othersupport/mtrenv/bin/{distf,mpick,packit}: updates Sat Mar 16 12:49:48 1985 /mtr (agent: Marshall Rose) Makefile: simply Makefile using sh, also make DESTDIR work conf/makefiles/othersupport: simplify Makefile Sat Mar 16 12:23:37 1985 /mtr (agent: Marshall Rose) uip/{mark,msh}.c: don't set previous-sequence to make debugging easier Sat Mar 16 01:38:06 1985 /mtr (agent: Marshall Rose) conf/config/mts.c: add a few calls to mts_init ("mts") at strategic places Sat Mar 16 00:28:01 1985 /mtr (agent: Marshall Rose) uip/{inc,msh,rcvtty,scan,scansbr}.c: clean up handling of inc -silent sbr/{llib-lmh,m_send.c}, uip/{annosbr,comp,dist,forw,repl}.c: move annotations into send conf/makefiles/uip, uip/{send,post}.c: ditto conf/doc/{dist,forw,repl}.rf: ditto uip/anno.c: forgot to check (mp -> msgstats[msgnum] & SELECTED) Fri Mar 15 23:21:29 1985 /mtr (agent: Marshall Rose) sbr/printsw.c: compress output of printed switches sbr/m_getdefs.c: let $MHCONTEXT override context variable sbr/m_{getdefs,gmsg,sync}.c, conf/doc/mh-profile.rf: let the profile entry "mh-sequences" override .mh_sequences sbr/m_seq.c: optimization Fri Mar 15 23:05:43 1985 /mtr (agent: Marshall Rose) bbsupport/bbexp.c: fix string botch for command to popen. also allow extra arguments to indicate aging period. Fri Mar 15 11:45:00 1985 /mtr (agent: Marshall Rose) othersupport/emh/READ-ME: new file Thu Mar 14 22:41:37 1985 /mtr (agent: Marshall Rose) -- Fixes suggested by John Dilley -- conf/{config/mts.c,tailor/READ-ME}: add new mtstailor variables localname, systemname, and uucpchan mts/mts.h, conf/{mh-gen.8,config/{mts.c,mtstailor},tailor/READ-ME}: add new mtstailor variable lockstyle to control style of locking sbr/m_getfld.c: catch the UNIX "from user" line uip/scansbr.c: make use of the UNIX "from user" line uip/addrsbr.c: more #ifdef DUMB support uip/inc.c: minor bug in inc w.r.t. closing locked file uip/post.c: more #ifdef DUMB support uip/replsbr.c: support Return-Path: for defaulting host names as a last resort Wed Mar 13 22:24:07 1985 /mtr (agent: Marshall Rose) uip/send.c: fix "use xxx logic" uip/msh.c: a NULL vs. "" typo Wed Mar 13 22:01:37 1985 /mtr (agent: Marshall Rose) -- Fixes suggested by Phyllis Kantar -- uip/{comp,dist,forw,repl}.c: fix quit -delete logic conf/doc/{comp,mh-chart}.rf: document "-file file" switch uip/send.c: "send -help" should done (1) for comp, et. al. uip/send.c: typo "tempoary" conf/doc/{send,whom}.rf: Profile Components forgot Draft-Folder uip/ali.c: always load system aliases conf/doc/{MH,comp,dist,forw,mhook,repl,send,show,mh-alias,mh-mail, mh-profile,mhl,post}.rf: typo fixes conf/doc/send.rf, uip/send.c: -forward now the default, also don't gripe about "show -draft file" Tue Mar 12 18:07:44 1985 /mtr (agent: Marshall Rose) othersupport/pop/pop.txt: a few minor corrections to typos. Sat Mar 9 15:54:40 1985 /mtr (agent: Marshall Rose) uip/dropsbr.c: fix bug when fixing stomped maildrop. Sat Mar 9 15:36:13 1985 /mtr (agent: Marshall Rose) bboards/mmdf/mmdf.{1,2}/bboards/bb_wtmail.c, uip/sbboards.c: fix minor bug requiring nearly major re-write!!! Wed Mar 6 18:59:22 1985 /mtr (agent: Marshall Rose) -- Fixes from Robert Elz -- sbr/makedir.c: use mkdir() under #ifdef BSD42 uip/rmf.c: use rmdir() under #ifdef BSD42 Wed Mar 6 18:19:46 1985 /mtr (agent: Marshall Rose) TODO, config/addrsbr.h, sendmts/smail.c, mf/mf.{c,h}, uip/{addrsbr,ap,post,rcvdist,sbboards}.c: handle 822-style routing Wed Mar 6 18:08:11 1985 /mtr (agent: Marshall Rose) uip/{dropsbr,packf,post,slocal}.c: fix to maildrop mapping bug with MHMTS and local delivery in post, and SENDMTS and local delivery in slocal Sat Mar 1 20:21:17 1985 /mtr (agent: Marshall Rose) MH #5.321[UCI] (uci-750a) released to MH-Workers Fri Mar 1 19:59:32 1985 /mtr (agent: Marshall Rose) uip/trmsbr.c: forgot to make a termcap buffer TXTSIZ'd instead of BUFSIZ'd. Fri Mar 1 19:56:43 1985 /mtr (agent: Marshall Rose) conf/config/mts.c: for the DUAL, you can't link to a file that you can't read, unbelievable, eh?, so change the creat (foo, 0000) to creat (foo, 0400). Also, fix up some botched args to a sprintf() call. Fri Mar 1 19:48:53 1985 /mtr (agent: Marshall Rose) conf/config/config.c: if MORE is defined, used that instead of /usr/ucb/more. The #ifdef ALTOS dependency is removed. ALTOS users should use options MORE='"/usr/bin/more"', just like users of the Dual. conf/examples/READ-ME: document same Wed Feb 20 20:48:12 1985 /mtr (agent: Marshall Rose) sbr/adios.c: save errno prior to doing fancy perror stuff Wed Feb 20 20:40:14 1985 /mtr (agent: Marshall Rose) uip/inc.c: fix suggested by John Dilley at Purdue, inc now ignore signals if it's going to zero the maildrop. Mon Feb 18 12:53:50 1985 /mtr (agent: Marshall Rose) conf/doc/send.rf, uip/send.c: de-implement ~/.signature support Tue Feb 12 19:33:14 1985 /mtr (agent: Marshall Rose) uip/mhlsbr.c: clear_screen() logic between messages botched Sun Jan 27 18:42:49 1985 /mtr (agent: Marshall Rose) conf/makefiles/mts: dependency screw-up on mts.o Sun Jan 27 17:41:03 1985 /mtr (agent: Marshall Rose) sendmts/smail.c, uip/post.c: with -DSMTP, keep one SMTP connection open, instead of starting a new one for each transaction othersupport/pop/{Makefile,{popd,popser,inc,popsbr}.c}: support "rpop" under #ifdef RPOP othersupport/pop/client.c: remove conf/{config/mts.c,tailor/READ-ME,makefiles/sendmts}, mts/mts.h, sendmts/{smail,client}.c: support new server search list facility used by both -DSMTP and -DPOP Sat Jan 26 09:12:27 1985 /mtr (agent: Marshall Rose) MH #5.310[UCI] (uci-750a) released to MH-Workers Sat Jan 26 09:38:08 1985 /mtr (agent: Marshall Rose) tws/dtime.c: #define dysize(), since could be a macro in ctime.c (thanks, Fred) Sat Jan 26 09:08:43 1985 /mtr (agent: Marshall Rose) uip/{inc,post}.c: changes for #ifdef TMA; this stuff is still under non-disclosure (not the MH code, just the -ltma library which doesn't come with MH) Sat Jan 26 09:05:52 1985 /mtr (agent: Marshall Rose) -- Fixes for MHMTS configuration -- conf/makefiles/uip: shouldn't build rcvdist on an MHMTS system conf/doc/mhook.rf: ditto conf/config/mts.c, mhmts/netmail.c, mts/mts.h, uip/rmail.c: some typos in the declarations of global MTS variables that are MHMTS specific mf/mmuu.c: addr_convert() conflicted with routine of same name in uumm.c uip/news.c: looking in the wrong place for on 4.2BSD systems Tue Jan 8 13:54:13 1985 /mtr (agent: Marshall Rose) MH.5 is finished, finally. MHCHANGES from mh.4 to mh.5 Thu May 2 21:14:56 1985 /mtr (agent: Marshall Rose) MH #5.360[UCI] (uci-750a) released to MH-Workers Thu May 2 21:13:32 1985 /mtr (agent: Marshall Rose) conf/makefiles/uip: make whatnow chmod +t'd Thu May 2 21:13:32 1985 /mtr (agent: Marshall Rose) uip/post.c: a few more back-offs with #ifdef DUMB... Thu May 2 21:13:03 1985 /mtr (agent: Marshall Rose) uip/sbboards.c: fdopen() called with wrong arg! Wed Apr 24 22:45:39 1985 /mtr (agent: Marshall Rose) conf/doc/MH.rf: just a few more fixes... Wed Apr 24 22:44:30 1985 /mtr (agent: Marshall Rose) sbr/m_whatnow.c, uip/{dist,forw,repl}.c: fix obscure "@" bug. Sat Apr 20 14:46:10 1985 /mtr (agent: Marshall Rose) sbr/m_send.c, uip/whatnow.c: on "push", let send do push() instead of whatnow Fri Apr 19 19:44:25 1985 /mtr (agent: Marshall Rose) uip/send.c: on annotations, if push'd avoid getting upset if message to annotate isn't there uip/send.c: fix "typo" for r1bindex () uip/send.c: put ~/.signature support back in under #ifdef UCI uip/send.c: use mktemp() instead of bogus makename! uip/send.c: fix screwy interaction between msh, dist, whatnow, and send (oh no!) Fri Apr 19 19:23:39 1985 /mtr (agent: Marshall Rose) uip/whatnow.c: if edit fails, it's time to go away sbr/m_edit.c: minor cosmetic change Fri Apr 19 19:13:44 1985 /mtr (agent: Marshall Rose) uip/post.c: more #ifdef DUMB madness, for local addresses, if no host portion given, then don't give it to sm_wadr() uip/post.c: back #ifdef DUMB off a bit in From: for MMDFMTS Fri Apr 19 18:32:13 1985 /mtr (agent: Marshall Rose) conf/doc/MH.rf, sbr/m_send.c: de-implement "push" in whatnow having send look for profile-entry of "push" rather than "send" to confusing to the user "community" Fri Apr 19 18:28:44 1985 /mtr (agent: Marshall Rose) bboards/bboards.h, uip/bbc.c: support BB_INVIS for "hidden" BBoards in -topic uip/bbc.c: catch a long name that got past us uip/bbc.c: fix -topics logic when BBoards given Fri Apr 19 18:27:16 1985 /mtr (agent: Marshall Rose) conf/{config/mts.c,tailor/READ-ME}, mts/mts.h, uip/inc.c: support the new MTS variable "pophost" Sat Apr 6 16:17:23 1985 /mtr (agent: Marshall Rose) MH #5.348[UCI] (uci-750a) released to MH-Workers Wed Apr 3 23:53:12 1985 /mtr (agent: Marshall Rose) ohtersupport/mtrenv/bin/whatnow: new file Wed Apr 3 23:52:13 1985 /mtr (agent: Marshall Rose) sendmts/smail.c: comment out an extra RSET for UCI's losing MMDF-I SMTP server Tue Mar 26 18:32:49 1985 /mtr (agent: Marshall Rose) conf/{config/mts.c,tailor/READ-ME}, config/aliasbr.h, mts/mts.h, uip/aliasbr.c: make "*" logic mts-tailorable (ugh), you get to choose highest non-user uid and non-user shell Tue Mar 26 18:02:52 1985 /mtr (agent: Marshall Rose) conf/doc/repl.rf: document bug in replcomps Mon Mar 25 18:06:48 1985 /mtr (agent: Marshall Rose) mf/mf.c: avoid (incorrectly) recognizing " at " for "@" by using a heuristic suggested by JSol. Sun Mar 24 18:32:47 1985 /mtr (agent: Marshall Rose) sbr/m_draft.c, uip/{comp,dist,forw,refile,repl,send,show,whatnow,whom}.c: have -nodraftfolder override "Draft-Folder:" profile entry Sat Mar 23 12:48:30 1985 /mtr (agent: Marshall Rose) -- Support the WhatNow shell -- conf/makefiles/{sbr,uip}: updates for all of this uip/{comp,dist,forw,repl}.c: remove What now? code, add -whatnow program, -nowhatnow sbr/m_whatnow.c: new module conf/config/config.c,config/mh.h,sbr/m_getdefs.c: new variable whatnowproc sbr/llib-lmh: update uip/whatnow.c: new program, the first WhatNow shell conf/doc/{mh-chart,whom}.rf, uip/whom.c: upgrade to take draftfolder arguments sbr/putenv.c: update for above sbr/m_send.c: undo previous edits, m_whatnow() takes care of it uip/distsbr.c: new module for dist-style support uip/{send,whom}.c: call distout() in distsbr.c conf/doc/whatnow.rf: new file conf/doc/{MH,comp,dist,forw,mh,mh-{chart,profile},repl}.rf: updates conf/doc/template: fix Thu Mar 21 08:45:11 1985 /mtr (agent: Marshall Rose) sendmts/smail.c: fix logic error in sm_end(); MMDF-I has this problem, MMDF-II might! Tue Mar 19 18:16:33 1985 /mtr (agent: Marshall Rose) conf/doc/msgchk.rf: new file conf/{doc/{mh,mh-chart,MH}.rf,makefiles/doc}: update for msgchk Tue Mar 19 17:31:14 1985 /mtr (agent: Marshall Rose) conf/doc/{ap,mh-chart}.rf, uip/ap.c: accept -help switch Tue Mar 19 14:17:30 1985 /mtr (agent: Marshall Rose) othersupport/mtrenv/bin/{distf,mpick,packit}: updates Sat Mar 16 12:49:48 1985 /mtr (agent: Marshall Rose) Makefile: simply Makefile using sh, also make DESTDIR work conf/makefiles/othersupport: simplify Makefile Sat Mar 16 12:23:37 1985 /mtr (agent: Marshall Rose) uip/{mark,msh}.c: don't set previous-sequence to make debugging easier Sat Mar 16 01:38:06 1985 /mtr (agent: Marshall Rose) conf/config/mts.c: add a few calls to mts_init ("mts") at strategic places Sat Mar 16 00:28:01 1985 /mtr (agent: Marshall Rose) uip/{inc,msh,rcvtty,scan,scansbr}.c: clean up handling of inc -silent sbr/{llib-lmh,m_send.c}, uip/{annosbr,comp,dist,forw,repl}.c: move annotations into send conf/makefiles/uip, uip/{send,post}.c: ditto conf/doc/{dist,forw,repl}.rf: ditto uip/anno.c: forgot to check (mp -> msgstats[msgnum] & SELECTED) Fri Mar 15 23:21:29 1985 /mtr (agent: Marshall Rose) sbr/printsw.c: compress output of printed switches sbr/m_getdefs.c: let $MHCONTEXT override context variable sbr/m_{getdefs,gmsg,sync}.c, conf/doc/mh-profile.rf: let the profile entry "mh-sequences" override .mh_sequences sbr/m_seq.c: optimization Fri Mar 15 23:05:43 1985 /mtr (agent: Marshall Rose) bbsupport/bbexp.c: fix string botch for command to popen. also allow extra arguments to indicate aging period. Fri Mar 15 11:45:00 1985 /mtr (agent: Marshall Rose) othersupport/emh/READ-ME: new file Thu Mar 14 22:41:37 1985 /mtr (agent: Marshall Rose) -- Fixes suggested by John Dilley -- conf/{config/mts.c,tailor/READ-ME}: add new mtstailor variables localname, systemname, and uucpchan mts/mts.h, conf/{mh-gen.8,config/{mts.c,mtstailor},tailor/READ-ME}: add new mtstailor variable lockstyle to control style of locking sbr/m_getfld.c: catch the UNIX "from user" line uip/scansbr.c: make use of the UNIX "from user" line uip/addrsbr.c: more #ifdef DUMB support uip/inc.c: minor bug in inc w.r.t. closing locked file uip/post.c: more #ifdef DUMB support uip/replsbr.c: support Return-Path: for defaulting host names as a last resort Wed Mar 13 22:24:07 1985 /mtr (agent: Marshall Rose) uip/send.c: fix "use xxx logic" uip/msh.c: a NULL vs. "" typo Wed Mar 13 22:01:37 1985 /mtr (agent: Marshall Rose) -- Fixes suggested by Phyllis Kantar -- uip/{comp,dist,forw,repl}.c: fix quit -delete logic conf/doc/{comp,mh-chart}.rf: document "-file file" switch uip/send.c: "send -help" should done (1) for comp, et. al. uip/send.c: typo "tempoary" conf/doc/{send,whom}.rf: Profile Components forgot Draft-Folder uip/ali.c: always load system aliases conf/doc/{MH,comp,dist,forw,mhook,repl,send,show,mh-alias,mh-mail, mh-profile,mhl,post}.rf: typo fixes conf/doc/send.rf, uip/send.c: -forward now the default, also don't gripe about "show -draft file" Tue Mar 12 18:07:44 1985 /mtr (agent: Marshall Rose) othersupport/pop/pop.txt: a few minor corrections to typos. Sat Mar 9 15:54:40 1985 /mtr (agent: Marshall Rose) uip/dropsbr.c: fix bug when fixing stomped maildrop. Sat Mar 9 15:36:13 1985 /mtr (agent: Marshall Rose) bboards/mmdf/mmdf.{1,2}/bboards/bb_wtmail.c, uip/sbboards.c: fix minor bug requiring nearly major re-write!!! Wed Mar 6 18:59:22 1985 /mtr (agent: Marshall Rose) -- Fixes from Robert Elz -- sbr/makedir.c: use mkdir() under #ifdef BSD42 uip/rmf.c: use rmdir() under #ifdef BSD42 Wed Mar 6 18:19:46 1985 /mtr (agent: Marshall Rose) TODO, config/addrsbr.h, sendmts/smail.c, mf/mf.{c,h}, uip/{addrsbr,ap,post,rcvdist,sbboards}.c: handle 822-style routing Wed Mar 6 18:08:11 1985 /mtr (agent: Marshall Rose) uip/{dropsbr,packf,post,slocal}.c: fix to maildrop mapping bug with MHMTS and local delivery in post, and SENDMTS and local delivery in slocal Sat Mar 1 20:21:17 1985 /mtr (agent: Marshall Rose) MH #5.321[UCI] (uci-750a) released to MH-Workers Fri Mar 1 19:59:32 1985 /mtr (agent: Marshall Rose) uip/trmsbr.c: forgot to make a termcap buffer TXTSIZ'd instead of BUFSIZ'd. Fri Mar 1 19:56:43 1985 /mtr (agent: Marshall Rose) conf/config/mts.c: for the DUAL, you can't link to a file that you can't read, unbelievable, eh?, so change the creat (foo, 0000) to creat (foo, 0400). Also, fix up some botched args to a sprintf() call. Fri Mar 1 19:48:53 1985 /mtr (agent: Marshall Rose) conf/config/config.c: if MORE is defined, used that instead of /usr/ucb/more. The #ifdef ALTOS dependency is removed. ALTOS users should use options MORE='"/usr/bin/more"', just like users of the Dual. conf/examples/READ-ME: document same Wed Feb 20 20:48:12 1985 /mtr (agent: Marshall Rose) sbr/adios.c: save errno prior to doing fancy perror stuff Wed Feb 20 20:40:14 1985 /mtr (agent: Marshall Rose) uip/inc.c: fix suggested by John Dilley at Purdue, inc now ignore signals if it's going to zero the maildrop. Mon Feb 18 12:53:50 1985 /mtr (agent: Marshall Rose) conf/doc/send.rf, uip/send.c: de-implement ~/.signature support Tue Feb 12 19:33:14 1985 /mtr (agent: Marshall Rose) uip/mhlsbr.c: clear_screen() logic between messages botched Sun Jan 27 18:42:49 1985 /mtr (agent: Marshall Rose) conf/makefiles/mts: dependency screw-up on mts.o Sun Jan 27 17:41:03 1985 /mtr (agent: Marshall Rose) sendmts/smail.c, uip/post.c: with -DSMTP, keep one SMTP connection open, instead of starting a new one for each transaction othersupport/pop/{Makefile,{popd,popser,inc,popsbr}.c}: support "rpop" under #ifdef RPOP othersupport/pop/client.c: remove conf/{config/mts.c,tailor/READ-ME,makefiles/sendmts}, mts/mts.h, sendmts/{smail,client}.c: support new server search list facility used by both -DSMTP and -DPOP Sat Jan 26 09:12:27 1985 /mtr (agent: Marshall Rose) MH #5.310[UCI] (uci-750a) released to MH-Workers Sat Jan 26 09:38:08 1985 /mtr (agent: Marshall Rose) tws/dtime.c: #define dysize(), since could be a macro in ctime.c (thanks, Fred) Sat Jan 26 09:08:43 1985 /mtr (agent: Marshall Rose) uip/{inc,post}.c: changes for #ifdef TMA; this stuff is still under non-disclosure (not the MH code, just the -ltma library which doesn't come with MH) Sat Jan 26 09:05:52 1985 /mtr (agent: Marshall Rose) -- Fixes for MHMTS configuration -- conf/makefiles/uip: shouldn't build rcvdist on an MHMTS system conf/doc/mhook.rf: ditto conf/config/mts.c, mhmts/netmail.c, mts/mts.h, uip/rmail.c: some typos in the declarations of global MTS variables that are MHMTS specific mf/mmuu.c: addr_convert() conflicted with routine of same name in uumm.c uip/news.c: looking in the wrong place for on 4.2BSD systems Tue Jan 8 13:54:13 1985 /mtr (agent: Marshall Rose) MH.5 is finished, finally. Tue Jan 8 09:45:25 1985 /mtr (agent: Marshall Rose) sbr/m_edit.c: from Mike O'Brien on 4.2BSD use symlinks if "@" is across file systems uip/inc.c: slight botch in -[no]truncate Tue Jan 8 09:12:42 1985 /mtr (agent: Marshall Rose) conf/{mh-gen,doc/MH}.rf: last change, fix public domain notice config/notice.h: remove uip/version.sh: don't include ../config/notice.h Mon Jan 7 19:05:22 1985 /mtr (agent: Marshall Rose) uip/inc.c: add -[no]truncate conf/doc/*: change up documentation a bit Fri Jan 4 16:28:49 1985 /mtr (agent: Marshall Rose) uip/addrsbr.c: SENDMTS was botching UUCP addrs Wed Jan 2 13:20:42 1985 /mtr (agent: Marshall Rose) uip/addrsbr.c: #ifdef DUMB inserted Mon Dec 31 21:28:07 1984 /mtr (agent: Marshall Rose) uip/packf.c, conf/doc/packf.c, conf/{config/config.c,makefiles/uip}, change pack to packf config/mh.h: make MAXFOLDERS smaller for the ALTOS Mon Dec 31 17:43:49 1984 /mtr (agent: Marshall Rose) tws/{tws.h,dtime.c}: add dgmtime() Sun Dec 30 19:52:27 1984 /mtr (agent: Marshall Rose) conf/config/{config,mts}.c, mmdf/hosts.c, uip/trmsbr.c, bboards/getbbent.c, config/mh.h: minor cleanup. Sun Dec 30 12:11:45 1984 /mtr (agent: Marshall Rose) uip/post.c: have non-recipient addresses honor aliases Sun Dec 30 12:01:08 1984 /mtr (agent: Marshall Rose) uip/sortm.c: fix for holes in "msgs" from Mike O'Brien Sun Dec 30 11:50:57 1984 /mtr (agent: Marshall Rose) uip/post.c: one more -noverbose fix Sat Dec 29 16:56:59 1984 /mtr (agent: Marshall Rose) conf/makefiles/sbr, config/mh.h, sbr/llib-lmh, sbr/closefds.c, uip/{msh,post,rcvtty,replsbr,send,slocal,whom}.c: implement closefds () Sat Dec 29 12:17:50 1984 /mtr (agent: Marshall Rose) conf/{config/config.c,doc/{folder,mh-profile}.rf}, sbr/m_getdefs.c, uip/folder.c: fix folder -fast -recurse Sat Dec 29 10:45:08 1984 /mtr (agent: Marshall Rose) sbr/m_sync.c: handle public and read-only sequences correctly uip/rmf.c: fix botch for handling read-only folders Sat Dec 29 10:43:12 1984 /mtr (agent: Marshall Rose) uip/msh.c: improved $mhfolder handling for -prompt. Wed Dec 19 12:49:42 1984 /mtr (agent: Marshall Rose) sbr/m_getfld.c: advise() with inverted arguments Tue Dec 18 16:48:17 1984 /mtr (agent: Marshall Rose) bboards/*.c, conf/config/mts.c, mhmts/*.c, mmdf/*.c, sendmts/*.c, tws/*.c: register madness Tue Dec 18 16:00:48 1984 /mtr (agent: Marshall Rose) uip/{bbc,msh}.c: for Farber, say name of BBoard not name of file Tue Dec 18 16:00:07 1984 /mtr (agent: Marshall Rose) bboards/getbbent.c, conf/config/mts.c, sbr/m_backup.c, uip/dropsbr.c: for ALTOS "%.*s" doesn't work if * evals to 0, so kludge around it Tue Dec 18 15:59:34 1984 /mtr (agent: Marshall Rose) sbr/m_getfld.c, uip/scansbr.c: some speed improvements from Jim Larus at UCB Thu Dec 13 00:05:42 1984 /mtr (agent: Marshall Rose) sbr/m_getfld.c: big fields were having their headers zero'd Wed Dec 12 11:51:52 1984 /mtr (agent: Marshall Rose) tws/{tws.h,dtime.c}: use modified version of gtime() to add new structure element to (struct tws *). This makes time comparisons insensitive to timezones, etc. Tue Dec 11 22:35:58 1984 /mtr (agent: Marshall Rose) -- Fixes from Julian Onions at Nottingham -- conf/makfiles/*: "ld -x -r" terminates with status 1 even if all goes well, so tell make not to worry about it config/mh.h,conf/examples/READ-ME: talk about void=int uip/{msh,post,rcv{dist,pack,tty},slocal}.c: include if not V7 Tue Dec 11 17:05:36 1984 /mtr (agent: Marshall Rose) uip/trmsbr.c: minor fix in discard() for #ifdef ALTOS Mon Dec 10 23:38:05 1984 /mtr (agent: Marshall Rose) config/scansbr.h, uip/{inc,scansbr,send,post}.c: add support for TTI's prototype TMA under #ifdef TMA uip/tmasbr.c: new module for support Sat Dec 8 18:16:41 1984 /mtr (agent: Marshall Rose) config/mh.h, tws/tws.h, conf/config/mts.c: remove the void definitions conf/Makefile, config/makefiles/*: remove -ns from LDFLAGS conf/makefiles/uip: don't use the -g option for ls for s{bboards,local} conf/makefiles/*: use -l to ls not -ls Sat Dec 8 18:16:20 1984 /mtr (agent: Marshall Rose) uip/rcvtty.c: minor-cleanup Fri Dec 7 00:25:24 1984 /mtr (agent: Marshall Rose) uip/{inc,show}.c: implement "unseen" for TGC. This feature is currently undocumented pending field-testing. Wed Dec 5 22:58:11 1984 /mtr (agent: Marshall Rose) uip/sbboards.c: on distribution, if a particular address loses, keep on going and report the error later on. bboards/mmdf/mmdf.{1,2}/bboards/bb_wtmail.c: in addition to above fix to sbboards, post failure notices to the local-XXX-request address. Wed Dec 5 14:28:18 1984 /mtr (agent: Marshall Rose) mts/msgchk.c, Makefile, conf/makefiles/mts: honor MF conventions in msgchk, required MH sbr library uip/inc.c: better check of umincproc uip/{dist,forw,repl}.c: typo prevented annotation with the pyramid cc conf/makefiles/{bbsupport,uip}: give path to chown uip/dropsbr.c: no diagnostic if map is empty conf/config/mts.c, bboards/getbbent.c: more ALTOS stuff for v7 cc sbr/m_getfld.c, uip/mhlsbr.c: botched pointer to function notation, visible on v7 cc bbsupport/bbexp.c: forgot to foil m_getdefs() sbr/m_{setcur,seq}.c: handle "cur" correctly sbr/m_getfld.c: in msh$mhl with a message with no body, big loss uip/post.c: don't ask sbr/m_getfld.c, conf/makefiles/sbr: use the mts stuff to initialize the delimiter. The programs that need this will call mts_init() themselvess prior to calling m_getfld() Fri Nov 30 08:47:52 1984 /mtr (agent: Marshall Rose) uip/news.c: forgot to include mh.h; no one must be using it, love to trash it from the distribution. -- Enter BETA Testing -- Thu Nov 29 01:55:12 1984 /mtr (agent: Marshall Rose) uip/pick.c: don't output that "0" on error exits if stdout is a tty... (yep, pick acts differently for ttys, just like ls) Wed Nov 28 22:59:34 1984 /mtr (agent: Marshall Rose) uip/msh.c: add -draft argument to msh$refile; clean-up -draft argument in msh$show sbr/m_draft.c: call path() on value of Draft-Folder: so relative folders work (!!) uip/repl.c: expand fcc: @folder arguments Wed Nov 28 20:42:21 1984 /mtr (agent: Marshall Rose) conf/makefiles/*: for installations, use mv -f to save backup Wed Nov 28 20:37:16 1984 /mtr (agent: Marshall Rose) uip/comp.c: restore old context-sensitive behavior Wed Nov 28 19:57:44 1984 /mtr (agent: Marshall Rose) uip/rcv{pack,tty}.c: move inclusion of and to the not MMDFMTS part, since "util.h" includes 'em Wed Nov 28 11:28:56 1984 /mtr (agent: Marshall Rose) uip/mhlsbr.c: ignores wasn't being handled properly (logic bug) Wed Nov 28 08:24:04 1984 /mtr (agent: Marshall Rose) uip/refile.c: if +folder arg is forgotten, don't print usage string. Also add -draft switch. Wed Nov 28 00:15:25 1984 /mtr (agent: Marshall Rose) uip/trmsbr.c: always read termcap and do what we can. When called from in a non-interactive environment, do the right thing at the right time... uip/msh.c: call sc_width() at start-up to read good values from trmsbr Tue Nov 27 21:02:41 1984 /mtr (agent: Marshall Rose) uip/send.c: re-implement the -[no]unique switches for JLR. Tue Nov 27 20:44:45 1984 /mtr (agent: Marshall Rose) -- More Changes for the ALTOS -- conf/makefiles/{mts,tws}: @(LDOPTIONS) was being left out of LDFLAGS config/aliasbr.h,uip/{ali,aliasbr}.c: prefix members of the aka structure with ak_, prefix members of the adr structure with ad_ tws/tws.h: type "void" undefined uip/rcv{dist,pack,tty}.c: include only if not on ALTOS uip/ttyw.c: put everything under #ifdef TTYD Tue Nov 27 19:22:51 1984 /mtr (agent: Marshall Rose) sbr/m_getfld.c: add m_eomsbr() for msh$mhl for bursting (sigh) Tue Nov 27 19:08:46 1984 /mtr (agent: Marshall Rose) uip/addrsbr.c: in addition to griping about bogus addresses in the "alternate-mailboxes:" entry, add a line saying to fix it (and where) uip/scansbr.c: very minor cosmetic change in cpyfrm() for group handling Tue Nov 27 16:54:51 1984 /mtr (agent: Marshall Rose) sbr/m_draft.c: add new result parameter which tells if a draft-folder is being used uip/{comp,dist,forw,repl,show,send,whom}.c: modified appropriately for extra parameter; this info is needed to decide which prompt and options to offer the user if the draft chosen exists Tue Nov 27 14:19:18 1984 /mtr (agent: Marshall Rose) uip/post.c: ignore Fcc:s when disting Mon Nov 26 20:34:18 1984 /mtr (agent: Marshall Rose) sbr/refile.c: new module; implements the "refile" option at "What now?" level uip/{comp,dist,forw,repl}.c: new switch -noedit, says to skip the initial edit and proceed directly to "What now?" level. Also make use of the new "refile" option at "What now?" level uip/comp.c: support for JLR's comp from a folder/msg notion Mon Nov 26 12:26:28 1984 /mtr (agent: Marshall Rose) uip/mhlsbr.c: add -[no]bell Mon Nov 26 10:20:07 1984 /mtr (agent: Marshall Rose) uip/send.c: add -[no]forward Sun Nov 25 23:36:59 1984 /mtr (agent: Marshall Rose) uip/{mhl,trm}sbr.c: move discard() from mhlsbr to trmsbr Sun Nov 25 19:30:46 1984 /mtr (agent: Marshall Rose) bbsupport/bboards.{dai,week}ly: if the bboards login shell is csh, can't use /bin/sh format... Sun Nov 25 13:28:47 1984 /mtr (agent: Marshall Rose) uip/{{mhl,trm}sbr,msh}.c: use and support SOprintf() for output to terminal uip/mhlsbr.c: add support for built-in mhl in msh, mhlsbr() uip/msh.c: use new support for built-in mhl sbr/m_getfld.c: some mis-logic in Eom(); if style is UNKNOWN, ALWAYS figure out what it is prior to going on Sat Nov 24 22:29:09 1984 /mtr (agent: Marshall Rose) uip/mhlsbr.c: into the fold Sat Nov 24 19:09:14 1984 /mtr (agent: Marshall Rose) sbr/showfile.c: if lproc is "mhl", use mhlproc for consistency (Actually, user should use "lproc: show", "showproc: mhl".) Sat Nov 24 09:59:31 1984 /mtr (agent: Marshall Rose) -- Fixes from John Romine at TGC -- conf/mh-gen.8: include "dm.h" in list of include files for MMDF2 conf/mh-gen.8: typo "ggenerate" conf/examples/READ-ME: BSD41a => BSD41A conf/mhconfig.c: V7 compiler tosses its cookies on reasonably formed structure members. Fix conf/config/config.c: remove comment about "pick -show" conf/{config/config.c,doc/mh-profile.rf}, config/mh.h sbr/m_getdefs.c: remove scanproc, since that's used only by "pick -scan" which does not exist conf/mhdoc: make into a Bourne shell script. Fri Nov 23 21:08:04 1984 /mtr (agent: Marshall Rose) -- More Changes for the ALTOS -- config/altos.h: didn't work, idiotic V7 compiler (cpp) didn't do "the right thing", so get rid of it and change the variable names in-line conf/config/mts.c: make isdlm{1,2} into macros instead of routines in mf/mf.c; also move getusr() there. conf/config/mts.c: make getfullname () standard and add new mtstailor option, mailid, to do the BRL/NRTC stuff with pw_gecos Fri Nov 23 19:26:35 1984 /mtr (agent: Marshall Rose) uip/{bbc,post,prompter,rcvdist,rmail,{repl,scan}sbr,s{bboards,local}}.c: minor clean-up Wed Nov 21 13:35:33 1984 /mtr (agent: Marshall Rose) config/dropsbr.h: new include file uip/dropsbr.c: add support for maildrop mapping uip/dropsbr.c: add new parameter to mbx_open() for default mode on creation uip/{msh,pack,post,rcvpack,s{bboards,local}}.c: modify to use new support for maildrop mapping Tue Nov 20 16:56:14 1984 /mtr (agent: Marshall Rose) bboards/{bboards.h,getbbent.c}: change bboard structure to make life easier for bbc. Also add new structure for use with msh. Mon Nov 19 23:36:57 1984 /mtr (agent: Marshall Rose) uip/bbc.c: neaten handling of distribution addresses on `-topics' output. Sun Nov 18 15:00:07 1984 /mtr (agent: Marshall Rose) uip/pick.c: if -help, set -nozero so done() doesn't print "0". Moby hack. Sat Nov 17 22:43:11 1984 /mtr (agent: Marshall Rose) uip/msh.c: add msh$pack command. uip/pack.c: simplify a bit. Sat Nov 17 21:22:35 1984 /mtr (agent: Marshall Rose) conf/makefiles/{mts,uip}: change PGMPROT to 755 for dpk. Sat Nov 17 15:33:14 1984 /mtr (agent: Marshall Rose) uip/{mhl,trm}sbr.c: add sc_length() to return li#. Have mhl assume co# and li# based on termcap entry if not given on command line. If entries aren't present in termcap, use values in template. Sat Nov 17 13:49:12 1984 /mtr (agent: Marshall Rose) config/mh.h,uip/{folder,refile}.c: add NFOLDERS to denote max number of folders/files on command line. Fri Nov 16 19:01:32 1984 /mtr (agent: Marshall Rose) uip/msh.c: remove -[no]burst switches. Add "rmm" command, but don't document it yet. Still have to resolve a few problems. Fri Nov 16 08:21:08 1984 /mtr (agent: Marshall Rose) -- More fixes from Fred Blonder at UMCP-CS -- conf/mhconfig.c: #define SVAL(s) to handle those pesky de-references to NULL. Fri Nov 16 08:20:50 1984 /mtr (agent: Marshall Rose) sbr/m_getdefs.c: close up COMPAT code slightly. conf/makefiles/*: change "-cp $(BINDIR)/cmd zcmd" to use "-mv". (On a trial basis.) Thu Nov 15 21:15:41 1984 /mtr (agent: Marshall Rose) -- Fixes from John Romine at TGC -- sbr/m_getdefs.c: use (FILE *)NULL instead of NULL when testing fopen()'s return value. Thu Nov 15 12:11:58 1984 /mtr (agent: Marshall Rose) mmdf/hosts.c: at the suggestion of Doug Kingston, use dm_v2route() to map host references to official domain strings. Thu Nov 15 09:29:43 1984 /mtr (agent: Marshall Rose) -- Fixes from John Romine at TGC -- uip/{forw,mhlsbr}.c: using NULL instead of "" in a couple of places. Thu Nov 15 09:24:32 1984 /mtr (agent: Marshall Rose) -- More fixes from Fred Blonder at UMCP-CS -- sbr/concat.c: botched installation for the pyramid. use Fred's code. Wed Nov 14 23:24:56 1984 /mtr (agent: Marshall Rose) -- All suggestions from Phyllis Kantar at Rand -- sbr/{ssequal,uleq}.c: default arguments to "" if NULL. uip/addrsbr.c: have ismymbox() recognize localhost!user. uip/folder.c: have "folder -fast msg" set "msg" as cur. sbr/m_getdefs.c: if using $MH, and it isn't relative, after expanding it, setenv it to an absolute pathname for subshells. Wed Nov 14 22:19:10 1984 /mtr (agent: Marshall Rose) sbr/m_gmsg.c: undo curmsg "fix" above, it broke MH mightily! sbr/m_convert.c: check curmsg here, so explicit references to "cur", when it doesn't exist, fails. Wed Nov 14 20:16:04 1984 /mtr (agent: Marshall Rose) sbr/adios.c: for 4.2BSD use writev() on the adios() family of routines, gives much smoother output. uip/mhlsbr.c: call the adios() family of routines instead of explicitly using stderr. Wed Nov 14 19:06:24 1984 /mtr (agent: Marshall Rose) sbr/m_{gmsg,seq}.c: fix various logic bugs that prevented private sequences from being recognized as such. Wed Nov 14 13:30:00 1984 /mtr (agent: Marshall Rose) sbr/m_convert.c: if "0" is given as a message number, print special error message (for use with backquoted pick). sbr/m_gmsg.c: be more careful about saying when "cur" exists. (don't set "curmsg" unless "mp -> msgstats[curmsg] & EXISTS"). Wed Nov 14 10:23:19 1984 /mtr (agent: Marshall Rose) -- All suggestions from Phyllis Kantar at Rand -- mf/mf.{h,c}: add new field entry "note" for 822-style comments. config/addrsbr.h: add corresponding field entry m_note. also change m_hnum to m_type. uip/addrsbr.c: add a new argument to getm() to say what type the default host is. Tue Nov 13 21:05:53 1984 /mtr (agent: Marshall Rose) uip/msh.c: add "sortm" command. uip/sortm.c: clean it up a bit. Tue Nov 13 18:58:43 1984 /mtr (agent: Marshall Rose) tws/{tws.h,dtime.c}: move tws_compare() from uip/picksbr.c to dtime.c, call it twsort(). Tue Nov 13 13:08:41 1984 /mtr (agent: Marshall Rose) newsupport/mh_receive: make it generated during MH configuration. conf/mhconfig.c: support above change. Tue Nov 13 00:58:41 1984 /mtr (agent: Marshall Rose) uip/msh.c: add "inc" and "mhmail" commands (big deal). Tue Nov 13 00:08:01 1984 /mtr (agent: Marshall Rose) uip/{burst,msh}.c: fix bursting algorithm to support forwardings/bcc:s. uip/{forw,mhlsbr,post}.c: strip one extra \n from last encapsulation boundary. Mon Nov 12 22:15:53 1984 /mtr (agent: Marshall Rose) -- All fixes from Fred Blonder at UMCP-CS -- conf/doc/mh.rf: add more details (mini tutorial). sbr/{concat.c,llib-lmh}: use sbr/m_name.c: use simpler method, sprintf(). Also fix size of name[] buffer. Mon Nov 12 11:01:51 1984 /mtr (agent: Marshall Rose) uip/post.c: re-arrange the code a bit for better organization. Mon Nov 12 08:29:19 1984 /mtr (agent: Marshall Rose) conf/makefiles/bbsupport: when MH profile was installed for the BBoards login, the context file wasn't. sbr/m_getdefs.c: if "context:" isn't set in the MH profile, then don't complain if it's not there. Mon Nov 12 08:15:59 1984 /mtr (agent: Marshall Rose) uip/msh.c: msh$show didn't know about the `-form formfile' switch. Sat Nov 10 16:10:33 1984 /mtr (agent: Marshall Rose) sbr/trimcpy.c: remove all trailing [lt]wsp. Thu Nov 8 16:59:37 1984 /mtr (agent: Marshall Rose) uip/bbc.c: trap sigTERM just like sigEMT so user can kill bbc and "have the right thing happen". Wed Nov 7 21:51:56 1984 /mtr (agent: Marshall Rose) uip/post.c: make Bcc:s look more line a forwarded message. uip/mhl.c: add -forwall flag to help forw for batching. the -forward flag now just uses the encapsulation algorithm. Wed Nov 7 20:45:44 1984 /mtr (agent: Marshall Rose) uip/{clr,scan}sbr.c: read termcap to ascertain the length of the scan line. uip/trmsbr.c: used to be called uip/clrsbr.c Wed Nov 7 20:12:04 1984 /mtr (agent: Marshall Rose) sbr/m_draft.c: "Draft-Folder: +drafts" loses. Strip the '+' if need-be. Tue Nov 6 21:33:39 1984 /mtr (agent: Marshall Rose) uip/dist.c: on "push" call ready_draft() prior to actual push() since if dist is invoked from bbr the file being distributed will get zapped prior to ready_draft() getting called. Moby hack. Tue Nov 6 21:16:42 1984 /mtr (agent: Marshall Rose) uip/msh.c: call m_unknown() since advanced m_getfld() algorithm loses otherwise (a long story). Tue Nov 6 09:56:55 1984 /mtr (agent: Marshall Rose) sbr/{m_edit.c,llib-lmh}: add extra argument for $cwd for edit. uip/{comp,dist,forw,repl}.c: call pwd() and invoke m_edit with the extra argument. Tue Nov 6 09:56:21 1984 /mtr (agent: Marshall Rose) conf/mhconfig.c: add "oldload" option for ALTOS. Mon Nov 5 18:15:01 1984 /mtr (agent: Marshall Rose) -- ALTOS port of MH.5 (under #ifdef ALTOS) -- conf/config/config.c: "more" resides in /usr/bin/. "ls" resides in /bin/. conf/config/mts.c: read /etc/mhid for {Local,System}Name(). Also add routine gethostname () which reads /etc/systemid. config/mh.h: #include "../config/altos.h" on #ifdef ALTOS. Also, new #define LINK which is "@" unless ALTOS else "#". config/altos.h: to get past V7 compiler... mf/msgchk.c: was using NULL instead of "" mf/mf.h: #include "../config/altos.h" on #ifdef ALTOS. sbr/m_edit.c: use LINK instead of "@" sbr/m_gmsg.c: use LINK instead of "@" sbr/m_seq.c: was using NULL instead of "" uip/clrsbr.c: use minimum of 2048 size for termcap buffer uip/dist.c: use LINK instead of "@" uip/install-mh.c: use (FILE *)NULL instead of NULL uip/msh.c: don't #include if ALTOS uip/repl.c: use link instead of "@" uip/rmf.c: use link instead of "@" Mon Nov 5 13:14:36 1984 /mtr (agent: Marshall Rose) uip/replsbr.c: don't adios() when can't understand "From:" or "Sender:" field. Continue on, gracefully (ha!) Sun Nov 4 17:40:04 1984 /mtr (agent: Marshall Rose) uip/folder.c: forgot the m_sync() after m_setcur(). This prevented "folder +folder msg" from setting msg as cur. Sun Nov 4 15:00:20 1984 /mtr (agent: Marshall Rose) sbr/m_getfld.c: in the interests of speed-up, change eom() to a macro that calls the auxilary function Eom() if need be. This, along with the addition of a new mbx_style, DEFAULT, should give a significant speed-up in parsing individual files and the MH profile. Finally, make Getc() a macro as well, which calls the routine GETC() only on special occasions. config/mh.h,sbr/{llib-lmh,m_getfld.c}: change mbx_unknown() to m_unknown(). Sat Nov 3 19:56:51 1984 /mtr (agent: Marshall Rose) uip/bbc.c: get this: "bbc -quiet" with no other arguments and a bogus "bboards:" entry in the profile would yield a core dump. Marvelous. Fri Nov 2 17:08:18 1984 /mtr (agent: Marshall Rose) uip/forwsbr.c: remove, put cpydgst() into sbr/cpydata.c config/mh.h, sbr/llib-lmh: declare cpydgst(). Fri Nov 2 13:44:50 1984 /mtr (agent: Marshall Rose) uip/{forw,forwsbr}.c: change encapsulation algorithm to use different bit-stuffing scheme. uip/mhlsbr.c: with -forward (interface from forw), support change in encapsulation algorithm. Fri Nov 2 13:17:27 1984 /mtr (agent: Marshall Rose) uip/replsbr.c: don't bomb if returnee's host is unknown (use AD_HOST instead of AD_NAME). mmdf/hosts.c: when calling mmdf_init() use invo_name and not "mh". Fri Nov 2 07:56:36 1984 /mtr (agent: Marshall Rose) uip/pick.c: if no matches and -list output a "0" so backquoting fails. Thu Nov 1 18:42:44 1984 /mtr (agent: Marshall Rose) sbr/brkstring.c: brkany() wasn't checking for a null string. It does now. Thu Nov 1 15:14:43 1984 /mtr (agent: Marshall Rose) support/mhl.format: change terminal length from 40 to 23. Thu Nov 1 00:33:24 1984 /mtr (agent: Marshall Rose) bbsupport/{bboards.{daily,weekly},bb{save,remove}} - use /bin/sh not /bin/csh bbsupport/bb{aka,exp,tar}.c - call setbbent() with the right argument. Where applicable use /bin/sh not /bin/csh conf/config/MakeBBoards - remove dependencies conf/mhconfig.c - support for empty mmdfldir and non-empty mmdflfil. Wed Oct 31 22:27:33 1984 /mtr (agent: Marshall Rose) uip/repl.c: since post can handle multiple folders in an fcc: line, take advantage of it. Wed Oct 31 20:23:13 1984 /mtr (agent: Marshall Rose) -- All fixes from Phyllis Kantar at Rand -- uip/repl.c: should use done(1) if the initial m_edit fails instead of done(0). sendmts/smail.c: comment out passing of "-ov" to SendMail if compiled at Rand. Wed Oct 31 19:12:58 1984 /mtr (agent: Marshall Rose) uip/rcv{cron,tty}.c: include "../mmdf/util.h" when MMDFMTS. Wed Oct 31 14:41:06 1984 /mtr (agent: Marshall Rose) uip/scansbr.c: change SLINE to 78 (instead of 79). We really should read termcap or an MH profile entry though. Wed Oct 31 08:13:36 1984 /mtr (agent: Marshall Rose) uip/prompter.c: if the skeleton lacked a body sometimes prompter would ask for a body and sometimes it wouldn't. Now it ALWAYS does. uip/show.c: "show -pr -f n" exec'd "pr inbox/-f inbox/n". Now it exec's "pr -f inbox/n" like it should. Wed Oct 31 07:54:41 1984 /mtr (agent: Marshall Rose) mmdf/hosts.c: somehow "mmdf.h" and "util.h" weren't included. Tue Oct 30 22:14:19 1984 /mtr (agent: Marshall Rose) uip/post.c: if we get an address-bearing field without any address, just ignore it instead of complaining about it. Tue Oct 30 21:30:38 1984 /mtr (agent: Marshall Rose) tws/dtimep.c: parse ctime(3) strings, since some fool hosts actually permit that to get into the Internet. Tue Oct 30 18:59:45 1984 /mtr (agent: Marshall Rose) mf/mf.c: very minor clean-up of isfrom(). mhmts/{hosts.c,netmail.c},{mmdf,sendmts}/hosts.c: include mts.h Tue Oct 30 16:35:37 1984 /mtr (agent: Marshall Rose) uip/prompter.c: if the skeleton lacked a body sometimes prompter would ask for a body and sometimes it wouldn't. Now it doesn't. uip/dist.c: call ready_msg() each time ready_draft() is called so user can edit message being dist'd. (sigh) Tue Oct 30 08:12:50 1984 /mtr (agent: Marshall Rose) uip/{comp,dist,forw,repl}.c: make the "push" option at "What now?" level visible. Document the draftfolder switches in the manual page uip/bbc.c: document `-file BBoardsfile' in manual page uip/bbl.c: remove -debug switch uip/repl.c: remove -debug switch uip/send.c: document -[no]remove in manual page, make -push visible and add -nopush. Document the draftfolder switches in the manual pages Mon Oct 29 19:23:10 1984 /mtr (agent: Marshall Rose) uip/bbc.c: remove a couple of calls to setbbent(). They were defeating setbbfile(). They weren't even needed since the first thing that bbc does (even before parsing arguments) is to call setbbent(). uip/show.c: force -noformat, -noheader, and -nopr to be at least three characters for recognition. uip/post.c: when invoking fileproc, add a '+' only if it doesn't start with '+' or '@'. Sun Oct 28 22:12:22 1984 /mtr (agent: Marshall Rose) uip/bbr$repl: forgot to support -[no]query. conf/doc/tmac.h: add .nf and .fi at the right spots for "FILES", etc. Sun Oct 28 20:36:45 1984 /mtr (agent: Marshall Rose) uip/folder.c: On "folder +foo", if +foo doesn't exist, ask if it should be. Sun Oct 28 10:32:06 1984 /mtr (agent: Marshall Rose) uip/*.c: remove calls to m_news(), also add m_foil() to foil implicit calls to m_getdefs (). {sbr/m_getdefs,uip/rmf}.c: make mp->others checking a bit smarter for #ifdef UCI. Sat Oct 27 23:08:23 1984 /mtr (agent: Marshall Rose) sbr/m_getdefs.c: create the MH-directory if it's not there. uip/rmf.c: when rmf'ing a folder make sure parent's folder is writable as well as the folder. Wed Oct 24 21:46:22 1984 /mtr (agent: Marshall Rose) conf/config/config.c, config/mh.h: add libpath() which looks first in m_maildir and then etcpath for the file. Get rid of the std* variables since libpath() now does the same thing. With libpath, we now search m_maildir and then etcpath for alias files for send and whom, form files for comp, dist, forw, and repl, and filter files for forw and mhl. Wed Oct 24 11:00:55 1984 /mtr (agent: Marshall Rose) -- All fixes from Terry Domae at NRTC -- conf/mhconfig.c: invoke mhdoc with csh explicitly since V7 doesn't. conf/config/config.c, config/mh.h: add new global variable libpath. uip/mhlsbr.c: support libpath for system-wide forms. config/mh.h,mf/mf.c,sbr/getusr.c,uip/post.c: add -DNRTC for MAILID support uip/replsbr.c: don't panic if the host for the sender/from field is unknown. uip/{send,whom}.c: forgot to use m_draft() instead of m_maildir(draft). sbr/m_draft.c: fix things up for show -draft. uip/show.c: add a "-form formfile" switch. Also, support for -draft to reflect draftfolders. Tue Oct 23 12:35:58 1984 /mtr (agent: Marshall Rose) conf/config/mts.c, mts/mts.h: remove the mbx_lock() and mbx_unlk() routines and replace them with the lock-and-open routines lkopen(), lkclose(), lkfopen(), and lkfclose(). lkopen() acquires an exclusive lock on the named file (which *must* exist) and then the appropriate open. lkclose() releases the lock and closes the file. lkfopen() is to lkopen() as fopen() is to open(). lkfclose() is to lkclose() as fclose() is to close(). I had to do all this so with 4.2BSD we can use flock to do the locking instead of the link/unlink business. Mon Oct 22 11:37:30 1984 /mtr (agent: Marshall Rose) sendmts/smail.c: forgot to declare parameter watch for -DSENDMAIL. conf/makefiles/*: make "make install" a synonym for "make inst-all". conf/makefiles/*: support $(DESTDIR) convention. Sat Oct 20 11:47:26 1984 /mtr (agent: Marshall Rose) uip/post.c: let fcc: fields have more than one folder entry. Fri Oct 19 08:57:23 1984 /mtr (agent: Marshall Rose) uip/dist.c: instead of introducing Prev-Resent-Header: just prepend Prev- to previous resent-XXX: fields. uip/{post,dist}.c: append resent-XXX: fields instead of prepending them. Also some minor clean-up. tws/dtime.c: use a better structure to permit "fool-proof" generation of time with dst. tws/dtimep.c: minor clean-up. Thu Oct 18 11:14:15 1984 /mtr (agent: Marshall Rose) uip/annosbr.c: if file doesn't exist, don't spit out error diagnostic (comp/dist/forw/send -anno followed by push). Wed Oct 17 10:02:27 1984 /mtr (agent: Marshall Rose) uip/inc.c: more mtstailor fixes, always read MAILDIR. uip/prompter.c: add the -[no]rapid switch. Mon Oct 15 08:27:13 1984 /mtr (agent: Marshall Rose) conf/{mhconfig.c,config/config.c}: make the default editor configurable. conf/mhconfig.c: add support for othersupport/Makefile. Makefile,conf/{config/mts.c,makefiles/mts}: add support for the mtstailor file. othersupport/tutorial/: include the MH tutorial uip/{ap,bbr,conflict,inc,post,rcvcron,rcvlink,rmail,sbboards,slocal}.c, mts/msgchk.c: add support for the mtstailor file. uip/{rmail,sbboards,slocal}.c: foil m_getdefs() (just in case). Fri Oct 12 09:53:56 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/ap.c: be sure to foil m_getdefs() for consistency. Fri Oct 12 09:52:19 1984 Rand MH Mail Handler (agent: Marshall Rose) sbr/m_edit.c: change rindex() to r1bindex(). Silly typo. Wed Oct 10 14:41:30 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/rcv{cron,link,tty}.c: foil m_getdefs() for JLR. Wed Oct 10 09:15:23 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/install-mh.c: fix minor typo in display of help message. Mon Oct 1 20:49:32 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/repl{,sbr}.c: add the -[no]query switch which interactively prompts the user for info on who should be replied-to. Mon Oct 1 20:48:25 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/{scan,inc,scansbr}.c: change scansbr.h to #define the return codes from scansbr$scan(). Modify scan.c to say if a null message is empty. Sat Sep 22 20:19:40 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/rcvlink.c: new rcvmail hook, just like the old rcvlink hook used in the ZOTnet. Sat Sep 22 19:03:02 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/sbboards.c: forgot a few arguments in a couple of printf-like strings. Fri Sep 21 19:25:25 1984 Rand MH Mail Handler (agent: Marshall Rose) sendmts/hosts.c: change ALLHOSTS logic: if we're running with an exception file, then turn ALLHOSTS on (let mail system be final arbitrator). Also, if using an exception file, play along if the file can't be opened. Wed Sep 19 16:02:18 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/scan..c: if message is unreadable (errno==EACCES), just say "unreadble", don't bother to call admonish(). Tue Sep 18 14:30:57 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/inc.c: Check $MAILDROP prior to checking the Maildrop: profile entry. Tue Sep 18 14:16:53 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/folder.c: if folder is unreadable (errno==EACCES), just say "unreadable", don't bother to call admonish(). Sun Sep 16 16:08:39 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/folder.c: change capitalization of "%d Folder%s" to "%d folder%s". Wed Sep 12 20:02:22 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/rcv{cron,tty}.c: if not reading mmdf.h, then read smail.h to get proper definitions of RP_M{ECH,OK}. Tue Sep 11 19:59:24 1984 Rand MH Mail Handler (agent: Marshall Rose) tws/dtime.c: have it know about EDT. Really, dtimezone needs to get fixed up and use two tables instead of one... Mon Aug 27 05:07:37 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/inc.c: examine the profile entry "maildrop" to override the default maildrop if necessary. "maildrop" is interpreted with m_mailpath(), so if not an absolute path, it's interpreted relative to the user's MH directory. Mon Aug 27 05:00:44 1984 Rand MH Mail Handler (agent: Marshall Rose) Decide that mh.4 is finished. This file keeps track of the changes made between the mh.4 and mh.5 versions. As usual, it's being kept in add-source-change format. [Actually, mh.4 was finished on July 1, 1984. For obscure reasons, this ChangeLog didn't start until August 27th though.] MHCHANGES from mh.3 to mh.4 Fri Oct 26 22:19:42 1984 Rand MH Mail Handler (agent: John Romine) conf/Makefile: make CFLAGS=-O, LDFLAGS=-ns sendmts/smail.c: line 99: formal parameter 'watch' was missing. Thu Aug 2 15:05:29 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/rcv{cron,tty}.c: move the ``#include '' above the ``#include "mmdf.h"'' mf/*.{h,c}: change lexequ() to lequal() to avoid conflict with MMDF-II routine name. Wed Jul 25 08:49:44 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/bbr.c: bring upto date with dist/forw/repl's -nodraftfolder. sbr/trimcpy.c: fold tabs into spaces in addition to newlines. Mon Jul 23 19:07:00 1984 Rand MH Mail Handler (agent: Marshall Rose) sbr/m_getdefs.c: allow long lines in MH profile. uip/ptt.c: rename ptt.c to ap.c and install in MH etc directory. Mon Jul 23 16:09:04 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/{scan,replsbr}.c: use ismymbox to determine if address is my mailbox. uip/addrsbr.c: add ismymbox() to say just that. Mon Jul 23 14:27:51 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/{comp,dist,forw,repl,send}.c: add -nodraftfolder switch to turn off draft folder. uip/send.c: add -[no]unique switch to enable/disable message renaming on pushes. Mon Jul 23 09:11:27 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/scansbr.c: If the message has no date, flag it and use the date on the file, if appropriate (e.g., from 'scan' not 'inc'). Mon Jul 23 09:08:12 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/{dist,forw,repl}.c: fix busted logic when m_draft() is called after we've built the msgs structure for the folder we're working on. Call m_draft() first. Other solution was to have m_draft() do a pwd(), save the result, do its work, and then chdir() back. Sigh. Sat Jul 21 14:15:43 1984 Rand MH Mail Handler (agent: Marshall Rose) sbr/{m_gmsg,m_seq}.c: allow "compressed" sequence descriptors (e.g., x-y instead of x x+1 ... y-1 y). Makes things run faster and avoids problems if a sequence is really *big*. Fri Jul 20 21:27:03 1984 Rand MH Mail Handler (agent: Marshall Rose) uip/{comp,dist,forw,repl}.c: new logic if draft exists. uip/{comp,dist,forw,refile,repl,send}.c: fix miscalculation in path of draft/source folder. Thu Jul 19 19:56:16 1984 Rand MH Mail Handler (agent: Marshall Rose) sbr/m_edit.c: put back in the draft preserve/delete logic from mh.2 sbr/m_draft.c: add the "use" parameter saying whether "new" or "cur" should be the default. Wed Jul 18 20:39:29 1984 Rand MH mail system (agent: Marshall Rose) sbr/path.c: add compath() logic to compress things like @.. and so on. Wed Jul 18 05:35:14 1984 Rand MH mail system (agent: Marshall Rose) uip/{comp,dist,forw,repl}.c: Add -draft{folder,message} switches, remove -[no]unique switches sbr/m_draft.c: New module to interpret -draft switches uip/send.c: Handle multiple messages, add -draft{folder,message} switches, add -push switch uip/bbr.c: bring dist, forw, and repl up to date with all these changes conf/config/config.c: change mh_deliver to postproc Wed Jul 18 03:01:11 1984 Rand MH mail system (agent: Marshall Rose) Install the code necesary for the @folder notation, meaning +cwf/folder (TSUBCWF). Tue Jul 17 19:20:10 1984 Rand MH mail system (agent: Marshall Rose) uip/anno.c: don't require -text. Also fix bug in prompting. Tue Jul 17 16:19:14 1984 Rand MH mail system (agent: Marshall Rose) uip/folder.c: handle +folder and msg argument with -all. Tue Jul 17 16:02:02 1984 Rand MH mail system (agent: Marshall Rose) uip/bbr.c: bring dist, forw, and repl up to date with -[no]unique. Tue Jul 17 00:08:52 1984 Rand MH mail system (agent: Marshall Rose) Install the Sequence-Negation mechanism. Mon Jul 16 22:07:40 1984 Rand MH mail system (agent: Marshall Rose) uip/*.c: Change arguments[50] to arguments[MAXARGS]; change msgs[100] to msgs[MAXARGS] to avoid argument overflow with new pick. Mon Jul 16 15:51:28 1984 Rand MH mail system (agent: Marshall Rose) Gather up the ZOTnet libraries into zotnet/libzot.a, makes things less complicated. Mon Jul 16 00:21:52 1984 Rand MH mail system (agent: Marshall Rose) Install the new Previous-Sequence mechanism. Introduce the SEQMOD flag to the msgs structure. Just about every MH program now calls m_setseq () upon parsing the messages and calls m_sync() prior to exiting. Mon Jul 16 00:18:49 1984 Rand MH mail system (agent: Marshall Rose) uip/{comp,dist,forw,repl}.c: If "quit" with no "delete, tell the user the name of the draft file. uip/send.c: if invoked as "push", act accordingly sbr/m_send.c: know about "push". uip/mhpath.c: -help wasn't any. uip/rcv{cron,tty}.c: set-up for an MMDF system. Sun Jul 15 17:10:38 1984 Rand MH mail system (agent: Marshall Rose) uip/{comp,dist,forw,repl}.c: Add -[no]unique switch. uip/send.c: Remove -[no]unique switch, also read ~/.signature file and define $SIGNATURE if need be. uip/post.c: Don't read ~/.signature file, use $SIGNATURE only. uip/{bbr$scan,inc,scan,scansbr}.c: Only do the ftell() business with -size on an inc. The others can do an fstat or pointer arithmentic to calculate the size. Sun Jul 15 03:01:12 1984 Rand MH mail system (agent: Marshall Rose) uip/{comp,dist,forw,repl}.c: If send of draft loses, come back to "What now?" level. Also fix bug with invocation of editor. Fri Jul 13 13:37:21 1984 Rand MH mail system (agent: Marshall Rose) uip/scansbr.c: Compress the fields a bit. Right-justify some parts of the header. Fri Jul 13 13:17:48 1984 Rand MH mail system (agent: Marshall Rose) uip/folder.c: Set up things so DMAXFOLDER is used when formatting the output strings. Wed Jul 11 18:41:07 1984 Rand MH mail system (agent: Marshall Rose) uip/folder.c: remove -up, -down, and -short uip/pick.c: toss all the file-op:s, -scan, and -show. Just define sequences, or spit 'em to stdout. The select sub-folder is dead! Long live user-defined sequences! Pick got rid of 11 (!!) switches this way, and we've taken our first step into a new age of functionality. Wed Jul 11 02:25:25 1984 Rand MH mail system (agent: Marshall Rose) uip/repl.c: toss the hidden -[no]ccme switches. Tue Jul 10 01:15:22 1984 Rand MH mail system (agent: Marshall Rose) config/mh.h, conf/config/config.c, sbr/m_{getdefs,update}.c: add "context" file in addition to the MH-profile. The former is dynamic, it contains pfolder and private sequences. The latter is static, it contains switches, etc. The ctx file defaults to Mail/context. But in the MH-profile, you can define the entry for "context" to be whatever you want... Mon Jul 9 23:15:20 1984 Rand MH mail system (agent: Marshall Rose) uip/{scan,inc,bbr}.c: new switches -[no]size to show the size of the message. uip/scansbr.c: implement -size for scan, inc, and bbr$scan. uip/folder.c: new switches to implement the folder stack. uip/clrsbr.c: consolidate clear_screen() into one file. Mon Jul 9 17:05:09 1984 Rand MH mail system (agent: Marshall Rose) sbr/showfile.c: take arg vector from caller. uip/show.c: new "-file file" switch for showfile. sbr/m_edit.c: take arg vector from caller. If present, give to editor in exec. Mon Jul 9 14:48:51 1984 Rand MH mail system (agent: Marshall Rose) config/mh.h: add extern char *version. sbr/help.c: have help() print out program name and version info. conf/makefiles/uip: use version.sh to create version.c for loading with uip:s. Mon Jul 9 00:01:01 1984 Rand MH mail system (agent: Marshall Rose) uip/prompter.c: with BSD42, do a clearerr() on stdin when we get an EOF. Otherwise, with an EOF in the headers, we lose big... Sun Jul 8 23:58:56 1984 Rand MH mail system (agent: Marshall Rose) uip/bbr.c: add the hidden "-prompt string" switch for JLR. Sat Jul 7 18:51:02 1984 Rand MH mail system (agent: Marshall Rose) mhmts/hosts.c: add '#include ' for #ifdef BSD42. sbr/m_gmsg.c: fix initializatino of flags[]. uip/whom.c: close down fd:s, just like send does, to avoid the infamous "too many open" files error with the MMDFMTS version of post. uip/pick.c: fix-up "[Folder xyz being re-used]" message. It was using the wrong string for the folder name. Sat Jul 7 01:03:02 1984 Rand MH mail system (agent: Marshall Rose) sbr/m_edit.c: #undef the $EDITOR stuff, maybe it's not such a good idea... Mon Jul 2 02:07:37 1984 Rand MH mail system (agent: Marshall Rose) uip/post, uip/send: rework BCC handling to allow the use of a filter file. Sat Jun 30 23:27:27 1984 Rand MH mail system (agent: Marshall Rose) uip/send: if $SIGNATURE is empty, and there's a "signature" entry in the profile, set $SIGNATURE to that for post. Sat Jun 30 16:40:22 1984 Rand MH mail system (agent: Marshall Rose) sbr/m_edit.c: On first edit, if "-editor pgm" not specified, try to use $EDITOR prior to using the profile entry for editor. Sat Jun 30 16:23:20 1984 Rand MH mail system (agent: Marshall Rose) Add the -[no]public switches to bbr$mark, bbr$pick, mark, and pick. Sat Jun 30 16:23:01 1984 Rand MH mail system (agent: Marshall Rose) Add the SMTP option to the SendMail configuration. Extend post/send to accept -mail, -soml, -saml, and -send. Also add -client host and -server host. Sat Jun 30 12:29:53 1984 Rand MH mail system (agent: Marshall Rose) config/mh.h: Raise MAXFOLDER to 2K-1 and modify DMAXFOLDER as appropriate. Also, make LOWSEL dependent on MAXFOLDER. Sat Jun 30 12:28:48 1984 Rand MH mail system (agent: Marshall Rose) config/mh.h: compact msgs structure a bit. Also add new entry, mp -> attrstats, which tells if the corresponding attribute named in mp -> msgattrs is public or private. Sat Jun 30 12:28:21 1984 Rand MH mail system (agent: Marshall Rose) sbr/m_getdefs.c: make sure $MH is non-empty before using it. Fri Apr 6 10:52:26 1984 PostMaster (agent: uip/show.c: mhl wasn't seeing its name so it wasn't checking its profile entry. (fix from spencer thomas at utah-gr). Mon Apr 2 07:34:35 1984 PostMaster (agent: John Romine) uip/refile.c: remove(): bug fix. call delete-prog if (filep > 0) instead of if (filep > 1). Sat Mar 31 08:26:29 1984 PostMaster (agent: John Romine) uip/mhmail.c: unlink temp file when exiting due to null input. Fri Feb 17 09:10:55 1984 Rand MH System (agent: John Romine) uip/bbc.c: output last update date with -topics in short form instead of local leaders. local leaders are listed with the other fields with -topics -verbose. Thu Feb 16 10:19:12 1984 PostMaster (agent: Marshall Rose) uip/bbr.c - Have bbr use a different prompt based on the name it was invoked with. This is useful, since it used to use the same prompt as "ex". This got confusing since sometimes you'd be editing a file in ex while composing a message from bbr. Wed Feb 15 14:47:18 1984 PostMaster (agent: Marshall Rose) Decide that mh.3 is finished. This file keeps track of the changes made between the mh.3 and mh.4 versions. Note that it's being kept in add-source-change format instead of the usual add-change-log-entry format. [Unfortunately, changes up through MH 3 are apparently lost, unless people at Rand and/or UCI have them stashed away somewhere... --Dan Harkless] nmh-1.5/docs/ChangeLog_MH-6.7.0_to_MH-6.8.4.html000644 007761 000765 00000135420 11476006206 020341 0ustar00kenhkenh000000 000000 MH Change Log

                                   Changes to
                      The RAND MH Message Handling System:
                               UCI version MH 6.8


                                 John L. Romine

                            Computing Support Group
                        Information and Computer Science
                        University of California, Irvine
                             Irvine, CA  92717-3425
                               Bug-MH@ICS.UCI.EDU
                           http://www.ics.uci.edu/~mh/


                                   ABSTRACT


                    This document describes the changes to the
               UCI version of the RAND MH system from MH 6.6 to
               this release of MH 6.8.  This document is meant to
               supplement, not supersede, the standard MH User's
               manual and MH Administrator's manual.

                    Comments concerning this documentation should
               be addressed to the mailbox Bug-MH@ICS.UCI.EDU.
               Current information about MH can be obtained from
               the MH Home Page on the World Wide Web at
               http://www.ics.uci.edu/~mh/.



          ACKNOWLEDGEMENTS

          The MH system described herein is based on the original RAND
          MH system.  It has been extensively developed (perhaps too
          much so) by Marshall T. Rose and John L. Romine at the
          University of California, Irvine.  Einar A. Stefferud, Jerry
          N. Sweet, and Terry P. Domae provided numerous suggestions
          to improve the UCI version of MH.

               Of course, a large number of people have helped MH
          along.  The list of "MH immortals" is too long to list here.
          For this release, numerous MH-Workers sent in fixes and
          other changes.  A handful of courageous MH-Workers volun-
          teered to beta-test these changes; their help is particu-
          larly appreciated.

          DISCLAIMER

          The Regents of the University of California wish to make  it
          known that:

               Although each  program  has  been  tested  by  its
               contributor,  no  warranty, express or implied, is
               made by  the  contributor  or  the  University  of
               California,  as to the accuracy and functioning of
               the program  and  related  program  material,  nor
               shall the fact of distribution constitute any such
               warranty, and no responsibility is assumed by  the
               contributor  or  the  University  of California in
               connection herewith.

          CONVENTIONS

          In this document, certain formatting conventions are adhered
          to:

               The names of UNIX commands, such as comp are  presented
               in italics.

               Arguments to programs, such as `msgs' and `-nobell' are
               delimited by single-quotes.

               Text that  should  be  typed  exactly  as-is,  such  as
               command  lines (e.g., "folder -pack"), are delimited by
               double-quotes.

               UNIX pathnames and envariables, such  as  /usr/uci  and
               $SIGNATURE, are presented in bold font.


          CHANGES FOR MH 6.8.4

          The MH 6.8.4 release is a minor maintenance release, and
          contains few user-visible changes.  The changes consist
          mostly of documentation improvements, minor bug fixes, and
          some portability enhancements for BSD 4.4 and Solaris 2.x
          (contributed changes for HPUX and OSF1 have not yet been
          integrated into this release).  This is the current version
          of MH as of February 8, 1996.

          Runtime Tailoring

          By default post will now give the SMTP HELO command with the
          local hostname.  If you specify a hostname with the
          clientname: option in the mtstailor file, post will give the
          HELO command with that name instead.  If the argument to the
          clientname: option is empty, no HELO command is given.  See
          mh-tailor(5) for more details.

          Multi-media Mail & Encryption

          A few new PGP support programs can be found in the
          support/general directory.  repl supports the `-[no]mime'
          option.  See repl(1) for more details.


          CHANGES FOR MH 6.8.3

          The MH 6.8.3 maintenance release contains few user-visible
          changes.  Most of the changes are internal to the multi-
          media display program mhn to support RFC 1521 (the new MIME
          standard).  This is the current version of MH as of December
          1, 1993.

          Runtime Tailoring

          When posting mail using the SMTP, post did not normally send
          the HELO command. This was because SendMail would fail if
          the host name given in the HELO command was the local host.
          Later versions of SendMail will now complain if you omit the
          HELO command.

          User Interface Programs

          folder  The folder command now has `-create' and `-nocreate'
                  options.  See folder(1) for details.

          inc     A bug where `-host' would not override the pophost
                  as set in the mtstailor file has been fixed.  This
                  bug was also fixed in msgchk.

          mhn     The mhn command has several changes:  updates for
                  conformance with RFC 1521, addition of two caches:
                  public and private, addition of two caching poli-
                  cies: one for reading and one for writing, support
                  for storing multipart entities, and a few bug fixes.
                  See mhn(1) for complete details.

          CHANGES FOR MH 6.8.2

          The MH.6.8.2 patch release contains only internal changes to
          support the BSD 4.4 and 386BSD versions of UNIX.  This ver-
          sion of MH was released August 25, 1993, but was not widely
          distributed.

          CHANGES FOR MH 6.8.1

          The MH.6.8.1 patch release is a maintenance release.  This
          is the current released version of MH as of August 20, 1993.

               This release includes a small number of bug fixes, a
          few minor enhancements, some changes for the new MIME stan-
          dard, and support for ESMTP (RFC 1425).  Support for BSD 4.4
          and 386BSD is planned for the next release.

               Many other fixes which have already been received are
          still being merged.  If you've sent an update for MH 6.8 to
          Bug-MH@ics.uci.edu and it isn't in this release, it'll prob-
          ably appear in the next release.

          Fixes and Enhancements

          Many minor documentation corrections were made.  There are
          also a few program changes:

          mhn   The `-cache policy', `-[no]check', and `-[no]pause'
                switches have been added.   Some other minor changes
                have been made to comply with the new MIME standard.
                See mhn(1) for complete details.

          post  When posting mail with SendMail, post will not use the
                ONEX command when it is posting a message with BCCs.

          scan  scan will now work with big width values.

          Format Strings

          One new function has been added:

          %(profile arg)  This function looks up a component in the
                          .mh_profile or context files and returns the
                          value of that component.

          Configuration

          Two new configuration options are present:

          GCOS_HACK    The so-called "gcos" field of the password file
                       is used as a last resort to find the user's
                       full name (see mh-profile(5) for details).
                       Enable this option if your passwd(5) man page
                       notes that the `&' character in the "gcos"
                       field stands for the login name.

          NORUSERPASS  Tells MH that your system doesn't have the
                       ruserpass(3) routine; MH will include its own
                       copy of this routine in its library.


          CHANGES FOR MH 6.8

          This is the current released version of MH as of December
          14, 1992.  This release includes a number of bug fixes and
          internal changes to make the code more portable.  Two new
          authentication methods are provided for the POP, and support
          for SVR4 shared libraries is complete.

               The major user-visible change in this release is the
          incorporation of support for multi-media mail as specified
          by the Multi-purpose Internet Mail Extensions (MIME)
          RFC 1341.  This allows you to include things like audio,
          graphics, and the like, in your mail messages.  A new com-
          mand, mhn, has been provided to support MIME and a detailed
          man page is provided in mhn(1).

          Documentation

          The documentation has some general improvements, and the
          READ-ME document has been re-organized to help MH adminis-
          trators find the appropriate configuration options for their
          system.  The Makefiles in the papers/ hierarchy have been
          changed to invoke TeX as "tex" (instead of "tex82").

          The following new man pages are also available:

          mhn(1)      mhn helps the user process multi-media mail.

          mhparam(1)  mhparam lets the user extract information from
                      the MH profile.

          popauth(8)  the APOP database administration program (see
                      below).

          popi(1)     the POP initiator (see below).

          slocal(1)   fully documents slocal.  The mhook(1) man page
                      now documents only the MH receive-mail hooks.

          Internal Changes

          The MH source code is in the process of being cleaned up to
          make pedantic ANSI C compilers happy.  Occurrences of "NULL"
          have been replaced by "0" where appropriate.  Extra tokens
          after "#else" and "#endif" have been put inside comments
          (this is still in progress).  The code should now compile
          cleanly on many more systems, specifically, more variants of
          SVR4.

               The version of tws/dtimep.c which was included in MH
          6.7.2 was incompatible with the lex library on some systems,
          and has been removed.

               A bug in the handling of blind lists inside alias files
          has been fixed.

          Post Office Protocol

          There were three new options added to the POP.

          APOP  This option indicates that the POP daemon will support
                the   non-standard   APOP  command  which  provides  a
                challenge-based authentication system  using  the  MD5
                message digest algorithm.

                This option also causes  the  popauth  program  to  be
                installed,   which   allows   the   administrator   to
                manipulate the APOP authorization database.

          KPOP  Support for KERBEROS with POP.  This code builds popd,
                inc and msgchk to support only the "kpop" protocol.
                This code is still expiremental, but is available for
                those sites wishing to test it.

          MPOP  This option indicates that the POP daemon will support
                the non-standard XTND SCAN command which provides per-
                formance enhancements when using the POP over low-
                speed connections.

                This option also causes an interactive POP client pro-
                gram, popi, to be compiled and installed.  A man page
                for the popi program is also provided.  This option
                requires the configuration to have "bboards: pop".

          The APOP and MPOP non-standard POP facilities are documented
          in The Internet Message (ISBN 0-13-092941-7), a book by
          Marshall T. Rose.  For more details, see support/pop/pop-
          more.txt and the Administrator's Guide.  The APOP option
          peacefully co-exists with the standard POP, KPOP completely
          replaces the standard POP, and MPOP requires "bboards: pop".

          File Locking

          The file locking code has been cleaned up to support three
          kinds of kernel-level file locking.  As appropriate for your
          system, include the LOCKF, FCNTL or FLOCK option.  For more
          details, see mh-tailor(5).

          Configuration Directives

          A number of new configuration directives have been added  or
          changed.  The full details are given in the READ-ME.

          cp:        The command used to  install  new  files  if  not
                     "cp".

          ln:        The command used to link files  together  in  the
                     source tree if not "ln".

          mts:       Full support for ZMAILER has been added.

          popdir:    The directory where popd will be installed if not
                     /usr/etc.

          regtest:   Set to "on" to prevent the hostname  and  compile
                     date from being included in MH binaries.

          sharedlib: You may now specify "sun4" or "sys5"  (for  SVR4)
                     shared libraries.

          signal:    Specifies the base type of the function  returned
                     by  signal().   This  was previously defined with
                     "options TYPESIG".

          Several `-D' options to cc have been added or changed:

          APOP       Authenticated POP (see above).

          AUX        Support for A/UX systems.

          DBMPWD     The DBM option has been renamed DBMPWD.

          HESIOD     Support for the HESIOD name server.

          KPOP       KERBEROS POP (see above).

          LOCALE     Support for local characters sets; uses the set-
                     local() function.

          MAILGROUP  Makes inc set-group-id.  You may need this option
                     if your /usr/spool/mail is not world-writeable.

          MIME       Multi-media mail.

          MPOP       Mobile POP (see above).

          MSGID      Enables slocal to detect and surpress duplicate
                     messages.

          OSF1       Support for DEC OSF1 systems.  May be incomplete.

          RENAME     Include this option if your system has a rename()
                     system call.

          SVR4       Support for System 5 Release 4 or newer systems.

          TYPESIG    This option has been dropped.  See `signal'
                     above.

          UNISTD     Include this option if your system has the
                     include file <unistd.h>.

          VSPRINTF   Include this option if your system has the
                     vsprintf() library routine; otherwise, _doprnt()
                     will be used.

          YEARMOD    Forces the mh-format `year' function to return
                     2-digit values.  Use this option during a brief
                     transition period if you have local mh-format
                     files which need to be converted to support 4-
                     digit years.

          FUNCTIONAL CHANGES

          In addition to the configuration changes mentioned above, a
          number of functional changes have been made to the system.
          Many programs have new features added and a few new programs
          have are provided. Each command's manual page gives complete
          information about the its operation.  Here is a short sum-
          mary of the changes.

          MH Sequences

          A larger number of user-defined sequences are available.
          Previously, this number had been 10.  On 32-bit systems, 26
          user-defined sequences are available.

          Profile Components

          MH programs will now complain if the .mh_profile does not
          end in a newline.  Also, one enhancement and one new profile
          component are provided:

          Aliasfile:  Multiple filenames may now be given.

          Inbox:      New; the default folder (for inc, etc.) if not
                      "inbox".

          Format Strings

          A few minor bugs were fixed in format string handling, and a
          few  new features were added.  See mh-format(5) for complete
          details.

          Addresses      An  attempt  is  made   to   decipher   X.400
                         RFC 987-style addresses.

          Comments       Comments may be added to mh-format  files;  a
                         comment  begins with the 2-character sequence
                         "%;", and ends with an un-escaped newline.

          %(modulo n)    The `modulo' function escape has been added.

          %(year{date})  The  date  parser  has   been   enhanced   to
                         understand  more illegal date formats; `year'
                         now returns a 4-digit number.

          User Interface Programs

          A number of MH commands have minor changes:

          ali       The output with `-user -list' was changed to match
                    the output with `-nouser -list'.

          burst     Will no longer drop the last message of a digest.

          inc       Accepts the `-apop' switch for authenticated POP
                    (see above); will attempt to detect write errors
                    (e.g., no space left on device) when incorporating
                    mail; no longer replaces newline characters with
                    NULLs.

          folder    The `-noprint' option was broken and has been
                    dropped.

          forw      Supports `-mime' to use MIME-style multi-part mes-
                    sages.

          mhl       Will no longer put an extra space at the end of
                    the `%{text}' in a formatfield.

          mhn       New; manipulates multi-media (MIME) messages; a
                    detailed man page is provided.

          mhparam   New; reads the MH profile (and context) and writes
                    the values of the specified components on the
                    standard output; useful in programmatic con-
                    structs.

          msgchk    Supports `-apop' (see above).

          packmbox  New; packs an MH folder into a UUCP-style mailbox.

          popi      New; a client-side POP initiator; available only
                    if you built MH with the MPOP option (see above).

          refile    A bug where the `rmmproc' did not remove all
                    specified message files has been fixed.

          scan      The `-file' option is fully supported and will no
                    longer complain about empty folders.

          send      Supports `-mime' and `-split' to split large mes-
                    sages into multiple partial messages using MIME.

          Support Programs

          fmtdump   Can now read a format file, or a format string
                    given on the command line.

          popauth   New; manages the APOP authorization database (see
                    above).

          sendmail  The sendmail replacement will be installed only if
                    your `mts' setting uses the `/smtp' option.

          slocal    A new man page for slocal is available; the new
                    `mbox' action is available to write a file in
                    packf format; a bug where extra `>' characters
                    were written to MMDF-style maildrops has been
                    fixed; if compiled with the MSGID option, can
                    detect and suppress reception of duplicate mes-
                    sages.

          viamail   New; bundles a directory (like shar) and sends it
                    through multi-media mail.


          CHANGES FOR MH 6.7.2

          The MH.6.7.2 patch release is a maintenance release.  This
          is the current released version of MH as of February 1,
          1992.

               This release now supports the NCR Tower running SYS5R4.
          The WP changes installed in MH.6.7.0 have been removed.

          Shared Libraries

          Support for SYS 5 shared libraries is in progress.

               Support for Sun OS 4.0 shared libraries had been
          improved.  The MH library has been modified to move initial-
          ized data into a data definition file.  The shared library
          will now consist of a libmh.so and libmh.sa file.  The
          shared library version number will no longer track the MH
          patch release number, and its numbering begins with version
          `1.1' with this release.

          Replacement SendMail

          Since many standard system programs expect to post mail by
          invoking /usr/lib/sendmail, a minimal replacement SendMail
          is provided in this release.  This replacement is meant to
          be installed on (e.g., diskless) client workstations which
          post mail using SMTP, and do not run a message transport
          system.  It will call post to post mail; be sure you have
          configured MH with the `/smtp' mts option.  This sendmail
          replacement is installed in your MH etc directory, and you
          should link /usr/lib/sendmail to it.

          Format Strings

          A manual page for the fmtdump format string disassembler  is
          supplied, and some new format functions were added:

          folder   In scan, this component escape contains the name of
                   the current folder.  It is not defined for other MH
                   commands.

          getenv   This  function  escape  returns  the  value  of  an
                   environment variable.

               There will be some additional changes in these routines
          in the next patch release.

          Other Bug Fixes and Enhancements

          In addition to some other minor enhancements, some bugs were
          fixed which in general were not user-visible:

          Blind lists   Users may now specify RFC822 address groups in
                        their   alias   files.    These   groups   are
                        implemented by MH as blind lists.

          date parsing  A number of sites have brain-damaged  versions
                        of lex.  MH will now come with the date parser
                        already run through lex.

          mark          A bug dealing with mark and the sequence named
                        `cur' is fixed.  This was previously a problem
                        for mh-e users.

          MH.doc        The MH nroff version of the manual  no  longer
                        contains teletype escape sequences.

          scan          Can now handle headers as long as 512 bytes.

          Signals       MH programs will no longer catch the  HUP  and
                        TERM  signals while waiting for a sub-process.
                        This was  causing  hung  processes  when  your
                        terminal line was was dropped unexpectedly.

          Signature     If your signature is not defined, MH will  use
                        the   value   of   the  gecos  field  of  your
                        /etc/passwd entry as your signature.

          version.sh    A bug in the awk script  in  config/version.sh
                        was fixed.


          CHANGES FOR MH 6.7.1a

          The MH.6.7.1a patch was made available on January 25, 1991
          for limited distribution only.  (This release had some known
          bugs, and so was not widely distributed.)  This release
          incorporates several new features of particular note to
          users of sequences and format strings, as well as some gen-
          eral documentation improvements.  There are a few minor
          enhancements and internal bug fixes also.  Complete documen-
          tation of these changes is given in the individual manual
          pages, and the READ-ME file.

          Message Sequences

          A new manual page, mh-sequence (5), has been added.  This
          manual page attempts to completely document the syntax and
          semantics of MH message sequence specifications.

               A powerful new feature is the ability to specify mes-
          sage ranges with user-defined sequences.  The  specification
          "name:n" may be used, and it designates up to the first `n'
          messages (or  last  `n' messages  for  `-n') which  are
          elements  of the user-defined sequence `name'.

               The message specifications "name:next" and "name:prev"
          may also be used, and they designate the next or previous
          message (relative to the current message) which is an ele-
          ment of the user-defined sequence `name'.  The specifica-
          tions "name:first" and "name:last" are equivalent to
          "name:1" and "name:-1", respectively.  The specification
          "name:cur" is not allowed (use just "cur" instead).

               These specifications allow the user to step through a
          sequence with a command like "show name:next".

          Format Strings

          MH format strings now support an if-then-elseif-else clause
          (the `elseif' is new).  This will make format strings with
          multi-case conditions somewhat less complex.

               A new format function `addr' had been added.  This
          function takes an address header name as its argument, and
          returns a rendering of the address contained in that header
          as "user@host" or "host!user".

               Format widths now may be specified as a negative
          number.  This causes the output to be right-justified within
          the format width.

          Other Changes

          Along with a few minor enhancements, some  bugs  were  fixed
          which in general were not user-visible:

          fmtdump  This  new  program  produces   an   pseudo-language
                   representation   of  an  MH  format  file,  vaguely
                   reminiscent  of  assembly  language.   While   this
                   output  format is not explicitly documented, it can
                   still be useful when debugging MH format files.

          refile   Now takes a `-[no]rmmproc' switch.  This  makes  it
                   easier  to  avoid  loops  when your "rmmproc" calls
                   refile.

          slocal   A  problem  with  the  UUCP-style  mailboxes,   the
                   `RPATHS'  configuration  option,  and  the "Return-
                   Path:" header was fixed.

          sortm    Will ensure that no messages  are  lost  if  it  is
                   interrupted.

          whatnow  Will now tell you where it is  leaving  the  draft,
                   when  interrupted  in the initial edit.  Previously
                   the draft was simply unlinked.

          Compilation Options

          LOCKF    This option causes MH to  use  the  lockf()  system
                   call   for   locking  (if  available),  instead  of
                   flock().


          CHANGES FOR MH 6.7.1

          The MH.6.7.1 patch release is a maintenance release, and as
          such, provides few changes from the previous release.  This
          is the current released version of MH as of December 14,
          1990.

          User-Visible Changes

          The major change in this release is to the POP daemon
          (popd).  In MH 6.7, it was changed to be able to read both
          UUCP and MMDF-style mailboxes.  This did not work as
          reported.  The code has now been changed to parse MMDF-style
          mailboxes if you are configuring MH to run with MMDF as your
          message transport system.  Otherwise, UUCP-style mailboxes
          are expected.

               Since there are number of client programs available for
          only the POP2 protocol instead of POP3, popd has been
          updated to support both protocols.  This is a major win.  If
          you are compiling with POP turned on, add the `POP2' option
          to your MH config file, and the POP daemon will respond to
          POP2 or POP3 commands.  If you're using POP, there's no rea-
          son not to include this option; it does not affect the
          existing support for POP3.

          Internal Changes

          Some bugs were fixed which in general were not user-visible:

          context     Errors when writing out sequences  are  detected
                      correctly.

          inc         No  longer  inserts  extra  blank   lines   into
                      messages.

          mh-format   A nil pointer bug  in  the  address  parser  was
                      fixed.

          repl, etc.  The malloc/free problem has been fixed.

          rmf         A spelling error in the `-nointeractive'  switch
                      has been corrected.

          rcvtty      Will not print the message size if not available
                      (i.e., zero).

          send/post   Illegal signatures  (those  containing  unquoted
                      "."s) will be quoted.


          GENERAL CHANGES FOR MH 6.7.0

          The author is pleased to announce that there are very few
          user-visible changes to MH 6.7 from the previous MH 6.6 dis-
          tribution.  The majority of development was in the form of
          bug fixes and slight enhancements.  In addition, this
          release is slightly faster than the previous release.  With
          a few minor exceptions, it is backward-compatible with the
          previous release.  MH 6.7.0 is the current released version
          of MH as of April 12, 1990.

               The changes were made mainly to generalize the source
          code to be compatible with a larger range of systems and
          compilers.  There were many small changes to add declara-
          tions for ANSI C compliance.  The System 5 support has been
          brought up to SYS5 R3, and there is support for Sun OS 4.0.

          User-Visible Changes

          Here a quick summary of the changes that were made which are
          not backward-compatible with the previous release of MH:

          repl   The `-format' and `-noformat' switches have not been
                 functional since MH 5, and have been removed.  Any
                 users who have these switches in their .mh_profile,
                 will have to remove them.

          sortm  Previously, in most cases sortm would fill-in any
                 gaps in the numbering of a folder, by renumbering the
                 messages starting with `1'.  This will no longer
                 occur; for this behavior, use "folder -pack".


          Using Aliases

          A new profile entry `Aliasfile:' has been added.  The ali,
          send, and whom programs will look for this profile entry and
          treat it as they would an argument to `-alias'.  This should
          make it easier for novice MH users to begin using aliases.


          Reading Network News & BBoards

          The UCI BBoards facility can read local BBoards, and if com-
          piled with the `bboards: pop' and `pop: on' options, can
          also read remote BBoards using the Post Office Protocol (POP
          ver. 3).  With this release, MH can instead be compiled to
          read the Network News (i.e., USENET) using the Network News
          Transfer Protocol (NNTP).

               This capability is enabled by compiling MH with the
          `bboards: nntp' and `pop: on' options.  Unfortunately, read-
          ing remote BBoards via the POP and reading the Network News
          via the NNTP are mutually exclusive options.

               To support the NNTP, a new module, uip/pshsbr.c, is
          compiled and loaded into bbc and msh instead of
          uip/popsbr.c.  The default BBoard is changed from "system"
          to "general" for the NNTP.

               When reading BBoards, bbc will first look for local
          BBoards, and then contact the NNTP server to read the Net-
          work News.  The location of the NNTP server should be speci-
          fied with the `nntphost:'  entry in the mtstailor file (see
          the MH Administrator's Guide for details), or may be speci-
          fied on the command line with the `-host' switch.


          Format Strings

          The manual page mh-format (5) has been rewritten to give a
          better explanation of how to write format strings, and how
          they are interpreted by MH.  A line-by-line description of
          the default repl form file (replcomps) is now included in
          that manual page.

          Some new  format  functions  were  added,  and  others  were
          augmented:

          trim        Strips any leading and trailing white-space from
                      the current string value.

          date2local  Will coerce the date to the local timezone.

          date2gmt    Will coerce the date to GMT.

          divide      Divides  the  current  numeric  value   by   its
                      argument.   This  could  be  useful for building
                      scan format strings which  print  large  message
                      sizes in "Kb" or "Mb".

          friendly    If the address  field  cannot  be  parsed,  this
                      function  will  return  the  text of the address
                      header, instead of a null string.

          szone       A  flag  indicating  whether  the  timezone  was
                      explicit in the date string.

          PROGRAM CHANGES

          In addition to the general changes mentioned above, many
          programs have specific new features added, either by new
          switches or by expanded functionality.  Each command's
          manual page gives complete information about its new
          options.  Here is a short summary.

          User Interface Programs

          anno      Accepts a `-nodate' switch which inhibits the date
                    annotation, leaving only the body annotation.

          folder    When invoked with the `-pack' switch and the new
                    `-verbose' switch, folder will give information
                    about the actions taken to renumber the folder.

                    On most systems, folder can now create any
                    non-existing parent folders of a new sub-folder.

          forw      When making digests, forw will put the issue and
                    volume numbers in addition to the digest list
                    name, in the digest trailer.

          inc       Detects NFS write failures, and will not zero your
                    maildrop in that event.

          msh       Supports a variant of the new sortm.

          prompter  Considers a period on a line by itself to signify
                    end-of-file when the `-doteof' switch is speci-
                    fied.

          repl      The `-[no]format' switches have not been used
                    since MH 5 and have been deleted. repl will now
                    find filter files in the MH library area.

          scan      With the `-file msgbox' switch, scan can list a
                    packf'd-format file directly (without using msh).

                    Lists messages in reverse order with the
                    `-reverse' switch.  This should be considered a
                    bug.

          sortm     Now has the options:  `-textfield field',
                    `-notextfield', `-limit days', and `-nolimit'.

                    With these options, sortm can be instructed to
                    sort a folder based on the contents of an arbi-
                    trary header such as "subject".

                    sortm minimizes renaming messages, and will no
                    longer arbitrarily pack folders; for this
                    behavior, use "folder -pack".

          whatnow   Deletes the draft by renaming it with leading
                    comma, instead of unlinking it.

          MH Support Programs

          The  following  support  programs  also  have   changes   or
          enhancements:

          mhl     Will now accept a format string  on  any  component,
                  not just on addresses and dates.

          popd    Will use shadow passwords if compiled with the SHA-
                  DOW option.  It can now also read UUCP-style mail-
                  drops directly.

          rcvtty  If given no arguments, rcvtty will produce a scan
                  listing as specified by a format string or file; a
                  default format string is used if one is not speci-
                  fied.

                  Before the listing is written to the users terminal,
                  the terminal's bell is rung and a newline is output.
                  The `-nobell' and the `-nonewline' options inhibit
                  these functions.

                  rcvtty will obey terminal write notification set by
                  mesg.  With the `-biff' switch, rcvtty will also
                  obey the mail notification status set by biff.

                  On BSD43 systems, as with write, rcvtty will be
                  installed set-group-id to the group "tty".

          slocal  Understands UUCP-style "From " lines and will write
                  output files using this format if appropriate.
                  Before invoking a delivery program, slocal will
                  strip such lines unless compiled with the RPATHS
                  option, in which case it will will convert such
                  lines into "Return-Path:" headers.

                  slocal has a new result code "N", for use in .mail-
                  delivery files.  With this result code, slocal will
                  perform the action only if the message has not been
                  delivered and the previous action succeeded.  This
                  allows for performing an action only if multiple
                  conditions are true.

          DOCUMENTATION

          Several of the older MH papers have been difficult to format
          because they depended on an older version of PhDTeX which
          was not supplied.  These papers have been updated, and some
          TeX library files are supplied in papers/doclib/, so that
          these papers may be generated on any system with TeX.

               Many of the manual pages have been revised to include
          documentation of new command options, and some have been
          expanded to give more detail.  All are now slightly refor-
          matted at installation time to make them more compatible
          with programs like makewhatis.


          MH ADMINISTRATION

          This section describes changes in configuring, compiling and
          installing MH 6.7 and should not be of interest to casual MH
          users.  The READ-ME file has been considerably revised and
          expanded to give more detail about the configuration and
          compilation options which have been included in this
          release.  Some compilation options have been removed, and
          many new options have been added.

               All MH Makefiles have been updated to work around some
          incompatibilities introduced in newer versions of make.  MH
          programs will no longer be installed with the sticky-bit
          turned on.

               Reading this section not a substitute for carefully
          reading the READ-ME file before attempting to compile MH


          Bug Fixes

          Some bugs were fixed which in general were not user-visible:

          address parser  Fixed to allow use of the "AT"  domain,  and
                          some  minor  bugs  were  fixed pertaining to
                          address groups.

          date parser     Improved to accept  more  forms  of  illegal
                          dates.  Military timezones were removed.

          dynamic memory  Many problems with corruption of the dynamic
                          memory pool have been fixed.

          locking         Will open files for write, if  necessary  to
                          enable locking.

          nil pointers    All reported nil pointer problems have  been
                          fixed.

          replcomps       The "In-Reply-To:" header had  quotes  added
                          around the date field to comply with RFC822.

          White Pages

          If MH is compiled with the WP option, send recognizes an
          address between "<<" and ">>" characters such as:

                  To: << rose -org psi >>

          to be a name meaningful to a whitepages service.  In order
          to expand the name, send must be invoked interactively
          (i.e., not from push).  For each name, send will invoke a
          command called fred in a special mode asking to expand the
          name.

               To get a copy of the white pages service, contact
          wpp-manager@psi.com.

          Configuration Options

          Some configuration options have been added or changed:

          cc          To specify an alternate C compiler.

          ccoptions   Defaults to `-O'.

          bboards     May now be defined as "on", "off", "pop", or
                      "nntp".

          bbdelivery  Determines whether the bboard delivery agent and
                      library files should be installed.

          lex         To specify an alternate version of lex.

          mailgroup   If defined, inc will be made set-group-id to
                      this group.

          sharedlib   For SUN40 systems; if "on", makes libmh.a into a
                      shared library.

          slibdir     The directory where the above shared library
                      should be installed.

          sprintf     Set this to "int" if that's what your
                      sprintf (3) library routine returns.

          Compilation Options

          For different configurations, several `-D' options to cc
          have been added or changed:

          BERK        This disables the address and date parsing rou-
                      tines.  If you want to do much with
                      mh-format (5), don't enable this.

          BSD43       Will make rcvtty set-group-id to the group
                      "tty".

          DBM         For sites with a dbm-style password file (such
                      as with Yellow Pages), MH will not read the
                      entire passwd file into a cache.  At one site
                      that runs YP on a large passwd file, using this
                      showed a 6:1 performance improvement.

          NETWORK     This option has been deleted.  See SOCKETS.

          NOIOCTLH    Tells MH not to include the file sys/ioctl.h.
                      Use this if this file is not present on your
                      system.

          NTOHLSWAP   On systems with TCP/IP networking, msh will try
                      to use the ntohl() macro from the file
                      netinet/in.h to byte-swap the binary map files
                      it writes.

          SENDMAILBUG Some versions of sendmail return a 451 (failure)
                      reply code when they don't mean to indicate
                      failure.  This option considers that code to be
                      equivalent to 250 (OK).

          SHADOW      Causes popd to read the file /etc/shadow for
                      encrypted passwords instead of /etc/passwd.  Use
                      this if you have a shadow password file (such as
                      on newer versions of SYSTEM 5).

          SOCKETS     Enable this if you are on a non-BSD system with
                      a socket interface for TCP/IP networking compa-
                      tible with 4.2BSD UNIX.

          SUN40       Use on Suns running Sun OS 4.0 and later.

          SYS5        This option has been updated to refer to SYS5 R3
                      and later systems.

          SYS5DIR     Use this if your system uses "struct dirent"
                      instead of "struct direct".  This should be true
                      for systems based on SYS5 R3 and later.

          TYPESIG     Defines the base type for the signal system
                      call.  This defaults to "int", but should be
                      defined as "void" if appropriate for your sys-
                      tem.

          WP          Enables support for the White Pages service.

          Installation

          MH will now explicitly set the protection mode on every file
          it installs.

               Previously any existing file installed by MH would be
          backed up into the source tree, and then overwritten.  Now,
          a few system-dependent files will not be overwritten, and
          your changes will have to be merged in by hand.  See the
          READ-ME file for more details.

nmh-1.5/docs/COMPLETION-BASH000644 007761 000765 00000014124 11762736344 015150 0ustar00kenhkenh000000 000000 # nmh completion for bash # Copyright 2003 "Wade Richards" # Permission granted to redistribute under the BSD license [ "$BASH_COMPLETION" ] || echo "ERROR: COMPLETION-BASH is not intended to be \ sourced directly, but rather added to a bash-completion package installation." have show && _nmh() { # args: command comp-word prev-word local command current prev folder origfolder i orig_opts COMPREPLY=() current=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} command=$1 orig_opts=$(shopt -p extglob) shopt -s extglob # Get the folder, if specified for (( i=0; i < ${#COMP_WORDS}-1; i++ )) do case "${COMP_WORDS[i]}" in \++([a-zA-Z_]) ) folder=${COMP_WORDS[i]} origfolder=$( folder -f ) ;; esac done case $current in -* ) # Command-line switches for the most common commands. case $command in ali ) # no sequences or messages options=(-alias -list -nolist -normalize -nonormalize -user -nouser -version -help) ;; burst ) options=(-inplace -noinplace -quiet -noquiet -verbose -noverbose -version -help) ;; comp ) options=(-form -use -nouse -file -draftfolder -draftmessage -nodraftfolder -editor -noedit -whatnowproc -nowhatnowproc -version -help ) ;; flist* ) options=(-sequence -all -noall -showzero -noshowzero -recurse -norecurse -fast -nofast -alpha -noalpha -version -help) ;; folder* ) options=(-all -noall -create -nocreate -fast -nofast -header -noheader -recurse -norecurse -total -nototal -list -nolist -push -pop -pack -nopack -print -verbose -noverbose -version -help) ;; forw ) options=(-annotate -noannotate -form -format -noformat -filter -inplace -noinplace -mime -nomime -draftfolder -draftmessage -nodraftfolder -editor -noedit -whatnowproc -nowhatnowproc -dashstuffing -nodashstuffing -build -file -version -help) ;; inc ) options=(-audit -noaudit -changecur -nochangecur -form -format -file -silent -nosilent -truncate -notruncate -width -host -user -pack -nopack -apop -noapop -kpop -sasl -saslmech -snoop -version -help) ;; mark ) options=(-sequence -add -delete -list -public -nopublic -zero -nozero -version -help) ;; next ) options=(-showmimeproc -header -noheader -checkmime -nocheckmime -version -help) ;; packf ) options=(-file -mbox -mmdf -version -help) ;; pick ) options=(-and -or -not -lbrace -rbrace --component -cc -date -from -search -subject -to -after -before -datefield -sequence -public -nopublic -zero -nozero -list -nolist -version -help) ;; prev ) options=(-showproc -showmimeproc -header -noheader -checkmime -nocheckmime -version -help) ;; refile ) options=(-draft -link -nolink -preserve -nopreserve -unlink -nounlink -src -file -rmmproc -normmproc -version -help) ;; repl ) options=(-annotate -noannotate -group -nogroup -cc -nocc -query -noquery -form -format -noformat -filter -inplace -noinplace -mime -nomime -fcc -width -draftfolder -draftmessage -nodraftfolder -editor -noedit -whatnowproc -nowhatnowproc -build -file -version -help) ;; rmf ) options=(-interactive -nointeractive -version -help) ;; rmm ) options=(-link -nolink -version -help) ;; scan ) options=(-clear -noclear -form -format -header -noheader -width -reverse -noreverse -file -version -help ) ;; show ) options=(-draft -showproc -showmimeproc -header -noheader -checkmime -nocheckmime -version -help) ;; sortm ) options=(-datefield -textfield -notextfield -limit -nolimit -verbose -noverbose -version -help) ;; whom ) options=(-alias -check -nocheck -draft -draftfolder -draftmessage -nodraftfolder -version -help) ;; * ) options=(-help -version -seq) ;; esac ;; +* ) # Folders options=( $( folder -all -r -fast | grep -v "^\." | sed "s/^/+/" ) ) ;; +([0-9a-z])-* ) # Partial range start=${current/%-*/} options=( $( scan $folder -format "%(msg)" "${start}-last" ) first prev cur next last ) options=( ${options[@]//#/${start}-} ) ;; +([0-9]) ) # Message number, or start of range options=( $( scan $folder -format "%(msg)" ) first prev cur next last ) options=( ${options[@]} ${options[@]//%/-} ) ;; [fpcnlu]* ) # special message aliases options=( first prev cur next last unseen ) ;; # What about sequences? I can't quite see how to get the list of possible sequences, so I # guess the user will have to type them in the old-fashioned way. esac eval $orig_opts COMPREPLY=( $( compgen -W "${options[*]}" -- $current ) ) return 0 } [ "$have" ] && complete -F _nmh ali anno burst comp dist flist flists folder folders forw inc mark mhbuild mhl mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk msh next packf pick prev prompter rcvdist rcvpack rcvstore rcvtty refile repl rmf rmm scan send sendfiles show slocal sortm whatnow whom nmh-1.5/docs/COMPLETION-TCSH000644 007761 000765 00000003253 11476006206 015162 0ustar00kenhkenh000000 000000 # This file, to be sourced by tcsh, contains useful command completions for nmh. # [There's lots more that can be done -- folder name completion is just the most # useful ...] # Note that if you use nested folders, the below completions will not find # them. If you are in this boat, you might want to use something like: # # set nmh_mail_dirs = `folder -all -fast -recurse` # # complete anno c%+%"($nmh_mail_dirs)"% # [...] # # The problem with that is that new folders you create won't be available for # completion until you re-source this file. # # Note also that if you use '%'s in your folder names, you'll need to use a # different separator character below. set nmh_mail_dir = $HOME/`mhparam Path` complete anno c%+%D:$nmh_mail_dir% complete burst c%+%D:$nmh_mail_dir% complete comp c%+%D:$nmh_mail_dir% complete dist c%+%D:$nmh_mail_dir% complete flist c%+%D:$nmh_mail_dir% complete folder c%+%D:$nmh_mail_dir% complete forw c%+%D:$nmh_mail_dir% complete inc c%+%D:$nmh_mail_dir% complete mark c%+%D:$nmh_mail_dir% complete mhl c%+%D:$nmh_mail_dir% complete mhn c%+%D:$nmh_mail_dir% complete mhpath c%+%D:$nmh_mail_dir% complete next c%+%D:$nmh_mail_dir% complete packf c%+%D:$nmh_mail_dir% complete pick c%+%D:$nmh_mail_dir% complete prev c%+%D:$nmh_mail_dir% complete rcvstore c%+%D:$nmh_mail_dir% complete refile c%+%D:$nmh_mail_dir% complete repl c%+%D:$nmh_mail_dir% complete rmf c%+%D:$nmh_mail_dir% complete rmm c%+%D:$nmh_mail_dir% complete scan c%+%D:$nmh_mail_dir% complete send c%+%D:$nmh_mail_dir% complete show c%+%D:$nmh_mail_dir% complete sortm c%+%D:$nmh_mail_dir% complete whatnow c%+%D:$nmh_mail_dir% complete whom c%+%D:$nmh_mail_dir% nmh-1.5/docs/COMPLETION-ZSH000644 007761 000765 00000014660 11476006206 015071 0ustar00kenhkenh000000 000000 # # The following several shell functions and `compctl' commands # that will configure the programmable command completion of # the Z Shell (zsh) for the nmh mail system. # # You may need to edit where it says EDIT ME. # These were orginally written for MH by Peter Stephenson # The following three functions are best autoloaded. # # mhcomp completes folders (including subfolders). # mhfseq completes sequence names and message numbers. # mhfile completes files in standard nmh locations. # # Completion function for nmh folders. Works with # both + (relative to top) and @ (relative to current). # function mhcomp { local nword args pref char mhpath read -nc nword read -cA args pref=$args[$nword] char=$pref[1] pref=$pref[2,-1] # The $(...) here accounts for most of the time spent in this function. if [[ $char = + ]]; then # mhpath=$(mhpath +) # EDIT ME: use a hard wired value here: it's faster. mhpath=~/Mail elif [[ $char = @ ]]; then mhpath=$(mhpath) fi eval "reply=($mhpath/$pref*(N-/))" # I'm frankly amazed that this next step works, but it does. reply=(${reply#$mhpath/}) } # # Extract nmh message names and numbers for completion. Use of the # correct folder, if it is not the current one, requires that it # should be the previous command line argument. If the previous # argument is `-draftmessage', a hard wired draft folder name is used. # mhfseq() { local folder foldpath words pos nums read -cA words read -cn pos # Look for a folder name. # First try the previous word. if [[ $words[$pos-1] = [@+]* ]]; then folder=$words[$pos-1] # Next look and see if we're looking for a draftmessage elif [[ $words[$pos-1] = -draftmessage ]]; then # EDIT ME: shortcut -- hard-wire draftfolder here # Should really look for a +draftfolder argument. folder=+drafts fi # Else use the current folder ($folder empty) if [[ $folder = +* ]]; then # EDIT ME: use hard-wired path with + for speed. foldpath=~/Mail/$folder[2,-1] else foldpath=$(mhpath $folder) fi # Extract all existing message numbers from the folder. nums=($foldpath/<->(N:t)) # If that worked, look for marked sequences. # EDIT ME # if you never use non-standard sequences, comment out # or delete the next three lines. if (( $#nums )); then nums=($nums $(mark $folder | awk -F: '{print $1}')) fi # EDIT ME: `unseen' is the value of Unseen-Sequence, if it exists; set -A reply next cur prev first last all unseen $nums } # # Find an nmh file; for use with -form arguments and the like. # Use with compctl -K mhfile. # mhfile () { local mhfpath file # EDIT ME # Array containing all the places nmh will look for templates etc. mhfpath=(~/Mail /usr/local/nmh/lib) # Emulate completeinword behaviour as appropriate local wordstr if [[ -o completeinword ]]; then wordstr='$1*$2' else wordstr='$1$2*' fi if [[ $1$2 = */* ]]; then # path given: don't search nmh locations eval "reply=($wordstr(.N))" else # no path: only search nmh locations. eval "reply=(\$mhfpath/$wordstr(.N:t))" fi } # Note: you must type the initial + or @ of a folder name to get # completion, even in places where only folder names are allowed. # Abbreviations for options are not recognised. Hit tab to complete # the option name first. compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ 's[-]' -k "(all noall fast nofast header noheader help list nolist \ pack nopack pop push recurse norecurse total nototal)" -- folder folders compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ 's[-]' -k "(sequence all noall recurse norecurse showzero noshowzero \ alpha noalpha fast nofast help)" -- flist flists compctl -K mhfseq -x 's[+][@],c[-1,-draftfolder] s[+][@]' \ -K mhcomp -S / -q - 'c[-1,-draftmessage]' -K mhfseq - \ 'C[-1,-(editor|whatnowproc)]' -c - \ 's[-]' -k "(draftfolder draftmessage nodraftfolder editor noedit \ file form use nouse whatnowproc nowhatnowproc help)" - \ 'c[-1,-form]' -K mhfile -- comp compctl -K mhfseq -x 's[+][@]' \ -K mhcomp -S / -q - 'c[-1,-draftmessage]' -K mhfseq -\ 's[-]' -k "(annotate noannotate cc nocc draftfolder nodraftfolder \ draftmessage editor noedit fcc filter form group nogroup inplace noinplace query noquery width whatnowproc nowhatnowproc help)" - 'c[-1,(cc|nocc)]' \ -k "(all to cc me)" - 'C[-1,-(filter|form)]' -K mhfile - \ 'C[-1,-(editor|whatnowproc)]' -c -- repl compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ 's[-]' -k "(audit noaudit changecur nochangecur form format \ file silent nosilent truncate notruncate width help)" - \ 'C[-1,-(audit|form)]' -K mhfile - 'c[-1,-file]' -f + -- inc compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ 's[-]' -k "(sequence add delete list public nopublic zero nozero help)" -- \ mark compctl -K mhfseq -x 's[+][@]' \ -K mhcomp -S / -q - 'c[-1,-file]' -f - 'c[-1,-rmmprov]' -c - \ 's[-]' -k "(draft link nolink preserve nopreserve src file \ rmmproc normmproc help)" -- refile compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ 's[-]' -k "(clear noclear form format header noheader reverse noreverse \ file help width)" - 'c[-1,-file]' -f - 'c[-1,-form]' -K mhfile -- scan compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ 's[-]' -k "(draft form moreproc nomoreproc header noheader \ showproc noshowproc length width help)" - 'C[-1,-(show|more)proc]' -c - \ 'c[-1,-file]' -f - 'c[-1,-form]' -K mhfile - \ 'c[-1,-length]' -s '$LINES' - 'c[-1,-width]' -s '$COLUMNS' -- show next prev compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' \ -k "(help)" -- rmm compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ 's[-]' -k "(after before cc date datefield from help list nolist \ public nopublic search sequence subject to zero nozero not or and \ lbrace rbrace)" -- pick compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' \ -k "(alias check draft draftfolder draftmessage help nocheck \ nodraftfolder)" -- whom compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' \ -k "(file part type list headers noheaders realsize norealsize nolist \ show serialonly noserialonly form pause nopause noshow store auto noauto \ nostore cache nocache rcache wcache check nocheck ebcdicsafe noebcdicsafe \ rfc934mode norfc934mode verbose noverbose help)" - \ 'c[-1,-file]' -f - 'c[-1,-form]' -K mhfile - \ 'C[-1,-[rw]cache]' -k '(public private never ask)' -- mhn compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' -k '(help)' -- mhpath nmh-1.5/docs/contrib/000777 007761 000765 00000000000 11765271326 014500 5ustar00kenhkenh000000 000000 nmh-1.5/docs/DIFFERENCES000644 007761 000765 00000025060 11476006206 014467 0ustar00kenhkenh000000 000000 [NOTE: This file is out-of-date. Updating it every time new features are added to nmh forevermore is a pain. Perhaps we should limit it to documentation of _incompatibilities_ with MH (which should be rare).] The following are the differences between nmh and MH-6.8.3. UCI has since released MH-6.8.4. Most of the new features it adds have also been added to nmh, but those differences are not listed here. There are a few new features in MH-6.8.4 that are missing from nmh, but they are primarily undocumented in MH-6.8.4 (and no one has ever asked me for them). GENERAL ------- *) nmh has been converted to autoconf (configure) and should be more portable and easier to install than MH. In particular, nmh will now compile on Linux. *) All of MH's Makefiles have been rewritten for nmh. You can now use GNU make without any problems. Also, if your make supports the VPATH variable (such as GNU make), you can now compile in a different directory from the one containing the source code. *) The source code for nmh has been substantially cleaned up. It now requires an ANSI C compiler (gcc is fine) to compile. *) A new option `-version' has been added to all the commands. *) The POP server (popd) has been removed from the distribution. RPOP on the client side is not currently supported. *) The support for MH-style bulletin boards has been removed (NNTP makes this obsolete anyway). *) Currently nmh doesn't support using shared libraries for libmh. This may return in the future, but is not a high priority, since the nmh commands are not that large, and disk space gets cheaper every day. *) Almost all of the commands in nmh have been modified to accept an arbitrary number of command line arguments (most MH commands will not accept more than 1000 arguments on the command line). *) nmh should be more secure than MH. Hundreds of buffer overflow problems have been fixed in the source code. Of course, I still don't make any guarantees. DOCUMENTATION ------------- *) Many of the man pages have been cleaned up or clarified. *) The mhook man page has been split into separate man pages for rcvtty, rcvdist, and rcvpack. *) Added new man page `mh-draft' which discusses the nmh draft folder facility. *) The various `procs' (rmmproc, moreproc, showmimeproc, etc...) are now documented in the "mh-profile" man page. Many of these were previously undocumented. FORMATTING ---------- *) Added a new formatting string escape %(decode) to decode and display RFC-2047 encoded header fields. SEQUENCES --------- *) The is no longer a limitation on the length of lines in the file containing your public sequences (.mh_sequences). That should be the end of the error message ".mh_sequences is poorly formatted". ANNO ---- *) The switch -inplace is now on by default. CONFLICT -------- *) Conflict now works on systems that define more than 100 groups. DIST ---- *) The switch -inplace is now on by default. FLIST ----- *) A new command `flist' has been added to nmh, that will list the folders that contain messages in a given sequence (such as the unseen sequence). This was a much needed command in the MH suite of programs. FOLDER ------ *) `folder -all' now dynamically allocates space for folder names and can handle more than 300 folders. *) `folder' now uses the standard Unix trick of looking at the number of links to a directory entry, in order to avoid doing a stat(2) call on messages in folders with no subfolders. This greatly increases the speed of `folder -all -recurse' on large mail setups. *) The switches `-header' and `-total' are more orthogonal. The command `folder -all -noheader -nototal' now does the right thing. FORW ---- *) The switch -inplace is now on by default. *) Added switches `-dashstuffing' and `-nodashstuffing', to determine whether forwarded messages are RFC934 quotes (dashstuffed). (This corresponds to the undocumented switch "nodashmunging" in MH). INC --- *) If compiled with RPATHS, a Delivery-Date header is now added to all messages incorporated with `inc'. *) Using the new format string escape %(decode), the scan lines for `inc' will correctly decode RFC-2047 encoded headers. MARK ---- *) If neither of the switches -public/-nopublic are specified, then existing sequences will retain their current public/private status, instead of being changed to public. *) The command "mark -list -sequence foo" will now indicate if the sequence "foo" is a private sequence. MHBUILD ------- *) The functionality in `mhn' to create MIME messages, has been cleaned up substantially, and moved to separate command `mhbuild'. *) If given a file argument of "-", mhbuild will now accept the MIME composition file on the standard input, and output the new MIME message to the standard output. This makes it much easier to use this functionality in shell scripts. *) The switch -norfc934mode is now the default. MHL --- *) There is a new variable "decode" which instructs `mhl' to decode a component as a RFC-2047 encoded header field. MHLIST ------ *) The functionality of `mhn -list' has been moved to the new command `mhlist'. MHN --- *) mhn is now obsolete. It has been split into the commands mhbuild, mhlist, mhshow, mhstore, and viamail. mhn still exists for backward compatibility, but the new commands should be preferred. *) Changed the profile entry automhnproc to automimeproc (which has slightly different semantics). MHPATH ------ *) `mhpath all' will no longer abort if the folder has more than 998 messages. MHSHOW ------ *) The functionality of `mhn -show' has been moved to the new command `mhshow'. *) mhshow now correctly treats unknown subtypes of text as text/plain, as specified by RFC-2046. *) mhshow now correctly treats unknown subtypes of multipart as multipart/mixed, as specified by RFC-2046. *) You can now override the default method by which mhshow handles subtypes of multipart that are known internally (mixed, alternate, etc...). Previously the behavior on these types could not be changed. MHSTORE ------- *) The functionality of `mhn -store' has been moved to the new command `mhstore'. *) mhstore will now correctly identify a formatting string of "-" and send the content to stdout. PACKF ----- *) When packing a folder, the default format is now `mbox' format, rather than `mmdf' format. The options -mbox and -mmdf have been added to `packf' so you can choose the desired format. PACKMBOX -------- *) The script packmbox has been removed from the nmh distribution, since its functionality has been added to the command packf. PICK ---- *) If neither of the switches -public/-nopublic are specified, then existing sequences will retain their current public/private status, instead of being changed to public. RCVPACK ------- *) The default format for `rcvpack' is now `mbox' format, rather than `mmdf' format. The options -mbox and -mmdf have been added to `rcvpack' so you can choose the desired format. *) Rcvpack no longer adds the field "Delivery-Date", as that is added by `slocal'. RCVSTORE -------- *) Added new switches -unseen/-nounseen to control whether new messages are added to the Unseen-Sequence. RCVTTY ------ *) The option `-width' has been added. REFILE ------ *) If an conflict occurs when using the `-preserve' switch, then refile will search for and use the next available message number above the one you wish to preserve, rather than aborting with an error. *) Added new options `-unlink' and `-nounlink' which specify that that messages "removed" from the source folder should just be unlinked, rather than moved to name with prefix. REPL ---- *) Added new options `-format' and `-noformat'. The switch `-format' will filter the message to which you are replying with a standard message filter "mhl.reply" which is included in the distribution. The switch `-noformat' will negate `-format' and `-filter', so that the message to which you are replying is not included in the draft. *) Added new options `-group' and `-nogroup'. These switches direct repl as to whether or not this is a group reply. A group reply uses a different forms (components) file (default is replgroupcomps). *) The standard forms files "replcomps" and "replgroupcomps" now have support for the "Mail-Reply-To:" and "Mail-Followup-To:" header fields. *) The switch -inplace is now on by default. RMM --- *) Added new options `-unlink' and `-nounlink' which specify that that "removed" messages should just be unlinked, rather than moved to name with prefix. SCAN ---- *) Using the new format string escape %(decode), the scan lines created by `scan' will correctly decode RFC-2047 encoded headers. SHOW/NEXT/PREV -------------- *) Added new options `-checkmime' and `-nocheckmime' which allow you to enable and disable the test for MIME messages. *) The "mhnproc" profile entry has been changed to "showmimeproc". *) Added `-showmimeproc' switch to specify the showmimeproc at the command line. *) The default "showproc" has been changed to `mhl'. *) The default "showmimeproc" is now `mhshow'. *) `show' is better at handling alternate character sets. It knows that US-ASCII is a subset of any ISO-8859-X character set. SLOCAL ------ *) Added new action `folder' or `+' to slocal, which adds new message to a nmh folder. Currently, this is handled by piping the new message to rcvstore, although this may change in the future. *) The action `mbox' now delivers to a file in mbox format. Previously it delivered to a file in mmdf format. *) Added new action `mmdf' to deliver to a file in mmdf format. *) Added new options -[no]suppressdup to slocal to check for duplicate messages. The code for suppression of duplicate messages (MH config was MSGID) is now always built into slocal. *) Improved the debugging of slocal ".maildelivery" files. It will now warn when an entry in this file is skipped because there are not enough fields. Also the debugging output of slocal has been cleaned up, so that it is much easier to read. *) Slocal now adds the Delivery-Date header to all delivered messages. Previously it only added them to messages delivered to a file. VIAMAIL ------- *) The functionality of this new command, was formerly part of `mhn' as the (undocumented) option `mhn -viamail'. WHATNOW ------- *) Added new action "mime" to whatnow, which causes whatnow to call program specified by "buildmimeproc" profile entry, to process MIME composition files (default is mhbuild). *) Added new action "delete" to whatnow, which deletes draft file and exits. nmh-1.5/docs/FAQ000644 007761 000765 00000511562 11476006206 013370 0ustar00kenhkenh000000 000000 Newsgroups: comp.mail.mh,comp.answers,news.answers Subject: MH Frequently Asked Questions (FAQ) with Answers Keywords: FAQ,mh,mail,question,answer,pop,slocal,letter,signature, draft,message,folder,xmh,olmh,vmail,vmailtool,comp,repl, forw,scan,SMTP,bind,MH-E,MIME,plum,exmh,nmh Summary: This document answers Frequently Asked Questions about MH, a sophisticated mail interface. It should be read by new MH users and comp.mail.mh readers and before posting to this group. Followup-To: poster Approved: news-answers-request@MIT.Edu Reply-To: Bill Wohler From: Bill Wohler Organization: Newt Software, Menlo Park, California, USA Archive-name: mail/mh-faq/part1 Last-modified: $Date$ Version: $Revision$ Posting-Frequency: monthly This is a living list of frequently asked questions on the mailer user interface, Mail Handler, or MH. The point of this is to circulate existing information, and avoid rehashing old answers. Better to build on top than start again. Please read this document before ever posting to this newsgroup. This article is posted monthly. If it has already expired and you're not reading this, you can hope that you saved the instructions to retrieve the FAQ (see "Where can I get MH") so that you can get a copy through other means. Please do not post an answer when someone posts a frequently asked question; rather, email the relevant section of the FAQ to eliminate unnecessary traffic in this newsgroup. This list depends on your comments, additions and fixes: please send them to Bill Wohler . Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2006, 2007 Bill Wohler Permission to use, copy, distribute, and translate this document for any non-commercial purpose is hereby granted, provided that this copyright notice appears in all copies. Commercial distributions require prior written consent. This article is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ---------------------------------------------------------------------- Subject: Table of Contents From: Bill Wohler Date: Sat, 3 Mar 2001 11:29:16 -0800 Legend: + new, - deleted, ! changed __________________ 01.00 Introduction 01.01 Why should I use MH? !01.02 What is the current version/status of MH? !01.03 Where can I get MH? !01.04 What references exist for MH? 01.05 What other MH software is available? !01.06 How can I print a MH manual? 01.07 How should I report bugs? 01.08 How can I convert from my mailer to MH? 01.09 What is the copyright status of nmh? _________________ 02.00 Building MH 02.01 What machines does MH run on? 02.02 How do I build MH? 02.03 What options should I use? 02.04 What do I need to do to use POP? 02.05 Does MH support IMAP? 02.06 Why does "mailgroup mail" only affect inc and not slocal? 02.07 How can I build MH on Solaris 2? 02.08 How can I build MH on Linux? 02.09 How can I build MH on IRIX? 02.10 How can I get MH to interpret the Content-Length field? 02.11 How do I build MH on HP-UX? 02.12 Can I prevent adding the local hostname to addresses behind firewalls? 02.13 Is there a patch to fix this or that? 02.14 How can I build MH on OS/2? 02.15 Do any POP/IMAP servers handle MH format? 02.16 How can I build MH on Windows? !02.17 How can I build MH on a Mac? ________________________ 03.00 Scanning & Reading 03.01 What do I do if scan shows the wrong date? 03.02 How would one go about reading Usenet with MH? 03.03 How can I search through multiple folders? 03.04 Why don't MH format commands such as %(friendly) work? 03.05 Why doesn't "show" display all of a MIME message? 03.06 Can I get show not to run "less" so much on MIME messages? 03.07 Why do I get "mhn: don't know how to display content"? 03.08 How can I automatically delete MH backup files? 03.09 Fixing "cannot fopen and lock /var/spool/mail/(user)" 03.10 Can I read my mail with a Web browser? 03.11 How can I run inc automatically with POP? 03.12 Why does inc hang (on Sun)? 03.13 How can I get POP to work? 03.14 How do I persuade mhshow (mhn) not to bring up a new window? 03.15 How do I turn off of all the mhshow (mhn) prompts? 03.16 Why is inc splitting messages improperly? 03.17 Can MH thread messages? 03.18 How can I avoid reading the HTML version of the message? 03.19 How do I view or save attachments? 03.20 How do I view HTML attachments with Netscape? 03.21 Fixing folders: unable to allocate storage for msgstats 03.22 How do I recursively list message attachments? 03.23 Why do folder and flist overlook some of my sub-folders? ____________ 04.00 Filing 04.01 Can I append MH messages to a Unix mailbox format file? 04.02 Can I append MH messages to a GNU Emacs rmail BABYL-format file? 04.03 Why do I get ".../.mh_sequences is poorly formatted?" 04.04 How can you save News articles into an MH folder? !04.05 Are there any good tools to archive MH messages? 04.06 How can I remove duplicate messages? 04.07 How can I remove holes in numbering? __________________________ 05.00 Composing & Replying 05.01 Why does repl add a "Re:" to a message that already has one? 05.02 How do I include messages in repl with or without ">"? 05.03 How can I eliminate duplicate copies of letters to myself? 05.04 How can I include my signature? 05.05 How do I call my editor with arguments? 05.06 How can I digestify messages in a folder for mail to another user? 05.07 How can I change my return address? 05.08 How can I change my From header? 05.09 How can I save a copy of all messages I send? 05.10 Can the folder in Fcc: be dynamically specified? 05.11 Can I post secure/encryped mail? 05.12 How can I send multi-media (MIME) attachments? 05.13 What's the best way to send mail to a long list of people? 05.14 What is the Dcc header? 05.15 How can I make sense of the replcomps file? 05.16 How can I convert quoted-printable to 8bit in quoted text in replies? 05.17 Can I have aliases include aliases? 05.18 Why doesn't mhmail understand aliases? 05.19 How do I send blind carbon copies? 05.20 When I forward a message, can I use its Subject? 05.21 Why is the timezone field in my 'Date:' field wrong? 05.22 Can I automate the comp -editor mhn process? 05.23 How can I remove those "=20" characters when forwarding? 05.24 Can I use mh-format substitution with forw? 05.25 How can I keep repl from breaking long lines? 05.26 How do I fix a bogus In-Reply-To or missing References field? _____________ 06.00 Posting 06.01 What to do with "Problems with edit - draft removed". 06.02 Can I run my message through a program (e.g., ispell) before sending? 06.03 What to do with "bad address 'xxx' - no at-sign after local-part". 06.04 Fixing "post: problem initializing server; [BHST] no servers available" 06.05 Fixing "post: problem initializing server; [RPLY] 503 Sender already specified" 06.06 Fixing "post: unexpected response; [BHST] no socket opened" 06.07 How do I fix the "X-Authentication-Warning" header? 06.08 Fixing "post: unexpected response; [RPLY] 503 Need MAIL before RCPT" 06.09 Fixing "post: problem initializing server; [BHST] premature end-of-file on socket" 06.10 Fixing "Sender didn't use the HELO protocol" 06.11 Fixing "post: problem initializing server; [RPLY] 553 Local configuration error, hostname not recognized as local" __________________ 07.00 Mail Filters 07.01 What mail filters are available? 07.02 Why slocal writes messages to system mailbox that from(1) can't read. 07.03 Where can I read about slocal and the format of .maildelivery? 07.04 How do I debug my .maildelivery file? 07.05 Why isn't slocal working? 07.06 Are there any good biff applications for MH? 07.07 How do I read new messages filed by procmail? __________ 08.00 MH-E 08.01 I have a question about MH-E _________ 09.00 Xmh 09.01 How can I get xmh to use Emacs as the editor? 09.02 Does xmh support subfolders? 09.03 How do I precede included messages with ">" when replying in xmh? ________ Appendix Glossary & Acknowledgments Switching xmh's editor babyl2mh.pl inco - babyl to MH converter t2h - add hyperlinks to message viewed srvrsmtp.c patch IRIX config file HP-UX 10.20 config file Removing duplicate messages (Bourne) Removing duplicate messages (Perl) Removing duplicate messages (Perl) ------------------------------ Subject: Viewing This Article From: Bill Wohler Date: Mon, 27 Nov 1995 14:44:19 -0800 To skip to a particular question with Subject or number xx, use "/^S.*xx" with most pagers. In GNU Emacs type "M-C-s ^S.*xx", (or C-r to search backwards), followed by ESC to end the search. To skip to new or changed questions, use "/^S.*[!+]" with most pagers and "M-C-s ^S.*[!+]" in GNU Emacs. This article is in digest format. nn may have already broken this message into separate articles; if not, then type "G %". In rn, use ^G to skip sections. This article is treated as an outline when edited by GNU Emacs. Run "M-x describe-mode" to see available outline-mode commands. Useful commands are "M-x hide-body", "C-c C-s" (show-subtree) and "M-x show-all" Check out the Usenet Hypertext FAQ Archive (see "What references exist for nn?"). Files available by ftp, man pages, and other Web pages, as well as cross-references like the one in this paragraph are just a click away. A "Date" field whose time is 00:00:00 is approximate. The month and year in these fields represent the time they were added to the FAQ, rather than when they were contributed by the author, as is the case since November, 1995. If you should need the Internet address, use nslookup or dig if you have them, or send mail to with "help" for a Subject. References to $MHLIB refer to the directory that contains MH support files and routines. This directory is usually /usr/lib/mh or /usr/local/lib/mh (or /usr/local/nmh/lib or /etc/nmh for nmh). Do not use $MHLIB literally; use the real, absolute path to your MH library directory. There are slight differences between the original MH and nmh. In the text, the nmh command or filename is preferred, and the MH equivalent is placed in parenthesis. For example, the MH configuration is in $MHLIB/mts.conf (mtstailor); mhshow (mhn -show) is used to view attachments. Note that due to bottom feeding email address harvesting spam scum, mailto links have been removed and @s in addresses have been replaced by "at." ------------------------------ Subject: 01.00 ***** Introduction ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 01.01 Why should I use MH? From: Jerry Peek Date: Fri, 1 Mar 1991 13:03:15 -0800 The MH message handling system is a set of electronic mail programs in the public domain. If your computer runs Unix, it can probably run MH. The big difference between MH and most other "mail user agents" is that you can use MH from a Unix shell prompt. In MH, each command is a separate program, and the shell is used as an interpreter. So, all the power of Unix shells (pipes, redirection, history, aliases, and so on) works with MH--you don't have to learn a new interface. Other mail agents have their own command interpreter for their individual mail commands (although the mush mail agent simulates a Unix shell). Because MH commands aren't part of a monolithic mail system, you can use them at any time; you don't have to start or quit the mail agent. Because you use them from a shell prompt, you can use all the power of the shell. If your shell has time-saving aliases or functions (and most do), you'll be able to use them with MH, of course. And because MH isn't a monolithic mail agent, you can use MH commands in Unix shell scripts, or call them from programs in high-level languages like C. Unlike most mail agents, MH keeps each message in a separate file. The filename is the message number. To rearrange the messages, MH just changes the filenames. MH can use standard Unix file system operations such as removing, copying and linking messages. The message files are grouped into one or more folders, which are actually Unix directories. MH is free, powerful, flexible--and the basics are easy to learn. ------------------------------ Subject: !01.02 What is the current version/status of MH. From: Bill Wohler Date: Sun, 23 Sep 2007 23:51:52 -0700 The current official version of MH is 6.8.3, although a beta of 6.8.4 is available. This version includes MIME, a multi-media MH package that implements the new IETF work on Multi-media 822 (MIME). This allows you to include things like audio, graphics, and the like, in your mail messages. --Marshall Rose MH now works with Kerberos as well. In addition, a new program called mhparam extracts arguments from .mh_profile which is useful in shell scripts. Please see the file CHANGES in the distribution for more details. Due to the languishing state of MH, Richard Coleman created another version of MH called nmh based upon MH 6.8.3. He added GNU autoconf to ease installation considerably and fixed several bugs and inconsistencies. Doug Morris picked up the torch in 2002 and moved development to Savannah where Jon Steinhart joined him as a project maintainer. See http://www.nongnu.org/nmh/. The stable version of nmh is 1.2. The file DIFFERENCES in the nmh distribution contains an ever-growing list of differences between nmh and MH. GNU mailutils (version 1.2) is a collection of mail-related utilities. At the core of mailutils is libmailbox, a library which provides access to various forms of mailbox files (including remote mailboxes via popular protocols and MH). See http://www.gnu.org/software/mailutils/. ------------------------------ Subject: !01.03 Where can I get MH? From: Bill Wohler Date: Sun, 23 Sep 2007 23:51:46 -0700 MH comes standard with: Berkeley Software Design BSD/386 . . . . MH 6.8.3 Control Data Corp. CDC4680-MP . . . . . . EMH 1.4.2 (modified MH) Debian GNU/Linux 4.0 . . . . . . . . . . nmh 1.1-RC4 Debian GNU/Linux 4.0 . . . . . . . . . . mailutils 1.1 DEC Ultrix 3.1 . . . . . . . . . . . . . MH 6.5 DEC Ultrix 4.2A.4 . . . . . . . . . . . . MH 6.7.1 DEC OSF/1 . . . . . . . . . . . . . . . . MH 6.7 Evans and Sutherland ES/OS 2.3 . . . . . MH 6.6 FreeBSD . . . . . . . . . . . . . . . . . MH 6.8.4 IBM PS/2 AIX 1.3 . . . . . . . . . . . . MH 6.4 IBM RISC System/6000 AIX 3.x and 4.x . . MH 6.6 MIPS RISC/OS 4.52 . . . . . . . . . . . . MH 6.6 Red Hat Linux (3.0.3, 4.0 and 4.1) . . . MH 6.8.3 SGI Irix 6.2 Freeware 2.0 CDROM . . . . . MH 6.8.3 Sony NEWS-OS 4.3 . . . . . . . . . . . . MH 6.7.2 Tektronix UTek . . . . . . . . . . . . . MH (Version Unknown) Download MH: http://download.savannah.nongnu.org/releases/nmh/nmh-1.2.tar.gz 831kB Download GNU mailutils: http://ftp.gnu.org/gnu/mailutils/mailutils-1.2.tar.gz 3.4MB ------------------------------ Subject: !01.04 What references exist for MH? From: Bill Wohler Date: Sun, 23 Sep 2007 23:51:41 -0700 The Web: http://rand-mh.sourceforge.net/ http://www.nongnu.org/nmh/ http://www.gnu.org/software/mailutils/ http://mh-e.sourceforge.net/ Books: MH & xmh: E-mail for Users & Programmers. Third edition. Jerry Peek, with Bill Wohler and Brent Welch. ISBN 1-56592-093-7. 738 pages. O'Reilly & Associates, Inc. Out of print as of August, 1996. References to "the MH book" in this document refer to the third edition (plus updates) of this book online at http://rand-mh.sourceforge.net/book/. Section numbers for the second edition may appear in parentheses. There is another book that contains a number of examples of advanced mail handing using MH as the example message handler. It's also quite a good reference on email in general. The Internet Message. Marshall T. Rose ISBN 0-13-092941-7. 396 pages. P T R Prentice Hall Papers: MHN Tutorial by Jerry Sweet ftp://ftp.ics.uci.edu/pub/mh/contrib/multimedia/mhn-tutorial.ps.Z 141k ftp://ftp.ics.uci.edu/pub/mh/contrib/multimedia/mhn-tutorial.tex.Z 48k Usenet: comp.mail.mh gmane.mail.exmh.devel gmane.mail.exmh.user gmane.mail.mh-e.announce gmane.mail.mh-e.devel gmane.mail.mh-e.user gmane.mail.nmh.devel Mailing lists: There are three mailing lists for nmh: nmh-announce, nmh-workers, and nmh-commits. See: http://savannah.nongnu.org/mail/?group=nmh The page for each list contains a link to the archives. MH-users archives: Current archives can be found at: http://lists.nongnu.org/archive/html/nmh-workers/ Older archive can be found in the mh-users and mh-workers archives at: http://sourceforge.net/project/showfiles.php?group_id=143658&package_id=188462 There are directions in the release notes. Basically, you can use either "msh" or the individual commands "inc -file" to get the messages into a folder, and then "scan", "pick", "show", and so on (or your favorite commands in xmh, MH-E, etc.). --Jerry Peek This document: http://www.newt.com/faq/mh.html http://faqs.cs.uu.nl/na-dir/mail/mh-faq/part1.html MH-E documentation: GNU Emacs 19.29 comes with a version of MH-E that includes online (Texinfo) documentation. Try "C-h i m mh-e RET". It is also available in HTML and PDF formats at http://mh-e.sourceforge.net/manual/. See also "What other MH software is available?" to see where you can get the latest version of MH-E which includes the documentation sources. exmh: The FAQ is available at http://www.beedub.com/exmh/exmh-faq.html. The online exmh sections from the MH book can be found at http://rand-mh.sourceforge.net/book/index.html#chTourexmh Signature and Finger FAQ: http://www.faqs.org/faqs/usenet/signature-faq/ ------------------------------ Subject: 01.05 What other MH software is available? From: Stephen Gildea , Bill Wohler Date: Thu, 19 May 2005 21:20:57 -0700 MH-E is the Emacs interface to the MH mail system. It offers all the functionality of MH, the visual orientation and simplicity of use of a GUI, and full integration with Emacs and XEmacs, including thorough configuration and online help. MH-E allows one to read and process mail very quickly: many commands are single characters; completion and smart defaults are used for folder names and aliases. With MH-E you compose outgoing messages in Emacs. This is a big plus for Emacs users, but even non-Emacs users have been known to use MH-E after only learning the most basic cursor motion commands. Additional features include: * attractive text rendering with font lock * composition and display of MIME body parts * display of images and HTML within the Emacs frame * folder browsing with speedbar * threading * ticking messages * lightning-fast full-text indexed searches of all of your email * virtual folders to view ticked and unseen messages, search results * multiple personalities * signing and encrypting * spam filter interaction * XFace, Face, X-Image-URL header field support with picons The GNU Emacs distribution includes MH-E. MH-E is maintained at SourceForge: http://mh-e.sourceforge.net/ From: Chris Menzel Date: Sat, 15 Dec 2001 10:02:38 -0600 The terminal-oriented, fast, and powerful mutt mail client not only supports the MH mail format but also supports .mh_sequences files, providing a robust interface to MH. It is also amazingly configurable and is very adept at handling MIME attachments and HTML mail. Unlike MH, the displayed message numbers do not necessarily correspond to the message filenames. This makes threading and sorting lightning fast but slower to display very large folders. http://www.mutt.org/ From: Brent Welch Date: Tue, 20 Mar 2001 22:42:15 -0800 EXMH is a user interface for the MH mail system written in TCL/TK. Exmh has MIME support, color feedback in the scan listing, a folder display with one label per folder, clever scan caching, facesaver bitmap display; background inc, various inc styles, searching over folder listing and message body, a dialog-box interface to MH pick, a simple built-in emacs-like editor, interfaces to other editors, user preferences, user hacking support. For more info or to obtain exmh, see: http://exmh.sourceforge.net/ From: "Eric D. Friedman" Date: Tue, 9 Feb 1999 22:52:44 -0800 Mhtake is a perl script that lets you add people to your mail aliases file by typing mhtake [message #]. http://orion.oac.uci.edu/~friedman/mhtake.txt From: Steinar Bang Date: Fri, 26 Jan 1996 13:51:08 +0100 Mew (an Emacs interface to MH that has MIME and PGP capabilities) is found at: ftp://ftp.aist-nara.ac.jp/pub/elisp/Mew/mew-current.tar.gz [MH-E has had these capabilities since version 7.0 so mew is obsolete if you use MH-E. --Ed] From: James Perkins Date: Fri, 1 Jan 1993 00:00:00 -0800 Vmh is designed for people using the bulletin-board features of MH, where mail is stored in packed (single-file) folders. As a result, use of this program cannot be mixed with the use of normal MH commands. Vmh is a part of the official MH distribution. From: James Perkins Date: Fri, 1 Jan 1993 00:00:00 -0800 Xmh is a X11 mouse-based MH browsing tool. It is very powerful and feature-filled and thus comes with a moderate learning curve. Its dependence on the X11 environment makes it very reconfigurable, but only by people well-versed in X applications programming. Its message reply built-in-editor interface is not always popular among those used to having MH bring up the editor of their choice. Date: Fri, 1 Jan 1993 00:00:00 -0800 xmh is part of the standard X Window System distribution from the X Consortium. Ultrix also ships dxmail which is similar. ftp://cs.utk.edu/pub/xmh.shar.Z 162k From: Harald Tveit Alvestrand Date: Fri, 1 Jan 1993 00:00:00 -0800 Here's a version of xmh that includes MIME. ftp://aun.uninett.no/pub/mail/mixmh/mixmh-0.3.tar.Z 232k From: Nathaniel Borenstein Date: Sun, 26 Nov 1995 19:04:51 -0800 Metamail is a package that can be used to convert virtually ANY mail-reading program on Unix into a multi-media mail-reading program. It is an extremely generic implementation of MIME (Multipurpose Internet Mail Extensions), the proposed standard for multi-media mail formats on the Internet. The implementation is extremely flexible and extensible, using a "mailcap" file mechanism for adding support for new data formats when sent through the mail. At a heterogeneous site where many mail readers are in use, the mailcap mechanism can be used to extend them all to support new types of multi-media mail by a single addition to a mailcap file. The metamail distribution comes complete with a small patch for each of over a dozen popular mail reading programs, including Berkeley mail, mh, Elm, Xmh, Xmail, Mailtool, Emacs Rmail, Emacs VM, Andrew, and others. Note that the MH patches are now integrated into MH 6.8. ftp://ftp.bellcore.com/pub/nsb/mm2.7.tar.Z From: Tom Christiansen Date: Tue, 9 Feb 1999 22:55:24 -0800 Plum is a highly configurable and extensible screen-oriented front-end for processing MH mail on ASCII terminals. Unlike MH-E, the extension language used in plum is perl, not LISP. Plum offers many of the advantages of xmh, but lacks several of xmh's disadvantages. The look&feel derives more from vi than from emacs. Key bindings and functions may be changed on the fly to suit the user's preference. It offers filename and word completion on folder, variables, and command names. Until it is included in the standard distribution (under miscellany), you can find a copy on: http://www.cpan.org/authors/Tom_Christiansen/scripts/plum.gz 29k or mail requests to Tom From: Jerry Sweet Date: Tue, 1 Nov 1994 00:00:00 -0800 Mhunify is a set of perl scripts and templates that provides shell-level MH functionality with USENET news. Since MH supports MIME, MIME-format news articles just work. I've found that being able to handle news in the same way that I handle email is very useful, although there are some tradeoffs. Mhunify also treats MH folders just like news groups. If you subscribe to several mailing lists, and your email is automatically delivered to separate folders, say, via procmail or via MMDF's .maildelivery, the mhunify package lets you progress automatically through your folders just as you would news groups. ftp://ftp.ics.uci.edu/pub/mh/contrib/multimedia/mhunify.shar.gz From: Dale Carstensen Date: Tue, 1 Nov 1994 00:00:00 -0800 olmh is a demo for OLIT (Open Look Interface Toolkit, the Open Look wrapper to Xt) in Sun's Open Windows 3 that does handle 3rd and subsequent levels of nesting of folders. Obtain the Open Windows 3 distribution CD/ROM from Sun (SPARC only). To do this, call 1-800-USA-4SUN and send tone "2" for telemarketing after it answers. The 4.1.2 CD/ROM may also have Open Windows 3. The list price for the 4.1.2 CD/ROM is $200. From: James Perkins Date: Sun, 1 May 1994 00:00:00 -0800 Vmail is a curses-based, vi-like message browser which calls on MH programs to manipulate mail. It can be used on almost any terminal. It organizes mail folders into index pages, from which a message can be selected to be shown, replied-to, forwarded, refiled, deleted, and so on. The vi-like interface and command keystrokes are comfortable to less-experienced Unix users, and it is a small, compact program, unlike the MH-E Emacs package. This version of vmail has been bugfixed and enhanced from the original vmail published on the net in 1987 by J. Zobel. ftp://ftp.uu.net/comp.sources.unix/volume12/vmail/part0*.Z 46k ftp://ftp.ucs.ubc.ca/pub/mh/vmail.[1-3]of3.Z 58k Or mail requests to James. From: James Perkins Date: Sun, 1 May 1994 00:00:00 -0800 vmailtool may be for you if you have a Sun workstation. It is a button gadget panel for the above-mentioned vmail program. It brings vmail into the windows era where people no longer need to memorize specific command keystrokes. It also provides a mail icon with the flag that pops up when new mail arrives. Again, this is a compact, simple tool, unlike the powerful xmh program. Still, it's a welcome alternative for many people who are running SunView or OpenWindows. ftp://ftp.ucs.ubc.ca/pub/mh/vmailtool.Z 18k or mail requests to James. MMH, My Mail Handler, is a Motif interface for reading and sending mail. It uses the MH commands to actually handle sending a receiving messages. It does not support all the capabilities of MH, but offers a large enough subset to handle the majority of users. Its intended user is someone between "bumbling email novice" and "sophisticated user". Hooks are provided to allow the user to customize and add new commands. ftp://ftp.eos.ncsu.edu/pub/bill/bill.tar.Z 120k From: Andrew Waugh Date: Fri, 1 Jan 1993 00:00:00 -0800 X.500 lookups: If a name is enclosed in square brackets, when entering a destination address: To: [Greg Wickham,CSIRO] a search will be made in the X.500 Directory for the individual's entry. If an address exists then it will be extracted and placed into the headers. Mail requests for the software to the author. From: Barbara Dyker Date: Fri, 1 Jan 1993 00:00:00 -0800 QueueMH is an email based service request and tracking system based on the Rand Mail Handler. ftp://ftp.cs.colorado.edu/pub/cs/sysadmin/utilities/queuemh.tar.Z 98k From: Date: Mon, 1 Mar 1993 00:00:00 -0800 Qmh is an MH-based group mail management tool. Written entirely in perl, Qmh combines the best aspects of MH with group mail heuristics and delivers a sensible package for all levels of Unix users. A limitless number of individual queues and associated groups of permitted users can be established. Specific functionality includes the following modes of operation; checking header dates and sending reminder/deadline mail, editing existing messages, help screens, creating new messages from scratch or exiting messages, resolving messages, scanning queue folders, and annotating with status both by editing and sending mail. Qmh is a single generic program in and of itself from which all modes of operation are invoked. Additionally, each separate queue may be accessed via a link to the single program. All system configuration is maintained in a single file that is read upon each invocation of Qmh. Formatting and template files are provided in the system library, although individual users can override the defaults simply by creating equivalent files in their own MH mail directory. Qmh provides a powerful database-like functionality by allowing limitless per-queue X-Qmh-<$value> headers to be included in messages. These "fields" then form the context of the queue messages and provide a user-defined, but yet structured environment for queries, reporting, and random information. Qmh is designed to provide a complete solution for SA groups, help desks, support organizations, or wherever two or more individuals are trying to manage multiple mail requests. Qmh is also compatible with versions of xmh that provide user-level command buttons. Provided in the Qmh package is a ~/.Xdefaults template file that's setup to harness the power of Qmh. From: Jerry Peek , Shannon Yeh Date: Sun, 11 Mar 2001 00:23:21 -0800 MacMH and PC/MH: These were available only for non-commercial degree-granting institutions from: Networking & Communication Systems 115 Pine Hall Stanford University Stanford, CA 94305-4122 Phone: +1 415-723-3909 See also: ftp://netix.com/pub/pc-mh-info/* For more PC/MH info, contact: Netix Communications, Inc. 15375 Barranca Parkway Building G, Suite 107 Irvine, CA 92718 Phone: +1 714-727-9532 FAX: +1 714-727-3922 Internet: info at netix.com In addition, you might try Wollongong, to see if they have something you can get. [This information appears to be out of date. Please send me pointers to valid information. Potential sites include jessica.stanford.edu. --Ed] Two other potential methods to run MH under Windows: Run Unix under Windows with VMware (http://www.vmware.com/) or try to compile nmh with the Cygwin tools (http://www.cygwin.com/). ------------------------------ Subject: !01.06 How can I print a MH manual? From: Bill Wohler , Jos Vos Date: Sun, 23 Sep 2007 23:51:33 -0700 Documentation in text and PostScript format is found in the MH-doc.tgz tarball on: http://sourceforge.net/project/showfiles.php?group_id=143658&package_id=188464 To generate your own copy for printing, first obtain the MH sources (see "Where can I get MH?") if you don't already have it. Go into the "doc" directory and run "make guide" to create the administrators guide and "make manual" to create a user's manual which includes tutorials and man pages. If the doc directory is empty or is missing the Makefile, you'll have to run "mhconfig MH" in the conf directory so that the documentation with correct local information is created. For properly formatting the documentation (at least the manual pages) you might even have to install MH, because a reference to a tmac.h file in the MH lib directory is made in the manual pages. ------------------------------ Subject: 01.07 How should I report bugs? From: Bill Wohler Date: Wed, 29 Sep 2004 00:12:42 -0700 Bugs in nmh should be reported at: http://savannah.nongnu.org/bugs/?group=nmh Bugs in MH-E should be reported at: http://sourceforge.net/tracker/?atid=113357&group_id=13357 ------------------------------ Subject: 01.08 How can I convert from my mailer to MH? From: Mike Sutton Date: 7 Jul 1995 10:03:50 GMT The unrmail function will convert rmail format to mbox format. From: Jerry Peek Date: Fri, 1 Mar 1991 13:03:15 -0800 If you use one of a mail agent like 'mail', 'mailx', 'elm' or 'mush', converting to MH is easy. When you run the 'inc' command, it reads all new messages from the system mailbox into your 'inbox' folder. Those mail agents also have separate files or "folders" that hold messages in the same format as the system mailbox. You can read them with the 'inc -file' command. For example, to read the messages from your 'mbox' mail file into your MH 'inbox' folder, you'd type: % cd % cp mbox mbox.backup % inc -file mbox If you see the usual "Incorporating new mail into inbox..." message and a scan listing, the messages probably were converted. Read some or all of them (with the 'show' command) and be sure. The 'inc' won't remove your mbox unless you use '-truncate'. From: "Jason R. Mastaler" Date: Mon, 1 May 1995 00:00:00 -0800 You can also specify an alternate folder to inc. Here's how you can convert all your folders en masse: for arg in `cat flist`; do echo "converting $arg" inc +"$arg" -file "$arg" -silent done Section D.4 of the MH book's second edition lists two scripts to convert mail files to MH folders: babyl2mh to convert from rmail's BABYL format; vmsmail2mh to convert from VMS's mail (see "What references exist for MH") to see where the book's examples can be ftped from). These scripts aren't in the third edition but are in its archive file. From: Vivek Khera Date: Fri, 1 Jan 1993 00:00:00 -0800 I rewrote the above script in Perl since the original script doesn't work for some people (see "babyl2mh.pl" below). From: Juergen Nickelsen Date: Fri, 1 Jan 1993 00:00:00 -0800 You can remove the second to last second line ("> $input"), so that the script doesn't zero out your RMAIL file. Another alternative is to replace this line with "inc -file $tmpmbox $folder && > $input", so that the RMAIL is only zeroed if inc successfully incorporated the mail. Finally one could add a switch -z, so that the RMAIL file is only zeroed if the switch is given. (See "Appendix inco".) Date: Sun, 1 May 1994 00:00:00 -0800 Use the following to convert a BABYL format file to Unix mail format. ftp://inf.informatik.uni-stuttgart.de/pub/gnu/emacs_extras/rmailtovm.el.Z 6k See also MH book second edition (Appendix D). ------------------------------ Subject: 01.09 What is the copyright status of nmh? From: Richard Coleman Date: Mon, 10 Oct 2005 18:16:58 -0700 nmh is distributed under a variant of the classical BSD copyright. Check the COPYRIGHT file in the nmh distribution for the details. There are some specific files which were contributed to the original MH package that are copyrighted by their original author. We have retained the copyright notices of these authors in these files. ------------------------------ Subject: 02.00 ***** Building MH ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 02.01 What machines does MH run on? From: Bill Wohler Date: Thu, 19 May 2005 21:22:55 -0700 MH isn't just for Unix any more. Versions are reported to run on OS/2 (see "How can I build MH on OS/2?"), Windows (see "How can I build MH on Windows?"), and Mac (see "How can I build MH on Mac?"). Oh yeah, the Mac is now Unix. Maybe Windows Longhorn will be built on Unix too. From: Jerry Peek Date: Fri, 1 Mar 1991 13:03:15 -0800 If you have a computer running Unix, you can probably run MH. ------------------------------ Subject: 02.02 How do I build MH? From: Bill Wohler Date: Sun, 8 Sep 1996 15:13:12 -0700 If you're using Linux, you can simply install the nmh or MH package which is available in most distributions. If you want to build nmh, follow the directions in the file named INSTALL. Basically, it's simply "./configure; make; make install." If you have MH on the other hand, if you carefully read the file named READ-ME in the root of the source hierarchy, you should not have any trouble building MH. If you're having troubles building MH, it could be that the problem has already been fixed, but hasn't yet gotten into an official release. Please see http://www.gw.com/mail/mh/patches/ for more info. ------------------------------ Subject: 02.03 What options should I use? From: Bill Wohler Date: Tue, 1 Dec 1992 00:00:00 -0800 BERK: Do NOT include the BERK option (in versions 6.7 or later)! BERK breaks the mh-format functions that take apart address lines, for example mbox, from, and friendly. This would really put a crimp on my replcomps file. LOCKF: if you have NFS, you need to lock your mailbox with lockf() so the lock will be honored by all machines on the local network. If you have the lockf() system call, include LOCKF. JQ Johnson makes the point that one should use this option carefully since it requires a robust lockf() call. For example, this option caused serious problems on his SunOS 4.1.1. He suggested using LOK_BELL instead, and adding "lockstyle: 1" to $MHLIB/mts.conf (mtstailor). ATZ: makes your timezones print like "EST" instead of "-0500". Much prettier. --Stephen Gildea However, Tony Landells replies: "Yes; very pretty. How unfortunate that timezone names are so ambiguous, so that EST can be interpreted, at a minimum, as (American) Eastern Standard Time, (Australian) Eastern Standard Time, or (Australian) Eastern Summer Time (and yes, I think it's dumb having the same acronym for both normal and Summer time, but that's a different problem). While the numeric timezones may not look as nice, they are, at least, reasonably unambiguous. I would urge anyone who ever intends/hopes/expects to use email outside the U.S. to NOT use ATZ (sorry Stephen)." At any rate, the conf/examples directory has been updated and contains many examples show you which options are required on your platform and which are optional (in the upcoming version MH 6.8). At any rate, it is recommended that you examine the options in the example configuration files, and read about them in READ-ME. RPATHS: a side-effect is that slocal writes messages to your system maildrop without the MMDF C-A's that separate messages, so your BSD tools like from work. ------------------------------ Subject: 02.04 What do I need to do to use POP? From: Bill Wohler Date: Sun, 8 Sep 1996 23:31:01 -0700 MH6.7 (and earlier versions too) include a server for version 3 of POP. From: Morgan Fletcher Date: 14 Mar 1996 19:24:23 -0800 Ensure that /etc/services contains the following: pop2 109/tcp postoffice # POP version 2 pop2 109/udp ->pop 110/tcp # POP version 3 (MH's inc thinks it's "pop") ->pop 110/udp pop3 110/tcp # POP version 3 pop3 110/udp Also compile with the POP options: POP, DPOP, RPOP, etc. From: Richard Coleman Date: 06 Feb 1997 03:43:17 -0500 To get MH to use the pop3 service, add POPSERVICE=pop3 to your MH configuration and recompile: ------------------------------ Subject: 02.05 Does MH support IMAP? From: Lyndon Nerenberg Date: 27 Jul 1999 11:33:39 -0600 Run exmh on the laptop, and modify your .mh_profile to inc using APOP. This is how I run MH-E and it works fine. (I did have to modify MH-E a wee bit to allow it to prompt for the password. You would likely have to do something similar with exmh.) As a spare time project I'm adding enough IMAP support to MH (6.8.3) to allow you to 'inc -imap [-imapfolder foo]'. If I ever get this done I'll stick the diffs up somewhere. (It's not a big priority as I can get at my IMAP INBOX using APOP.) From: Tim Showalter , John Prevost Date: Wed, 25 Sep 1996 21:34:56 -0400 We are developing fmh and intend to support as much of MH as is feasible. However, MH and IMAP don't necessarily agree as to what things are going to look like. MH has static message numbers until you pack a folder; IMAP keeps two numbers on a message, one which is absolutely static and one which is relative to the top of a mailbox. Messages in IMAP are essentially immutable. IMAP doesn't (currently) allow message annotations. fmh will keep state with a background daemon instead of writing it to disk, and will probably try and keep as little on disk as possible. fmh doesn't understand MH folders at the moment, and probably won't for a really long time, if ever. As I said before, we're mostly interested in the IMAP aspects as we're using a networked file system and saving stuff on the local disk just isn't an option. fmh is not MH at a very fundamental level. It is very unlikely that it will be merged, as we're not quite as interested in creating something that is MH and IMAP as we are in writing a good IMAP client. Also, the MH code isn't going to take the introduction of IMAP without a near complete rewrite. It is not available yet. Inquiries are welcome at . From: Rahul Dhesi Date: 23 Sep 1996 08:39:52 GMT What prevents people from doing a telnet to their mail server, logging in, and firing up MH directly? Site policy? An operating system that does not let MH compile or run? Overloaded machine with insufficient processing power for MH? All these are site-specific problems and the solution lies in solving them locally, not in forcing MH to go over IMAP. IMAP was never designed to emulate a filesytem. MH was designed to make direct advantage of the filesytem structure. There is no compatibility between the two. By the time IMAP is revised enough to support MH you will have reinvented NFS. There *is* scope for redesign here, though. It would be nice to have a single-user filesystem. Create a binary telnet session to the filesystem server, log in as yourself, and then over that session run a filesystem protocol. Normal filesystem protections at the other end will be sufficient for all permissions checking, so the filesystem protocol would need to do no other permissions checking. The question of whom to export directories to would go away: They are exported to whoever completes a successful login, and accessible to the user if he would be able to access them on the server as his login id. You could even use challenge-response for the initial login, coupled with ssh-based encryption, so you automatically have a secure filesystem without even trying. IMAP is too restricted in its scope to be easily modifiable to emulate such a filesystem. It would have to be a redesign from scratch. From: John Romine Date: Sun, 8 Sep 1996 15:45:27 -0700 No. MH only supports retrieving mail using POP3. POP3 is on the "standards track"--it is now an elective Internet Draft Standard (see RFC 1939 for more details). At this point, IMAP[23] are "experimental, limited use" protocols; it is unlikely that MH will support them. From: Bill Wohler Date: Sun, 8 Sep 1996 15:45:32 -0700 Since John posted the message above, IMAP has progressed from an "experiemental, limited use" protocol. While IMAP is not universal, many vendors now have implementations. I've found several things which might help. First, a definition lifted from the Pine FAQ: What is IMAP? IMAP stands for "Internet Message Access Protocol". An IMAP client program on any platform at any location on the Internet can access email folders on an IMAP server. While the messages appear to be local, they reside on the server until the client explicitly moves or deletes them. The IMAP protocol is a superset of POP, containing all POP commands plus more. For a comparison of IMAP and POP, see the paper Comparing Two Approaches to Remote Mailbox Access: IMAP vs. POP (in ftp.cac.washington.edu:/mail/imap.vs.pop). IMAP is what allows Pine (or any other IMAP client) to get to email on a central campus email server. There are current IETF working groups revising IMAP and readying it to become an Internet standard. A copy of the latest IMAP draft may be obtained from: ftp://ftp.cac.washington.edu/mail/latest-imap-draft For a list of IMAP clients, see the file imap.software, in the same directory. From: David L Miller Date: Mon, 1 Aug 1994 00:00:00 -0800 ipop3d from the UW IMAP toolkit can operate in a couple modes. As a straight POP3 server, it uses the same C-client library as imapd, so it co-exists comfortably with imapd. It can also operate as a POP-to-IMAP gateway so that your POP-only clients can access IMAP services. ftp://ftp.cac.washington.edu/mail/imap.tar.Z 1.0M From: Mark Crispin Date: Mon, 1 Aug 1994 00:00:00 -0800 The only answer I can give for [how MH users can use IMAP] is that Pine can read mailboxes in MH format; and that someone might in the future develop a version of MH that can use IMAP. ------------------------------ Subject: 02.06 Why does "mailgroup mail" only affect inc but not slocal? From: John Romine Date: Fri, 1 Jan 1993 00:00:00 -0800 If "mailgroup" is set, inc is made set-group-id to this group name. Some SYS5 systems want this to be set to "mail". Set this if /usr/spool/mail (or /usr/mail) is not world-writable. These changes were contributed by Peter Marvit, and "inc" is very careful about its use of the set-gid privilege. Note that slocal doesn't know how to deal with this, and will not work under these systems; just making it set-group-id will open a security hole (since it doesn't know when to drop the set-gid privileges). If you're using "mailgroup", you should remove slocal (and its man page) from your system. Alternatives to slocal include deliver, procmail, and mailagent. (See "What mail filters are available?") ------------------------------ Subject: 02.07 How can I build MH on Solaris 2? From: Richard Coleman Date: Tue, 20 Jan 1998 02:19:58 -0500 nmh builds out of the box on Solaris. From: Bill Wohler Date: Sun, 8 Sep 1996 15:56:31 -0700 See http://www.gw.com/mail/mh/patches/solaris/ for patches you may need. From: Neil Rickert , Scott K. Hutton , Casper H.S. Dik Date: Sun, 8 Sep 1996 15:57:25 -0700 First, don't use the BSD compatible stuff. Make sure that the Sun or GNU compiler appear before the BSD compiler in your PATH (e.g., /usr/ccs/bin). Second, don't use GNU make. Make sure that the Sun make appears before the GNU make in your PATH. Use conf/examples/solaris2.sun.com and fix the paths, if necessary. Optionally change the following to use the GNU compiler, to perform optimization, and to create shared libraries. cc gcc ccoptions -O -g -msupersparc slflags -shared Fix mhn.c with the diff in http://www.gw.com/mail/mh/patches/solaris/si_value_2.3. Optionally incorporate the Content-Length header fix. (See "How can I get MH to interpret the Content-Length field?") Linking with /usr/ucblib/libucb.so is incompatible with including . When compiling, you can ignore the following warning: fmtcompile.c, line 238: warning: semantics of "/" change in ANSI C; use explicit cast If you're using AFS, you'll have to replace any occurrence of "ln" with "ln -s" wherever the make dies when it tries to make a link "on a different file system." See also ftp://ftp.fwi.uva.nl/pub/solaris/solaris2.faq. Date: Thu, 1 Dec 1994 00:00:00 -0800 Unset LD_LIBRARY_PATH. From: Gary Strand Date: Mon, 1 May 1995 00:00:00 -0800 To cure slocal's Segmentation Fault problems, I decided to try 'cc' instead of 'gcc' (an alleged no-no under Solaris) and MH built just fine, and it's working perfectly. From: "Jason R. Mastaler" Date: Mon, 25 Sep 1995 17:35:13 -0400 Don't use "ldoptions -s" with gcc. It may cause the compile to fail with: gcc: Internal compiler error: program ld got fatal signal 11 *** Error code 1 From: "Jeffrey T. Eaton" Date: Fri, 04 Apr 1997 15:30:36 GMT Fixed [DBM_PAGFNO_NOT_AVAILABLE error] by getting the latest gdbm package, compiling and installing it and the dbm/ndbm compatability stuff, and moving Sun's broken ndbm.h out of /usr/include. To fix "../sbr/libmh.so: undefined reference to `__builtin_va_arg_incr'", add "option __BUILTIN_VA_ARG_INCR" to your MH configuration. ------------------------------ Subject: 02.08 How can I build MH on Linux? From: Richard Coleman Date: Tue, 20 Jan 1998 02:19:58 -0500 nmh should build out of the box for most Linux systems. From: Bill Wohler Date: Tue, 9 Feb 1999 23:04:53 -0800 The Debian distribution of Linux comes with an MH and nmh packages. See http://www.debian.org/. See also http://www.gw.com/mail/mh/patches/linux/. From: "James A. Robinson" Date: 17 Apr 96 20:39:02 GMT Somebody on Debian ported it to Linux ELF. Look on ftp://ftp.debian.org/debian/stable/binary/mail/mh_6.8.4-13.deb for the .deb package of MH (it's a compressed tar file). The source is in ftp://ftp.debian.org/debian/stable/source/mail/mh_6.8.4-orig.tar.gz and mh_6.8.4-13.diff.gz. From: Brian Kirouac Date: 18 Apr 96 14:00:20 GMT If you are running Redhat and have rpm available you can also use ftp://???/pub/redhat-3.0.3/i386/RedHat/RPMS/mh-6.8.3-5.i386.rpm. The source code is in ftp://???/pub/redhat-3.0.3/i386/SRPMS/mh-6.8.3-5.i386.rpm From: "Brandon S. Allbery" Date: Sun, 26 Nov 1995 16:18:50 -0800 The current patch is the first one listed below. The old patch only works with libc-4.4, which is no longer used. The current patch is split into two pieces, as with the previous patch, but now the divisions are purely functional: the first diff enables MH to compile, the second allows creation of a shared library. [The paths are up to date, but I think the info in this paragraph is old. --Ed] Recent versions of GNU make choke on MH's makefiles. Unfortunately, the shared library patches depend on "export". If you have problems building MH, remove the "export" lines from all of the makefiles (if you applied the shared library patches) and try using BSD pmake instead. If you don't want to compile MH, the second file contains pre-compiled ready-to-run binaries which can simply be extracted in the root directory. ftp://sunsite.unc.edu/pub/Linux/system/Mail/readers/mh-6.8.3-diffs.tar.gz ftp://sunsite.unc.edu/pub/Linux/system/Mail/readers/mh-6.8.3-bin.tar.gz The sizes are 650k and 22k respectively. Note that these files are occasionally "cleaned up" by accident so please let me know if they are missing. ------------------------------ Subject: 02.09 How can I build MH on IRIX? From: Richard Coleman Date: Tue, 20 Jan 1998 02:19:58 -0500 nmh should build out of the box for Irix. From: Bill Wohler Date: Sun, 8 Sep 1996 15:33:22 -0700 See http://www.gw.com/mail/mh/patches/sgi/ for patches you may need. From: Arne K. Frick Date: 06 Jun 1995 18:30:01 GMT There is a file at viz.tamu.edu:/pub/sgi (see FAQ) containing a diff and sample configuration. If you cannot locate it, I can mail it to you. Note, however, that I had tremendous difficulties with them under 5.3: 1. Be sure to use /bin/make, NOT GNU make. 2. patch vomits over the diff. You can get around this by increasing the "fuzz factor" to 4. 3. The Makefile target for the shared library doesn't work. I had to do it by hand. But I'm stuck compiling mhn.c. From: Shankar Unni Date: 9 Jun 1995 01:53:48 GMT The fix for compiling mhn.c is in http://www.gw.com/mail/mh/patches/solaris/si_value_2.3. From: Jack Repenning Date: 25 Jul 1995 02:35:41 GMT (See "IRIX config file") below. ------------------------------ Subject: 02.10 How can I get MH to interpret the Content-Length field? From: Casper H.S. Dik Date: Sun, 8 Sep 1996 15:38:30 -0700 Apply http://www.gw.com/mail/mh/patches/solaris/content_length to your MH distribution and add the configuration option "CONTENT_LENGTH". It also includes the si_ fix in http://www.gw.com/mail/mh/patches/solaris/si_value_2.3 ------------------------------ Subject: 02.11 How can I build MH on HP-UX? From: Bill Wohler Date: Sun, 8 Sep 1996 15:50:54 -0700 If you find that your zotnet/tws directory isn't compiling, upgrade your MH (see "What is the current version/status of MH?") which includes fixes to lexedit.sed. See http://www.gw.com/mail/mh/patches/hp/ for for patches you may need. ------------------------------ Subject: 02.12 Can I prevent adding the local hostname to addresses behind firewalls? From: Ted Remillard Date: 24 Jun 1996 08:53:42 -0700 You can get MH to stop managing the headers and let the email server to do it. To do this, build MH with the options DUMB and REALLYDUMB. In the $MHLIB/mts.conf (mtstailor) file, set the server option to the IP address of the email server. After this is done, MH sends email directly to the email server and Local email To: and From: fields just have the user's simple email address, e.g., , and the remote email From: header will contain user@domainname, e.g., . Don't forget to define the REALLYDUMB option in the file sbr/addrsbr.c described below. From: Bret Rothenberg Date: Tue, 23 Jan 1996 12:25:24 -0800 (PST) Yes, use the "localname" parameter in "$MHLIB/mts.conf" (mtstailor) to specify the desired hostname. From: Ken Hornstein Date: 18 Aug 1995 23:51:48 -0400 If you're behind a firewall and sendmail gives you fits because MH adds the node name or site name to each address in the To: and CC: fields, you'll need to modify the MH source. The relevant source has to do with the REALLYDUMB option in sbr/addrsbr.c. Essentially what you need to do is set it up so REALLYDUMB is turned on (normally, it's turned off if you have MMDF or SMTP turned on). This will do what you want. I did this at our site, and it's been working great. The stuff for REALLYDUMB starts around line 613. ------------------------------ Subject: 02.13 Is there a patch to fix this or that? From: Kimmo Suominen Date: Sat, 3 Mar 2001 13:40:35 -0800 The MH Patch Archive has been opened at http://www.gw.com/mail/mh/patches/ It is a collection of patches to MH (the RAND MH Message Handling System), a set of electronic mail programs in the public domain. Since the last complete release of MH (version 6.8.3) UNIX systems have evolved making changes in the MH code necessary. Several new UNIX systems have emerged requiring new configuration templates and examples. This archive tries to collect all these fixes and enhancements that in the past have been available only through word-of-mouth and occasional reposts to newsgroups or mailing lists. The initial archive layout and the very time consuming collecting and categorizing of patches has been done by Jerry Peek. I will be the primary maintainer of the archive. Even though I will be monitoring several sources for new material (mainly the comp.mail.mh newsgroup but also the mailing lists , and ), I'd like to encourage everyone to submit patches also directly to the archive at . ------------------------------ Subject: 02.14 How can I build MH on OS/2? From: Sanjay Aiyagari Date: 21 Nov 1996 19:37:10 GMT ftp://ftp.jaist.ac.jp/pub/os/os2/network/MH/ ------------------------------ Subject: 02.15 Do any POP/IMAP servers handle MH format? From: "Carl S. Gutekunst" Date: 27 May 1997 07:24:34 GMT The University of Washington POP3 and IMAP servers can be backended by a variety of stores, including MH. This is the basis for Netscape's store, curiously enough. I haven't looked closely at how Mark Crispin implemented support for the new IMAP4 features when using an MH backend; it seems like there is a lot of computation when opening a folder for the first time, writing in the UID fields and such. But it basically appears to work. From: Lyndon Nerenberg Date: 27 Jul 1999 11:36:25 -0600 But [the UW IMAP server] can't delete/expunge from MH folders. (At least I've never been able to get it to work, and I've tried just about everything.) #mh in UW imapd isn't something I'd recommend to any serious MH user. From: Mark Crispin Date: Tue, 27 Jul 1999 14:43:25 -0700 > But it can't delete/expunge from MH folders. That's a very old version. delete/expunge has been in imap-4.x for a long while. However, there's no sticky flags. > #mh in UW imapd isn't something I'd recommend to any serious MH user. The converse is also true. The two don't play ball very well. From: Dieter Weber Date: 11 Feb 2003 04:23:38 -0800 The UW imap server supports MH folders. In order to see the MH mailboxes, you need to "subscribe" to the folders or add them to the .mailboxlist file in your home directory. ------------------------------ Subject: 02.16 How can I build MH on Windows? From: Satyaki Das Date: Wed, 19 Jun 2002 20:57:19 -0700 I have gotten MH-E to work on Windows (under Cygwin) using Earl Hood's patched nmh. It was really quite simple, but not very portable. I just needed to add/subtract "c:/cygwin" from a couple of places. Now it can read and send mail (even does PGP attachments). Thought this might be of interest to those of you stuck using Windows at work. From: Earl Hood Date: Sat, 08 Jun 2002 20:30:44 GMT I've made a tar/bz2 bundle available at This includes the patched source with binaries pre-built. I just remembered that I also had to hack the makefiles to get things to install since windoze executables have to end with .exe. I hacked the generated makefiles, so if you rerun configure, you may lose the hacks. Also, I believe the install will fail when trying to install the documentation, so to force things do: make -i install The binaries and support files should get installed (under /usr/local/nmh), but the docs probably won't. Then you will need to edit /usr/local/nmh/etc/mts.conf to reflect your local configuration. If anyone has any problems installing, I could zip up my /usr/local/nmh since I think it contains everything needed for runtime usage. From: Bill Goffe Date: 25 May 1999 18:13:55 GMT If you have Windows, consider looking at VMware http://www.vmware.com/ which provides a virtual machine where you can run Unix and therefore MH under Windows. From: Ted Nolan Date: 24 May 99 17:20:27 GMT The latest Cygnus Cygwin, GNU tools that run under Windows, http://www.cygwin.com/ seems to work pretty well and may well be able to build nmh. ------------------------------ Subject: !02.17 How can I build MH on a Mac? From: Dr Eberhard W Lisse Date: Sun, 05 Jun 2005 13:43:19 +0100 nmh compiles on the G4 iBook running Mac OS X 10.3.7 more or less out of the box with the powerpc HOST option. Use make all install. Use fink to install the nmh package on Max OS X 10.3.9 (and 10.4.1). metamail does not work out of the box. However, metamail-2.7.19-1030.src.rpm (SuSE) which compiles and installs cleanly. For exmh, first use fink to install the tcltk package. Then use fink to install exmh. ------------------------------ Subject: 03.00 ***** Scanning & Reading ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 03.01 What do I do if scan shows the wrong date? From: Bill Wohler Date: Fri, 1 Jan 1993 00:00:00 -0800 Upgrade to MH 6.8 or nmh. From: Darryl Okahata Date: 19 Jan 2000 23:01:10 -0800 MH 6.8.3 and nmh 1.0 still have a minor buglet where sortm doesn't always sort messages properly. If a (questionable) mail client sends messages with 2-digit years, like: Date: Sat, 23 Oct 09 22:02:01 EST or sends out buggy dates like (as buggy versions of Elm do): Date: Sat, 23 Oct 100 22:02:01 EST then sortm will not sort these messages properly. I have submitted patches to nmh-workers. ------------------------------ Subject: 03.02 How would one go about reading Usenet with MH? From: Bill Wohler Date: Sun, 26 Nov 1995 12:32:09 -0800 You can post via mail. Send your article to with a legitimate Newsgroups field. From: Jerry Peek Date: Tue, 1 Nov 1994 00:00:00 -0800 You can save articles in the news readers for later perusal with MH. First, create a symbolic link from your mail directory (e.g., usenet) to your news directory (e.g., "ln -s ~/News ~/Mail/usenet"). You can then treat your news directory as a mail folder. Thus, to select a news group, use "folder +usenet/comp/mail/mh". To set the default save location correctly in rn, use: rn -M -/ or in your nn presentation sequence: news.announce. +$F/$N comp.mail.mh + . . If there's news spooled on your machine (that is, not via NNTP) then you can read a newsgroup with commands like: show first +/usr/spool/news/comp/mail/mh next ... You can also use sequences to keep track of what you've read. MH will automatically set a "cur" sequence in each newsgroup you read that way. So, to continue reading the newsgroup sometime later, after you've read some other folder, you can do: next +/usr/spool/news/comp/mail/mh and you'll read the next (new) article (if any) in that newsgroup. Note that this can eventually make your private context file pretty huge; if there's a group you don't read often, you can remove its context entries with a command like: rmf +/usr/spool/news/comp/mail/mh Don't try that on a folder full of mail (a folder that isn't read-only), though... in that case, it'll remove all the messages! I haven't looked into posting. It seems like it shouldn't be hard. You could set up a "sendproc" that would look at outgoing email messages. If the message had a Newsgroups: header field, your sendproc could call inews(1) instead of post(8). I haven't seen much in the MH manpages or documentation about sendprocs (though I haven't looked for a couple of years...). See the "mysend" script in the MH book section 7.1.4 (13.13), or the URL: http://rand-mh.sourceforge.net/book/mh/senove.html#ASAtDm A threaded news reader like trn or tin is so much nicer, though, that reading news with MH may not be worth the hassle. See also MH book section 9.9 (8.7), or the URL: http://rand-mh.sourceforge.net/book/mh/shafol.html From: Stephen Gildea Date: Fri, 1 Mar 1991 13:03:15 -0800 Although news readers are better, if one really wants to use MH, bbc will do the job. For example, "bbc comp.mail.mh" reads this newsgroup. To enable bbc, you have to specify "bboards" when you build MH. From: Kimmo Suominen Date: 15 Aug 1996 18:18:10 GMT Sendmail v8 comes with MAILER(pop) which was written for the MH spop. Since I use bboards with NNTP, I never looked at the bboards setup. Date: Tue, 1 Nov 1994 00:00:00 -0800 See mhunify in (see also "What other MH software is available?"). ------------------------------ Subject: 03.03 How can I search through multiple folders? From: Jerry Peek Date: Mon, 1 Mar 1993 00:00:00 -0800 Recurse through the folders (in csh and sh): % foreach f (`folders -f`) $ for f in `folders -f` ? pick [switches] +$f > pick [switches] +$f ? end > done Or create a folder that contains links to all messages (in csh and sh): % foreach f (`folders -f | grep -v -x ln`) ? refile -src +$f -link all +ln ? end $ for f in `folders -f | grep -v -x ln` > do refile -src +$f -link all +ln > done and in the future, refile messages with "refile +folder +ln". To find something, use: % pick [switches] +ln See MH book sections 8.2.9 (7.2.9), 8.9.3 (7.8.3), or the URLs: http://rand-mh.sourceforge.net/book/mh/finpic.html#SeMTOnFo http://rand-mh.sourceforge.net/book/mh/usilin.html#AFoFuoLi ------------------------------ Subject: 03.04 Why don't MH format commands such as %(friendly) work? From: Anthony Baxter Date: Sun, 1 May 1994 00:00:00 -0800 The BERK option disables address parsing and therefore functions such as %(friendly). Recompile MH without the BERK option. ------------------------------ Subject: 03.05 Why doesn't "show" display all of a MIME message? From: Jerry Peek Date: Mon, 1 Aug 1994 00:00:00 -0800 It's not the fault of the "show" command or of MH in general. It's your system's configuration. Check the $MHLIB/mhn.defaults (mhn_defaults) file; if it doesn't have defaults for all content types, add them. Or, if you can't (or shouldn't) change mhn.defaults (mhn_defaults), you can put default entries in your MH profile file for those content types. Here's the part of the mhshow(1) (mhn(1)) manpage that explains how content types are handled. The example is for mhshow, but if you're using mhn, you'd replace mhshow with mhn: First, mhshow will look for an entry of the form: mhshow-show-/ to determine the command to use to display the content. If this isn't found, mhshow will look for an entry of the form: mhshow-show- to determine the display command. If this isn't found, mhshow has two default values: mhshow-show-text/plain: %pmoreproc '%F' mhshow-show-message/rfc822: %pshow -file '%F' If neither apply, mhshow will check to see if the message has a application/octet-stream content with parameter "type=tar". If so, mhshow will use an appropriate command. If not, mhshow will complain. So, add defaults that cover the types MH doesn't handle right now (or doesn't handle the way you want it to). Your defaults will override corresponding defaults in the $MHLIB/mhn.defaults (mhn_defaults) file. For example, if you don't have an HTML editor/browser on your system, you could tell MH to use the "less" paginator for HTML message parts: mhshow-show-text/x-html: less %F You can put that line in your MH profile. You can even set different defaults for different terminal types (say, your VT100 at home and your X setup at work). Make a file in the same format as mhn.defaults (mhn_defaults); store its pathname in the MHSHOW (MHN) environment variable. Add a test to your shell setup file (.bash_profile, .profile, .login) that tests the value of the TERM variable -- and, if you have an mhshow (mhn) setup file for that terminal type, store its pathname in the MHSHOW (MHN) variable. See also MH book sections 6.2.3, 9.4.4, 9.4.5, or the URLs: http://rand-mh.sourceforge.net/book/mh/remime.html#HomhShMe http://rand-mh.sourceforge.net/book/mh/confmhn.html#ShComhsh http://rand-mh.sourceforge.net/book/mh/confmhn.html#DiOChSmc From: Michael K. Neylon Date: Tue, 1 Nov 1994 00:00:00 -0800 If you are not using the X Window System, you may have to add this line to your MH profile: mhshow-charset-iso-8859-1: /bin/sh -c '%s' # nmh mhn-charset-iso-8859-1: /bin/sh -c '%s' # MH ------------------------------ Subject: 03.06 Can I get show not to run "less" so much on MIME messages? From: Richard Coleman Date: Tue, 20 Jan 1998 02:19:58 -0500 On nmh, you can do this just by "show -nocheckmime". This will disable the detection of MIME messages. From: Bill Wohler Date: Tue, 1 Nov 1994 00:00:00 -0800 If you say, "show all," and one of the messages was a MIME message, your pager will be run several times on each message, rather than once on all the messages as a whole. If you find this annoying, set the environment variable NOMHNPROC: % setenv NOMHNPROC "" # csh $ NOMHNPROC= # sh and bash $ export NOMHNPROC See also MH book sections 6.2.3, 6.2.10, or the URLs: http://rand-mh.sourceforge.net/book/mh/remime.html#HomhShMe http://rand-mh.sourceforge.net/book/mh/remime.html#Alttomhn ------------------------------ Subject: 03.07 Why do I get "mhn: don't know how to display content"? From: Richard Coleman Date: Tue, 20 Jan 1998 02:19:58 -0500 This has already been fixed in nmh. From: Keith Moore Date: Sun, 8 Sep 1996 15:49:50 -0700 MH 6.8.3 has a bug where it will not handle multipart/foo correctly if it doesn't know about foo. The patch: http://www.gw.com/mail/mh/patches/all/mhn_multipart tells it to treat such things as if they were multipart/mixed. (See also "Why doesn't "show" display all of a MIME message?"). ------------------------------ Subject: 03.08 How can I automatically delete MH backup files? From: mccammaa at expt05.stp.xfi.bp.com (Andy McCammont) Date: 22 May 1995 06:27:36 -0400 On System V system, add this to your crontab. If you don't have one, put this in a file, and run "crontab file". If your system does not support personal crontab files, get your system administrator to add an equivalent line to the system crontab file or daily clean-up script. Note that some administrators set the prefix character to '#'. # Remove old MH files 5 5 * * * find /PATH/TO/HOME/Mail -name ",*" -mtime +5 -exec rm {} \; ------------------------------ Subject: 03.09 Fixing "cannot fopen and lock /var/spool/mail/(user)" From: Patrick.Wambacq at esat.kuleuven.ac.be Date: Mon, 30 Sep 96 15:00:16 +0200 One should put the following lines in the $MHLIB/mts.conf (mtstailor) file: lockldir: lockstyle: 1 This prevents MH from using kernel level locking, and uses lock files instead. It solved the problem for me on two different architectures. When the lockldir entry is left empty as above, the lock file is put in the same directory as the file to be locked. If another directory is wanted, its name should be put here. From: alhy at MAILBOX.SLAC.Stanford.EDU Date: Mon, 9 Sep 1996 01:01:16 -0700 Often, this is caused by an NFS file lock. Don't ask me how it got there in the first place. To remove the file lock, do the following: # cd /var/spool/mail # cp user /tmp/user.tmp; rm user # save mail; remove locked file # chown user /tmp/user.tmp # allow user to inc old mail # su - user user% inc -file user.tmp # incorporate user's old mail Any mail that you receive in the fraction of a second that the second set of commands takes will be lost. (See also "Why does inc hang (on Sun)?") ------------------------------ Subject: 03.10 Can I read my mail with a Web browser? From: Jerry Heyman Date: Sat, 09 Oct 2004 12:41:03 -0400 See http://www.squirrelmail.org/ SquirrelMail is a standards-based webmail package written in PHP4. It includes built-in pure PHP support for the IMAP and SMTP protocols, and all pages render in pure HTML 4.0 (with no JavaScript required) for maximum compatibility across browsers. It has very few requirements and is very easy to configure and install. SquirrelMail has all the functionality you would want from an email client, including strong MIME support, address books, and folder manipulation. No MH support. Unless you're willing to write it... From: J C Lawrence Date: Wed, 10 Dec 2003 09:54:15 -0500 UW-imap can read MH folders although it doesn't maintain sequence files properly. Drop any of the IMAP web front ends in front of that. From: aeriksson at fastmail.fm Date: Wed, 10 Dec 2003 22:36:52 +0100 Have a peek at http://wmh.sf.net/. It's been a while since I worked on it, but it does give me what I need. Date: Mon, 05 Oct 1998 11:02:52 -0500 From: Kent Landfield Hypermail now supports MIME and alternate mailbox formats and sorts by author, date, and thread and can be read by a WWW reader. http://www.landfield.com/hypermail/ From: "Patrick A. Coronato" Date: 8 Sep 1995 16:36:03 GMT MHonArc, by Earl Hood from Convex, will read MH mailboxes as well as Unix mailboxes, create HTML "archives" and will also sort by date, thread and author and has support for MIME. Also, MHonArc is written in the Perl language. (You should go to this site if nothing more than to see the cool logo!) http://www.mhonarc.org/ ------------------------------ Subject: 03.11 How can I run inc automatically with POP? From: Bill Wohler Date: Mon, 27 Nov 1995 12:23:51 -0800 If MH has been compiled with RPOP, then the POP server host either needs to have your host in /etc/hosts.equiv or in your .rhosts file. Then add to your MH profile: inc: -host cuckoo given that "cuckoo" is the name of the your POP server. From: Andy Norman Date: Mon, 1 May 1995 00:00:00 -0800 Assuming your POP server is called cuckoo, add an entry to your MH profile for 'inc' like so: inc: -noaudit -norpop -noapop -host cuckoo Add the following to ~/.netrc and ensure it is readable only by you (e.g., chmod 600 .netrc): machine cuckoo.domain.name login joeuser password secret Replace the hostname, login and password with your own, of course. The hostname probably has to be fully qualified (i.e., include the full domain name). This example assumes that you can send mail by other means (e.g., with SMTP). ------------------------------ Subject: 03.12 Why does inc hang (on Sun)? From: ericding at mit.edu (Eric J. Ding) Date: 30 Apr 1996 00:22:01 -0400 This may be due to a non-robust implementation of lockf() over NFS. Try setting lockstyle to 1 in the $MHLIB/mts.conf (mtstailor) file so that MH uses dotfile locking rather than FLOCK or LOCKF. ------------------------------ Subject: 03.13 How can I get POP to work? From: Jonathan George Date: Tue, 23 Apr 1996 10:23:16 GMT If you get the error: inc: -ERR Unknown command: "rpop" you're trying to use "rpop" as the mechanism to authenticate the user. This mechanism is specified in RFC 1225 and then removed by RFC 1460. Your POP server is (rightly) rejecting this. The POP specification (RFC 1939) states that authentication is done either via a USER/PASS pair or via the APOP command. Try running inc with -noapop -norpop flags. ------------------------------ Subject: 03.14 How do I persuade mhshow (mhn) not to bring up a new window? From: Joel Reicher Date: Tue, 13 Nov 2001 16:49:04 +1100 I personally think [the solution below] is not the right solution. There's a reason that new window is opened--to ensure the correct characters are available. The "right" solution is surely to set the MM_CHARSET env var to iso-8859-1 and make the appropriate adjustments to the pager (in the case of less, setting LESSCHARSET=latin1). From: Larry Daffner Date: 27 Mar 1996 16:53:39 -0600 Add one of the following to your .mh_profile: mhshow-charset-iso-8859-1: %s # nmh mhn-charset-iso-8859-1: %s # MH ------------------------------ Subject: 03.15 How do I turn off of all the mhshow (mhn) prompts? From: Bill Wohler Date: Sun, 11 Mar 2001 11:33:10 -0800 In nmh, use mhshow -nopause. From: Larry Daffner Date: 27 Mar 1996 16:53:39 -0600 The "part xxx" message is controlled by the -list switch to mhn so add "mhn: -nolist" to your .mh_profile. To remove the pause, add an entry for "mhn-show-text/plain: more '%F'" to override the default which includes the "%p" escape. All of this is covered in the mhn man page (sort of--you need to add 2+2). It's a bit long, but well worth reading. ------------------------------ Subject: 03.16 Why is inc splitting messages improperly? From: Mayank Choudhary Date: Mon, 29 Apr 1996 09:39:29 -0700 MH considers "From " lines as message separators, so if this string is found within the body, inc splits the message. Add the following line to your .forward "|/usr/bin/mailcompat " where user-name is your login-id. See mailcompat(1) for more information. ------------------------------ Subject: 03.17 Can MH thread messages? From: "John W. Coomes" Date: 30 Apr 1997 13:02:10 -0500 Sort of. You can resort your folders by Subject with: sortm -textfield subject ------------------------------ Subject: 03.18 How can I avoid reading the HTML version of the message? From: Bill Wohler Date: 23 Jun 2000 10:19:34 -0700 You might find that you have two versions of the same message within the message. For example, one part might have a content type of text/plain and the other might be text/html. You may find that mhshow (mhn -show) wants to show the HTML version This is a feature of the multipart/alternative content type. If you prefer reading the the plain text version over the HTML version, you'd have to remove the line in $MHLIB/mhn.defaults or ~/.mh_profile that starts with mhshow-show-text/html (mhn-show-text/html). Of course, the tradeoff is that you'd never be able to view text/html at all, but you probably wouldn't care. ------------------------------ Subject: 03.19 How do I view or save attachments? From: Bill Wohler Date: Mon, 5 Mar 2001 09:12:15 -0800 Use mhshow (mhn -show) and mhstore (mhn -store) respectively. See the man pages for more details. ------------------------------ Subject: 03.20 How do I view HTML attachments with Netscape? From: Bill Wohler Date: Mon, 5 Mar 2001 09:58:05 -0800 Add one of the following to ~/.mh_profile: mhshow-show-text/html: %lnetscape -remote 'openURL(file:%f, new-window)' mhn-show-text/html: %lnetscape -remote 'openURL(file:%f, new-window)' The % escapes are described in the mhshow (mhn) man page. The ", new-window" argument in the netscape invocation is optional, but handy. After reading the message, you can dismiss the window with M-w and go back to reading mail. ------------------------------ Subject: 03.21 Fixing folders: unable to allocate storage for msgstats From: Pete Phillips Date: 30 Jan 2003 03:33:57 -0800 I found the following in my context file: atr-cur-/tmp: 1 atr-pseq-/tmp: 1 For some reason folders doesn't like this. Whether it's because of permission problems or just the size of my tmp directory (about 3/4 of a GB) I don't know, but removing these lines from my context file fixed the problem. ------------------------------ Subject: 03.22 How do I recursively list message attachments? From: Joel Reicher Date: 31 Oct 2001 00:36:14 +1100 I haven't quite managed a recursive listing, but I have worked out a recursive store, which is still useful. Hinted by a builtin display string for mhshow, I found the following works for mhstore: mhstore-store-message/rfc822: | mhstore -file - With that, mhstore will happily recurse down storing everything on its way. Not very discriminate, but the line can be altered to limit without destroying the recursion: mhstore-store-message/rfc822: | mhstore -auto -type message/rfc822 -type image/jpeg -file - which also names the files automatically for good measure. And, FWIW, I engage this by putting it in a separate file and invoking mhstore like env MHSTORE=mhn.rec mhstore ------------------------------ Subject: 03.23 Why do folder and flist overlook some of my sub-folders? From: Richard Coleman Date: Mon, 10 Oct 2005 18:14:24 -0700 There was a bug in these commands which caused them to quit searching a folder for sub-folders too early if the folder contained sub-folders which were symbolic links. This has been improved in nmh-0.25, but folder and flist will still not recurse into folders that contain only symbolic links. ------------------------------ Subject: 04.00 ***** Filing ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 04.01 Can I append MH messages to a Unix mailbox format file? From: Richard Coleman Date: Tue, 20 Jan 1998 02:19:58 -0500 In nmh, use packf instead. From: Bill Wohler Date: Fri, 1 Jan 1993 00:00:00 -0800 Yes, see $MHLIB/packmbox. ------------------------------ Subject: 04.02 Can I append MH messages to a GNU Emacs rmail BABYL-format file? From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 To convert your MH folders to BABYL folders, first run the following script on your Mail directory. #!/bin/sh for f in Mail/*; do if [ -d $f ]; then touch msgbox folder=`basename $f` echo -n packing $folder ... packf +$folder echo done mv msgbox Mail-rmail/$folder fi done This assumes you don't have nested folders. Your rmail folders will be left in $HOME/Mail-rmail in MMDF format which rmail can read. Then run rmail-input for each folder, which converts each folder into BABYL format. Be sure not to append any messages before they are converted from MMDF to BABYL, since there may be really strange results. ------------------------------ Subject: 04.03 Why do I get ".../.mh_sequences is poorly formatted?" From: Richard Coleman Date: Tue, 20 Jan 1998 02:19:58 -0500 This bug has been fixed in nmh (as of version 0.20). There are no limitations on the length of an entry in the .mh_sequences file. From: Jerry Peek Date: Mon, 1 Aug 1994 00:00:00 -0800 There is a line length limit in this file. When sequences are unbroken (without gaps in numbering), that makes short entries in the .mh_sequences file, like this: inftex: 72-8000 But when there are lots of numbering gaps, the entry gets long: inftex: 76 79-81 87 95-96 105 109 120 124 135 141 158 163... That's when you run into problems, and why it's good to keep the folder packed when you can. Simply run "folder -pack +folder". If you're refiling a lot of messages in a large folder, you might not be able to use sequences. Use backquotes to give the message numbers directly to "refile". For example: refile +tex/info-tex `pick -to info-tex` That can still generate a long list of arguments to the "refile" command, and some Unixes can't handle that. In that case, use xargs(1): pick -to info-tex | xargs refile +tex/info-tex If worse comes to worst, fire up a Bourne shell and use a "while" loop: pick -to info-tex | fmt | while read nums; do refile +tex/info-tex $nums done The fmt(1) command breaks long lines into manageable chunks of 72 characters or so, splitting arguments at whitespace. When you redirect the input of a while loop, a "read" command will read the incoming text and store it in a shell variable line by line. This is a quick-&-dirty way to write xargs(1) if you don't have it. ------------------------------ Subject: 04.04 How can you save News articles into an MH folder? From: Jerry Peek Date: Mon, 1 May 1995 00:00:00 -0800 If your newsreader handles backquotes on its command line, you can use the mhpath command. For instance, if your "save" command is "s": s `mhpath new +somefolder` Or if your newsreader lets you define your own commands, as in shell aliases, you could define that as a command. If your newsreader can pipe an article to the standard input of a program, use the "rcvstore" command (in the MH library). For instance, if your "pipe" command is "|": | $MHLIB/rcvstore +somefolder Of course, you can also put that in a little shell script. ------------------------------ Subject: !04.05 Are there any good tools to archive MH messages? From: Bill Wohler Date: Sun, 23 Sep 2007 18:35:53 -0700 For those of lesser means, I have three shell scripts for archiving, seeking, and extracting MH messages that I had been using for a couple of decades. Send mail if interested. However, now that disk space is cheap and one can index years worth of mail in a minute or two, I haven't run those scripts in a few years. I intend to update them to index and archive a years-worth of mail at some point. Since glimpse is no longer free (as in speech), I've switched to swish++. Other indexing tools (which are also compatible with MH-E) include mairix and namazu. From: glimpse at cs.arizona.edu Date: Sun, 4 Mar 2001 10:26:24 -0800 Glimpse is a very powerful indexing and query system that allows you to search through all your files very quickly. It can be used by individuals for their personal file systems as well as by organizations for large data collections. http://www.webglimpse.org/ ------------------------------ Subject: 04.06 How can I remove duplicate messages? From: Bill Wohler Date: Sun, 17 Oct 2004 13:04:57 -0700 Don't let them get in there in the first place. Add the following to your .promailrc: :0 * ? formail -D 16384 $PM_CACHE/msgid /dev/null If it's too late, you might be interested in mhfinddup, attached below, which is an embellishment of the Perl script in (see "Removing duplicate messages (Perl)"). From: Jerry Peek Date: 20 Nov 1995 18:51:24 GMT The easiest way I know of is to sort the folder by the Message-ID field using the sortm(1) command. After the sort, each message should be next to its duplicates in the folder. Use a script (shell, Perl, etc.) to weed out the duplicates. (See "Removing duplicate messages (Bourne)"). The Perl script in (see "Removing duplicate messages (Perl)") does not require that you first sort the folder. ------------------------------ Subject: 04.07 How can I remove holes in numbering? From: Bill Wohler folder -pack ------------------------------ Subject: 05.00 ***** Composing & Replying ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 05.01 Why does repl add a "Re:" to a message that already has one? From: Larry McVoy Date: Fri, 1 Mar 1991 13:03:15 -0800 I carefully reconfigured and rebuilt MH from scratch and the problem went away. ------------------------------ Subject: 05.02 How do I include messages in repl with or without ">"? From: Richard Coleman Date: Tue, 20 Jan 1998 02:19:58 -0500 In nmh, to include a message in a reply with a leading ">", just use "repl -format". From: Alan Thew , Mike Schwager , James T Perkins Date: Fri, 1 Jan 1993 00:00:00 -0800 When making a reply, specify a filter file on the command line: repl -filter repl.format This filter file must be in your MH mail directory (usually "Mail", in your home directory). Here are a couple of example repl.format files: overflowtext="",overflowoffset=0 message-id:nocomponent,formatfield=\ "In message %{text}, you wrote:" body:component="> ",overflowtext="> ",overflowoffset=0 or overflowtext="",overflowoffset=0 date:component="Your message dated",formatfield=\ "%<(nodate{text})%{text}%|%(pretty{text})%>" body:component="> ",overflowtext="> ",overflowoffset=0 Setting overflowoffset to 0 keeps MH from doing anything to extra-long lines in the headers. In the body, however, this behavior is overridden so that long lines are automatically broken and a ">" is inserted before every line. You could put almost whatever you want between those quotes, although the "standard" ">" makes it easier to read notes that have been included several times. The examples differ with the descriptive text that is inserted before the included body. It is suggested not to use the "prompter" editor in this case, since it is likely that you'll not want to use all of the included message. Indeed, it is proper etiquette to edit out all unnecessary include verbiage so readers don't have to wade through the morass to read your pearls of wisdom. WARNING: the '>' appears on the first line ONLY in versions prior to 6.7.2. Upgrade to MH 6.8. See also MH book sections 7.8.4 (6.7.4), 7.8.5 (6.7.5), 10.4.1 (9.4.1), or the URLs: http://rand-mh.sourceforge.net/book/mh/reprep-2.html#ReaEdi http://rand-mh.sourceforge.net/book/mh/reprep-2.html#Inc http://rand-mh.sourceforge.net/book/mh/verrep.html#IncRep ------------------------------ Subject: 05.03 How can I eliminate duplicate copies of letters to myself? From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 Add these two lines to your MH profile file: Alternate-Mailboxes: user@host1, user@host2, ... repl: -nocc me The Alternate-Mailboxes also tells scan which messages are really from you so that it can place the recipient in the scan line instead of the sender. From: Jerry Peek Date: Fri, 1 Mar 1991 13:03:15 -0800 To get one copy, you can either: - Take out the "-nocc me"... then you'll get exactly one copy of your replies (assuming all your addresses are listed in Alternate-Mailboxes), or - (See also "How can I save a copy of all messages I send?"). For more info, see the man pages comp(1), repl(1), forw(1), dist(1) and mh-mail(5). See also MH book sections 7.8.2 (6.7.2), 9.8 (8.6), or the URLs: http://rand-mh.sourceforge.net/book/mh/reprep-2.html#Sel http://rand-mh.sourceforge.net/book/mh/defmai.html From: Alec Wolman Date: Fri, 1 Mar 1991 13:03:15 -0800 Listing the name of a mailing list in Alternate-Mailboxes is also a convenient way to AVOID automatically cc-ing a mailing list when replying to a person who sent the message to the mailing-list. From: Andre Srinivasan Date: Fri, 24 Jan 1997 09:33:19 -0800 Rather than specify the hostname as part of the mailbox, you can simply specify the username and it will match on any host: Alternate-Mailboxes: asriniva ------------------------------ Subject: 05.04 How can I include my signature? From: Eric W. Ziegast , Hardy Mayer Date: Tue, 1 Nov 1994 00:00:00 -0800 There are several ways. 1) The MH way. 1a) In your Mail directory, create files that include your signature into the format of the message. ~/Mail/components: To: cc: Subject: -------- -- Eric Ziegast ziegast at uunet.uu.net UUNET Technologies uunet!ziegast ~/Mail/replfmt body:component="> ",compwidth=2 :-- :Eric Ziegast ziegast at uunet.uu.net :UUNET Technologies uunet!ziegast To use the replfmt file, add the following to your ~/.mh_profile: repl: -filter replfmt When comp is used, your signature is already there along with my headers. When repl is used, the mhl program takes the body of the letter you're replying to, prepends '> ' to each line and then adds your signature at the end (available after version 6.7). 1b) Create an "editor" which can be called from whatnow to add the signature when desired or create a frontend to post (use the .mh_profile line "postproc: postproc" to call it) that always appends the .signature file before calling post to mail the message. David J. Fiander , David A. Truesdell and Tom Wilmore have sample scripts to do these. From: Jerry Peek Date: Tue, 1 Sep 1992 00:00:00 -0800 1c) mysend, a sendproc script, processes a message after "What now? send". See "What references exist for MH" to see where the MH book scripts can be ftped from. The script is explained in MH book Section 7.1.4 (13.13), or the URL: http://rand-mh.sourceforge.net/book/mh/senove.html#ASAtDm 2) Using your editor. If you use vi, you can use something like: map S :r ~/.signature to load your signature out of .signature every time you hit 'S'. 3) Use your windowing system. xterm, for example, can provide key and button mappings for the utterly lazy. 4) If you use Emacs with MH-E: 4a) C-c C-s will append the signature. From: Andre Srinivasan Date: Mon, 1 May 1995 00:00:00 -0800 4b) Add the following to your .emacs file: (add-hook 'mh-compose-letter-function (function (lambda(a b c) (save-excursion (goto-char (point-max)) (beginning-of-line) (mh-insert-signature))))) This hook is called after the draft buffer has been initialized, but before you have a chance to type anything. From: Tom Christiansen Date: Tue, 1 Nov 1994 00:00:00 -0800 Tired of the same old signature? Want different signatures for different newsgroups? Here's a program to help you out. The way it works is to have .signature be a named pipe, so if you don't have named pipes, just say 'n'. The sigrand program then feeds stuff down the pipe every time someone wants to read it. That way it works for more than just news, but for anything that wants to read your .signature, like a mailer. You have your choice of three kinds of signatures: 1) random (short) fortune from "fortune -s"; you get these if you don't have a global sig file. 2) random fortune from ~/News/SIGNATURES [global sig file] 3) random fortune form ~/News/(newsgroup)/SIGNATURES [local sig files] Send mail if interested. Date: Tue, 1 Nov 1994 00:00:00 -0800 See also the Signature FAQ (see "What references exist for MH?"). ------------------------------ Subject: 05.05 How do I call my editor with arguments? From: John Romine Date: Mon, 1 May 1995 00:00:00 -0800 Set your editor (in .mh_profile) to the following shellscript. #/bin/sh "$@" exit 0 From: Ray Nickson Date: Fri, 1 Mar 1991 13:03:15 -0800 You might find it useful to make $EDITOR, or to use different arguments depending on your EDITOR environment variable. ------------------------------ Subject: 05.06 How can I digestify messages in a folder for mail to another user? From: Jerry Peek , Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 How about: forw [-digest tmp] [-form forwcomps] [-filter mhl.digest] messages +folder These messages can be un-digestified :-) by the MH burst(1) program. See also MH book sections 7.9.7 (6.8.7), 8.10 (7.9), or the URLs: http://rand-mh.sourceforge.net/book/mh/forfor-2.html#CreDig http://rand-mh.sourceforge.net/book/mh/burdig.html From: Glenn Vanderburg Date: Tue, 1 Nov 1994 00:00:00 -0800 There's another way, which is better if the recipient understands MIME. forw -mime messages +folder (Make sure that you either have "automhnproc: mhn" in your mh profile, or type "edit mhn" to whatnow before you send it.) This bundles each message in a MIME message/rfc822 part, and then bundles the whole mess up in a multipart/digest part. You can still add your own text at the beginning. The MH burst program can also understand these messages and split them apart with no problem. This works beautifully with MIME-capable mail readers, especially exmh. ------------------------------ Subject: 05.07 How can I change my return address? From: Bill Wohler Date: Tue, 1 Dec 1992 00:00:00 -0800 If you find that your mailer creates a From header that others have trouble replying to, you can add a Reply-To header to override the From header in replies. Copy the components and replcomps files which are normally found in $MHLIB into your Mail directory and add a line like the following after the Subject header replacing my address with your address: Reply-To: jack@newt.com ------------------------------ Subject: 05.08 How can I change my From header? From: Bill Wohler Date: Mon, 27 Nov 1995 11:40:50 -0800 With either of the following solutions, you'll need to add an Alternate-Mailboxes entry in your MH profile so that scan prints "To: recipient" rather than your faked address. For example, if your real address is user@somedomain.com and you've added a From field of: From: Joe Bob you'll add the following to .mh_profile: Alternate-Mailboxes: joe.bob@somedomain.com From: Bill Wisner Date: Tue, 1 Dec 1992 00:00:00 -0800 If you're just interested in changing the hostname, add a line to $MHLIB/mts.conf (mtstailor): localname: desired_host_name From: Jerry Peek Date: Tue, 1 Dec 1992 00:00:00 -0800 Just put a "From:" header in your "components", "replcomps" and "forwcomps" files. MH will add a "Sender:" header with what it thinks is your real address. ------------------------------ Subject: 05.09 How can I save a copy of all messages I send? From: Ping Huang Date: Mon, 18 Dec 1995 17:51:33 -0800 I suggest the use of the Dcc: field (See "What is the Dcc header?"), since the use of "Dcc:" solves the issue of having the same Message-Id. The warning about using Dcc: in general contexts doesn't apply to self-blind-carbon copies, and if "Dcc:" is used and you are automatically sorting messages into folders based on mailing lists, messages which you send will get refiled in the same way. Some may prefer all outgoing messages to be segregated; others (including myself) prefer not to segregate outgoing messages. From: Bill Wohler , Jerry Peek Date: Mon, 1 Aug 1994 00:00:00 -0800 Copy the components and replcomps files which are normally found in $MHLIB into your Mail directory and add a line like the following after the cc header: Fcc: +out All outgoing messages will then be saved in the +out folder. If you make a distcomps file, it needs "Resent-Fcc:". From: Jeppe Sigbrandt Date: Sat, 5 Apr 1997 02:04:53 +0100 You can also use @ in the Fcc field to file the outgoing message in the current folder. Fcc: @ This is useful if you filter your mail (e.g., with procmail) and you read your mail in folders other than +inbox. From: David S. Goldberg Date: 30 Oct 1995 10:23:55 -0500 You can get the Message-ID field by placing the folder in the "Fcc" field and adding: send: -msgid to your .mh_profile. Unfortunately, this Message-ID isn't as useful as sendmail's--it doesn't include the date. ------------------------------ Subject: 05.10 Can the folder in Fcc: be dynamically specified? From: Andy Rabagliati Date: Mon, 1 Aug 1994 00:00:00 -0800 My suggestion would be to run Tom Christiansen's rfi script. If you cannot find it on *.sources archive sites (please try first), I can mail it to you. One good idea would be to write a whatnowproc that files the mail based on a procmail or deliver file. Then you can use the same file for incoming and outgoing mail. ------------------------------ Subject: 05.11 Can I post secure/encryped mail? From: Bill Wohler Date: Thu, 19 May 2005 18:06:39 -0700 MH-E 7.0 supports GPG out of the box. From: Bill Wohler Date: Mon, 5 Mar 2001 05:30:43 -0800 PGP keys can be obtained via mail from , and via the Web at http://www.pgp.net/pgpnet/pks-commands.html. Many PGP front-ends (e.g., mailcrypt) automatically obtain keys for you. See http://www.pgp.net/ for more info. From: Vivek Khera Date: 19 Jun 1995 22:06:37 GMT A much more robust Perl script I wrote is appended below. [Send a note to Vivek for the script. --Ed] It works its way through aliases, and avoids problems with full names in the headers. Here is my mhn profile entry to display the messages. mhshow-show-application/x-pgp: %l pgp -m '%F' # nmh mhn-show-application/x-pgp: %l pgp -m '%F' # MH to use the script, after you edit the message, at the What now? prompt, type "edit pgpmail" for plain ascii encryption or "pgpmail -m" for a MIME formatted encryption. If you want to add a digital signature, give the script the -s flag also. From: Jeffrey C. Ollie Date: Mon, 1 May 1995 00:00:00 -0800 TIS has a free, draft-standard compliant public key system that works with MH (PEM). Check it out on ftp.tis.com. From: Kimmo Suominen Date: Mon, 1 May 1995 00:00:00 -0800 You could try looking at the URL http://www.tac.nyc.ny.us/ and following the link from the cover page. Everything you need for PGP to work with MH is there (scripts and mhn entries). From: mathew at mantis.co.uk Date: Mon, 1 May 1995 00:00:00 -0800 Excellent stuff. I've tried altering it to conform to draft-borenstein-pgp-mime-00.txt. Unfortunately, I can't get mhn to tag PGP-armoured text as application/pgp; format=text without it insisting on base64 encoding it. So I can't quite manage to implement the standard. *sigh* Presumably mhn thinks that anything which isn't text/* must be encoded. From: John R MacMillan Date: Wed, 16 Apr 1997 00:06:59 -0700 Premail, in conjunction with MH, can display and compose security multiparts (e.g., multipart/signed and multipart/encrypted PGP mail, non-MIME PGP, and some S/MIME). Check out http://www.c2.org/~raph/premail/ for details. ------------------------------ Subject: 05.12 How can I send multi-media (MIME) attachments? From: Brian Exelbierd Date: Mon, 09 Oct 1995 08:05:55 -0400 The short guide: 1. Compose a letter using comp. 2. When you get to a point where you want to include a MIME attachment, type the following to include a GIF image (note: the '#' must be in the first column): #image/gif [Pictures at an Exhibition] /usr/lib/pictures/exhibition.gif 3. Finish your letter, adding more text or attachments as needed. 4. Save your letter and exit the editor. At the Whatnow prompt type "edit mhn". mhn will automatically format your letter with the MIME attachments leaving the original letter in ,##,orig where ## is the letter number. 5. Type "send" at the Whatnow prompt, and poof, you have just sent MIME mail. I strongly recommend you practice sending yourself MIME mail first. For more information, see the mhn(1) man page, ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types for a list of allowed media types in addition to image/gif, and Chapter 3 in the MH book or the URL: http://rand-mh.sourceforge.net/book/overall/tocs/intmime.html ------------------------------ Subject: 05.13 What's the best way to send mail to a long list of people? From: Bill Wohler Date: Thu, 12 Oct 1995 07:53:53 -0700 There are three ways to keep the list of members from appearing in everyone's header. If you're planning on mailing to these people regularly, the best way is to create an alias in /etc/aliases (/usr/lib/aliases). That way, recipients can send and reply to the list as well. The other two ways allow you to manage the list privately, but the recipients cannot send to the list (unless you set something up with your deliver or procmail script). One is with a group list. It looks like this: To: All-members: member1, member2, member3, ..., membern; The recipients see this: To: All-members:; You can make this an MH alias as well. The second way is to use a blind carbon copy (see "How do I send blind carbon copies?"). Or you could also use the undocumented Dcc field which is used like the Bcc field, but doesn't inject the "Blind-Carbon-Copy." Warning: (See "What is the Dcc header?") ------------------------------ Subject: 05.14 What is the Dcc header? From: jpeek at jpeek.com (Jerry Peek) Date: 14 Sep 96 05:51:13 GMT If you put the alias in the Dcc field and leave the To: field empty, there's a good chance that the recipients will get a message with the header field: Apparently-to: and it might even list several addresses. To avoid that, use a To: field with some address (like yours) in it. I use a comment that tells people what's really happening--like this, more or less: To: "Faculty members, c/o" dcc: faculty There are some other choices, like using an un-replyable group list in the To: field, but I think they tend to confuse non-techies. Date: Wed, 27 Sep 1995 09:46:37 -0700 From: John Romine The Dcc (Distribution Carbon Copy) field behaves much like the Bcc field, but does not add the "Blind-Carbon-Copy" notice. This header is removed before posting the message,and a copy of the message is distributed to each listed address. This could be considered a form of Blind Carbon Copy which is best used for sending to an address which would never reply (such as an auto-archiver). People should not be using Dcc as a substitute-Bcc to send to other people. When users use Dcc as a substitute for Bcc, there is *no* indication to the "blind" recipients that they have received a blind copy. If those recipients should reply (and they have no indication why they shouldn't), the original author could be very embarassed (or worse). ------------------------------ Subject: 05.15 How can I make sense of the replcomps file? From: Bill Wohler Date: Thu, 9 Mar 2006 19:27:14 -0800 The best thing to do is curl up with the mh-format(5) man page, or Section 11.2 of the MH book, or the URL: http://rand-mh.sourceforge.net/book/mh/mhstr.html These will explain the default replcomps file, included here. Don't start with the first four lines--the latter group of lines are much easier to understand. %; $Header$ %; %; These next lines slurp in lots of addresses for To: and cc:. %; Use with repl -query or else you may get flooded with addresses! %; %; If no To:/cc:/Fcc: text, we output empty fields for prompter to fill in. %; %(lit)%(formataddr{reply-to})\ %(formataddr %<{from}%(void{from})%|%(void{apparently-from})%>)\ %(formataddr{resent-to})\ %(formataddr{prev-resent-to})\ %(formataddr{x-to})\ %(formataddr{apparently-to})\ %(void(width))%(putaddr To: ) %(lit)%(formataddr{to})\ %(formataddr{cc})\ %(formataddr{x-cc})\ %(formataddr{resent-cc})\ %(formataddr{prev-resent-cc})\ %(formataddr(me))\ %(void(width))%(putaddr cc: ) Fcc: %<{fcc}%{fcc}%|+outbox%> Subject: %<{subject}Re: %{subject}%> %; %; Make References: and In-reply-to: fields for threading. %; Use (void), (trim) and (putstr) to eat trailing whitespace. %; %<{message-id}In-reply-to: %{message-id}\n%>\ %<{message-id}References: \ %<{references}%(void{references})%(trim)%(putstr) %>\ %(void{message-id})%(trim)%(putstr)\n%>\ Comments: In-reply-to \ %<{from}%(void{from})%?(void{apparently-from})%|%(void{sender})%>\ %(trim)%(putstr)\n\ message dated "%<(nodate{date})%{date}%|%(tws{date})%>." -------- In particular, note the following: \ consider the following line to be part of the current line. If this continuation character is absent, a newline (\n) will always be inserted. Note that if the field is conditional, and the condition is false, and there isn't a trailing backslash, then a blank line will appear in your reply. Since the rest of the header will now be considered to be part of the body, this is probably not what you want. \n inject an actual newline into the reply. Note that inserting a field without a trailing backslash (\) will cause that field to be emitted in the reply as well. %<{field}, %?{field}, %|, %> if field exists, else if field exists, else, endif. Conditional fields nearly always contain an explicit newline (\n) and end with a continuation character (\). %(command) mh-format commands %{field} value of the header field inserted at this point To add new fields, you can either add fields based on whether certain fields exist in the original message (e.g., %<{message-id}...), or hard-code them, as in the Fcc, Subject, or Comments fields above. ------------------------------ Subject: 05.16 How can I convert quoted-printable to 8bit in quoted text in replies? From: Jarle F. Greipsland Date: 22 Aug 1995 10:42:07 +0200 The idea behind the solution is that I need mhn to store the contents of the mail in the native iso8859-1 format somewhere. I did this by creating a custom editor that is invoked when I reply to a message. This editor extracts the body of the message (sorry, no multipart stuff), indents it with '> ', appends it to the draft message and invokes the ordinary editor on it. Here are the details: `isorepl' is a symbolic link from my $HOME/bin-directory to `repl'. In my .mh_profile I added the following two lines: isorepl: -form isoreplcomps -editor isoextract isoextract-next: vi The isoreplcomps file in my Mail-directory contains: %(lit)%(formataddr %<{reply-to}%?{from}%?{sender}%?{return-path}%>)\ %<(nonnull)%(void(width))%(putaddr To: )\n%>\ %(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\ %<(nonnull)%(void(width))%(putaddr cc: )\n%>\ %<{fcc}Fcc: %{fcc}\n%>\ %<{subject}Subject: Re: %{subject}\n%>\ %<{date}In-reply-to: Your message of "\ %<(nodate{date})%{date}%|%(pretty{date})%>."%<{message-id} %{message-id}%>\n%>\ -------- #\ %<{from}%(friendly{from}) writes%|You write%>: This is a "Usenet-like" quoting style. Modify to suit your own taste. This form will setup the proper header, as well as the first line of the new message (In nnnn writes etc.). The first editor, `isoextract', looks like this: #!/bin/sh # # Called from within repl where the "editalt" variable is valid # # Point to a special MHN configuration file (save old one) OLDMHN="$MHN" MHN=$HOME/`mhparam Path`/isoquotemsg export MHN # Extract message body to "native" format (should be iso-8859-1) # > More bla bla. mhn -file "$editalt" -store >> $1 2>/dev/null MHN="$OLDMHN" myname=`basename $0` next=`mhparam ${myname}-next` if [ "x$next" != "x" ]; then exec $next "$@" fi `isoquotemsg' has just one rule; how mhn should store a text message. mhn-store-text: |sed -e 's/^[ ]*$//' \ -e 's/^\([>|]\)\(.*\)$/>\1\2/' \ -e 's/^\([^>|].*\)$/> \1/' This tells mhn to pipe the message to stdout, where the sed commands will do the reformatting/quoting. (Note: the first pair of square brackets contains a space and a tab.) So, when I do a `isorepl' to a message, `repl' will create the draft message with the proper headers (based on the `isoreplcomps' format file), fire off its first editor, `isoextract', with the name of the draft file as its parameter. `isoextract' then invokes mhn in a suitable environment, tells it that it is to use the file $editalt as its source, and orders it to store the contents. The store-text rule in the custom MHN-file tells it to just pipe the message (in native iso8859-1 form) through a small set of sed commands, and `isoextract' uses the normal shell construct to append the result to the draft file. Then, if there's defined a `isoextract-next' entry in the .mh_profile, isoextract exec's this editor. ------------------------------ Subject: 05.17 Can I have aliases include aliases? From: Bruce Cox Date: Fri, 16 Aug 1996 14:26:12 +1000 Indeed, you can. You just need to remember the way MH expands aliases. In particular, the right hand sides are only expanded by the aliases below them in your aliases file. So, if you put in: dead-men: presidents, authors presidents: washington, lincoln, jefferson, roosevelt authors: thoreau, irving, london and type: ali dead-men then you would get the response: washington, lincoln, jefferson, roosevelt, thoreau, irving, london If you had the dead-men line after the presidents and authors aliases, the response would be: presidents, authors ------------------------------ Subject: 05.18 Why doesn't mhmail understand aliases? From: "John L. Romine" Date: 25 Apr 1996 16:34:10 GMT One way that mhmail might be run is from a shell script. This means that the user running it might not use MH, and would not have a .mh_profile, etc. If you want to use aliases with mhmail, expand them before passing them as arguments (e.g., "mhmail `ali joe`"). ------------------------------ Subject: 05.19 How do I send blind carbon copies? From: Bill Wohler Date: Mon, 9 Sep 1996 00:32:14 -0700 Use the Bcc header field: To: your-address-here Bcc: member1, member2, member3, ..., membern The recipients see this: To: your-address-here ------- Blind-Carbon-Copy Content of message, with headers If you don't want the "Blind-Carbon-Copy" message, use the Dcc field, but this is discouraged in true blind carbon copies since the warning may prevent the recipient from embarrassing someone inadvertently. Read the warning in (see "What is the Dcc header?"). ------------------------------ Subject: 05.20 When I forward a message, can I use its Subject? From: Jerry Peek Date: Sun, 17 Nov 1996 20:16:31 -0800 Obtain forwedit. http://rand-mh.sourceforge.net/book/examples/mh/bin/forwedit ------------------------------ Subject: 05.21 Why is the timezone field in my 'Date:' field wrong? From: Alex Tomlinson Date: Wed, 11 Jun 1997 09:16:41 -0500 If the date field in your mail header looks like this: Date: Tue, 10 Jun 1997 15:59:03 +2228904 remove -lbsd from your MH configuration, add "curses -lcurses", and rebuild. ------------------------------ Subject: 05.22 Can I automate the comp -editor mhn process? From: Soren Dayton Date: Tue, 21 Jan 1997 17:23:32 GMT Add automhnproc: mhn to your MH profile. ------------------------------ Subject: 05.23 How can I remove those "=20" characters when forwarding? From: Dave Marquardt Date: 12 Oct 2000 10:27:38 -0500 Use `forw -mime'. ------------------------------ Subject: 05.24 Can I use mh-format substitution with forw? From: Dave Marquardt Date: Tue, 3 Aug 1999 13:28:30 -0500 (EST) The answer is no, and the real question is why not? ------------------------------ Subject: 05.25 How can I keep repl from breaking long lines? From: Jerry Peek Date: Fri, 14 May 1999 11:15:07 -0400 Try adding width=10000 (or so) to your replcomps. It should work unless you have messages with lines longer than that... ------------------------------ Subject: 05.26 How do I fix a bogus In-Reply-To or missing References field? From: Bill Wohler Date: Thu, 9 Mar 2006 21:42:21 -0800 In the past, the In-reply-to header field looked as it does in the new Comments field (see "How can I make sense of the replcomps file?"). However, the old format is no longer allowable under RFC 2822 which specifies that this field should only include the Message-ID. You can fix the replcomps and replgroupcomps files by upgrading to nmh 1.1 (be sure to update your personal copies if applicable) or simply by fixing the In-reply-to field in your own replcomps file using the example in the question referenced in this paragraph. In addition, older replcomps files lacked the References field which enables threading in capable UIs. You can get it in the same fashion as the In-reply-to field--by upgrading or copying. ------------------------------ Subject: 06.00 ***** Posting ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 06.01 What to do with "Problems with edit - draft removed". From: John Romine Date: Mon, 1 May 1995 00:00:00 -0800 If your users are using an AT&T version of "vi", it's exiting with non-zero status (supposedly a count of the "errors" during the edit). Move "vi" to "broken_vi" and put it its place : #! /bin/sh /usr/ucb/broken_vi "$@" exit 0 Alternatively, compile MH with the ATTVIBUG option. Then complain to your vendor that "vi" is broken, and they shouldfix it. ------------------------------ Subject: 06.02 Can I run my message through a program (e.g., ispell) before sending? From: Jerry Peek Date: Fri, 1 Mar 1991 13:03:15 -0800 It's pretty simple. If your speller is called myspell, use: What now? edit myspell MH will actually execute: myspell /your-mail-draft-directory/draftfile and give the entire draft message to your speller. The header will probably be "misspelled," of course, though you might be able to tell the speller to ignore it--or you could hack up a little shell script to run the speller on just the message body, then tack the corrected body back onto the header before sending. You can automate this some more. For example, if you want your speller to run after your first edit with "prompter" and also after you leave the "vi" editor, add these lines to your MH profile: prompter-next: myspell vi-next: myspell Then, at the "What now?" prompt: What now? e your speller will run. For more info, see the mh-profile(5) man page or section 7.2.1 (6.2.1) of the MH book, or the URL: http://rand-mh.sourceforge.net/book/mh/chaedi.html#Edi ------------------------------ Subject: 06.03 What to do with "bad address 'xxx' - no at-sign after local-part". From: Owen Rees Date: Fri, 1 Jan 1993 00:00:00 -0800 You may find that post returns the following message: post: bad address 'Mr. Foo Bar ' - no at-sign after local-part (Bar), continuing... The unquoted dot causes "Mr. Foo" to be parsed as the local part of the address. Either remove the dot, or rewrite the address as follows: "Mr. Foo Bar" (Mr. Foo Bar) (Mr. Foo Bar) fb@somewhere.edu ------------------------------ Subject: 06.04 Fixing "post: problem initializing server; [BHST] no servers available" From: Peter Marvit , Eric Bracken Date: Tue, 1 Nov 1994 00:00:00 -0800 The error message itself is essentially correct. However, what this really means is: MH's post cannot connect to a running sendmail over an SMTP port (MH configured with SMTP and SENDMTS). The potential problems: 1. Your local sendmail daemon is dying or not running for some reason. 2. You use BIND and your local nameserver is not responding. Solution: Delete "/etc/resolv.conf." 3. Your $MHLIB/mts.conf (mtstailor) has its "servers:" pointing to a non-existent machine or a machine which is a) not reachable or b) not running the sendmail daemon. From: Bdale Garbee , Eric Bracken Date: Sun, 1 May 1994 00:00:00 -0800 4. The hostname localhost [127.0.0.1] is missing from /etc/hosts. Solution: add an entry for "localhost" to /etc/hosts or your DNS database or add the following to $MHLIB/mts.conf (mtstailor): servers: 127.0.0.1 \01localnet From: Larry Daffner Date: 3 Mar 1996 14:39:54 -0600 5. Your load average is so high that sendmail is refusing connections. Solution: Change your configuration from "mta: sendmail/smtp" to "mta: sendmail" so that a sendmail processes is spawned to deliver the message. This is a double-edged sword since the extra process only makes the load worse. From: Corbin Covault Date: Sun, 02 Sep 2001 02:13:42 -0400 6. Sendmail may not be located on the path that MH expects. Solution: Try specifying the path explicitly by adding a line to mts.conf thus: sendmail: /usr/sbin/sendmail or wherever your sendmail daemon executable lives. From: Neil W Rickert Date: 13 Apr 2001 18:47:43 -0500 7. You don't want to use an available server. Solution: Try postproc: /usr/local/lib/mh/spost in your MH profile (but check the path first). That should use command line sendmail. ------------------------------ Subject: 06.05 Fixing "post: problem initializing server; [RPLY] 503 Sender already specified" From: Paul Pomes Date: Mon, 1 Mar 1993 00:00:00 -0800 The problem in sendmail is that the RSET after the ONEX does not reset all the state information. Normally sendmail fork()s after the Mail from: statement and a RSET causes that child to exit. This automatically cleans up. If the fork() is suppressed by ONEX, then the source must be modified to do the cleanup. See "srvrsmtp.c patch" in the Appendix. If you don't have the sources, modify your MH sources to not use the ONEX verb. ------------------------------ Subject: 06.06 Fixing "post: unexpected response; [BHST] no socket opened" From: Steve Lembark , Bill Wohler Date: Mon, 1 Aug 1994 00:00:00 -0800 This problem happens when there is no interface defined within the tcp system. A couple of workarounds include: o Use a hostname (other than the local host) instead of localhost in the "servers" entry of the $MHLIB/mts.conf (mtstailor) file. o Recompile MH with sendmail instead of sendmail/smtp (not very elegant). A better fix would be to define your tcp interface. Here, you run ifconfig and route (as root) to define the loopback device and route. You should add them to rc.local so they are effected at every boot. # ifconfig lo 127.0.0.1 # Linux # ifconfig lo0 127.0.0.1 # Sun # route 127.0.0.1 If all is well, "ifconfig lo" (or lo0), will show something like this (on my Linux system): lo Link encap Local Loopback inet addr 127.0.0.1 Bcast 127.255.255.255 Mask 255.0.0.0 UP LOOPBACK RUNNING MTU 2000 Metric 0 RX packets 0 errors 0 dropped 0 overrun 0 TX packets 519 errors 0 dropped 0 overrun 0 and "netstat -r" will show: # netstat -r Destination net/address Gateway address Flags RefCnt Use Iface 127.0.0.0 * UN 0 519 lo If you're not on a network and running DNS, your /etc/hosts will need at least: 127.0.0.1 your_host_name localhost # loopback address Note: put your name FIRST on the localhost line. This official name is used by sendmail to determine your return address. If you are on a network and running DNS, you might find that putting your host name in the localhost entry might gum up other things, in which case you'll want your hostname to have its own proper address. This might not do it though. David Youatt says that his network was happy but he still had the problem until he upgraded his system and got the latest revision of sendmail as well. He says: "Turns out that that the problem I was having seems to be caused (at least partly, maybe entirely) by the version of sendmail that is shipped with IRIX 5.2 (sendmail 5.65, I think). The version shipped w/IRIX 5.3 (in beta) is sendmail 8.6.9 and works fine." I'm not entirely happy with this section, so please give me some feedback. If you have this problem, please send me a brief description so I'll know which problems and solutions seem to be the most prevalent. ------------------------------ Subject: 06.07 How do I fix the "X-Authentication-Warning" header? From: Bill Wohler Date: Mon, 9 Sep 1996 01:32:15 -0700 (See "Fixing "Sender didn't use the HELO protocol"".) ------------------------------ Subject: 06.08 Fixing "post: unexpected response; [RPLY] 503 Need MAIL before RCPT" From: Bjoern Stabell Date: Mon, 1 May 1995 00:00:00 -0800 I inserted: clientname: localhost in the $MHLIB/mts.conf (mtstailor) file, and that fixed the problem. ------------------------------ Subject: 06.09 Fixing "post: problem initializing server; [BHST] premature end-of-file on socket" From: Ginko Date: Thu, 8 Mar 2001 09:18:14 +0000 (UTC) I have sendmail under control of tcpwrapper started by inetd and didn't want to take it away, the very simple fix to this problem was to allow the localhost on /etc/hosts.allow on the sendmail entry. From: Stefan Huebner Date: Wed, 11 Sep 1996 20:06:49 +0200 Use spost instead of post. To do this: % mv post post.orig % ln -s spost post From: Chuck Mattern Date: Mon, 1 May 1995 00:00:00 -0800 If you are running sendmail instead of smail, make sure that all smtp entries in /etc/inetd.conf are commented out. If you do edit /etc/inetd.conf, don't forget to run to restart inetd with "kill -1 ". ------------------------------ Subject: 06.10 Fixing "Sender didn't use the HELO protocol" From: rickert at cs.niu.edu (Neil Rickert) Date: Tue, 20 Mar 2001 22:01:16 -0800 If you are sharing your $MHLIB/mts.conf (mtstailor) file among several machines, and you are connecting to the local sendmail, then use 'localhost' as the hostname argument to the clientname parameter (described below). Otherwise, place mts.conf somewhere under /etc on each system, and install a symlink to it on the shared file system. From: labrown at dg-rtp.dg.com (Lance A. Brown) Date: 23 Apr 1996 14:43:04 -0400 You can solve this by putting localname: localhostname localdomain: local.domain.name in your $MHLIB/mts.conf (mtstailor) file. This will make MH send a HELO string in the SMTP transaction. From: Terry Manderson Date: Mon, 1 May 1995 00:00:00 -0800 Add clientname sender to $MHLIB/mts.conf (mtstailor) where sender is the name of the machine sending the message. The error message occurs because newer MTA's require SMTP's "HELO" command which MH omits in some configurations. When you add the above line, it forces MH to use the HELO command. From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 You get a header like: X-Authentication-Warning: screamer.rtp.ericsson.se: Host rcur7.rtp.ericsson.se didn't use HELO protocol Easy possibilities are: apply the patch to MH that comes with Sendmail 8.X.X and makes it use HELO, or comment out the line that says Opauthwarnings in your sendmail.cf. ------------------------------ Subject: 06.11 Fixing "post: problem initializing server; [RPLY] 553 Local configuration error, hostname not recognized as local" From: "Matthew V. J. Whalen" Date: Mon, 1 May 1995 00:00:00 -0800 Change your "mts" in "conf/MH" from "sendmail/smtp" to just "sendmail." From: Bill Wohler Date: Mon, 1 May 1995 00:00:00 -0800 The solution above will keep MH from using any SMTP server on your network. require sendmail to be installed on all machines. You could take advantage of the "sendmail/smtp" option to have MH talk to a non-local sendmail. In $MHLIB/mts.conf (mtstailor) add: servers It may also be caused by old versions of sendmail. ------------------------------ Subject: 07.00 ***** Mail Filters ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 07.01 What mail filters are available? From: Bill Wohler Date: Sun, 11 Mar 2001 10:27:24 -0800 The list currently includes slocal (included with MH), deliver, procmail and mailagent. They are briefly described here. Slocal is probably the most popular by virtue of being included in the distribution. The next most popular entry is procmail, followed by deliver. Slocal comes with MH. It can be used to process incoming mail based on the contents of any of the headers. Actions include filing messages, running commands, printing messages on your terminal and so on. The configuration is made in ~/.maildelivery. People seem to have trouble with slocal bugs, and you can't use it if you don't have write permission on your system maildrop so a lot of people have opted for the alternatives, but it's easy to use and comes with MH. procmail is quite popular and has a very powerful configuration file. However, the syntax is its own, but it is easy to learn given a couple of good examples. Its advantages are its small size and speed. Like deliver, procmail may be installed as a delivery agent so you would not even have to have a .forward file. Deliver can run any script or program (called ~/.deliver), so you really can do anything you want to incoming mail. One feature that it sports that no other does is that you can install it as a local mailer in place of /bin/mail. If it's the local mailer, you don't need to have a .forward--~/.deliver is run anyway. In addition, it allows the system administrator to write some programs to filter everybody's mail. It came with my Linux system, so installation was non-existent. I started with slocal, and then moved to deliver. I switched to procmail because of a bug in deliver (which I think has since been fixed) whereby a blank line would be inserted into the header before header fields with numbers in them. I am still using procmail and probably will do so indefinitely since it is powerful, there are many spam filters written in it, and it coexists with MH and Gnus so well. My recommendation is to use the one that is installed on your system or get procmail. Here are the URLs for the filters mentioned in this document: http://www.procmail.org/ From: "Eric D. Friedman" Date: 28 Aug 1996 08:28:46 GMT See http://www.faqs.org/faqs/mail/filtering-faq/index.html. From: Stephen R. van den Berg Date: Mon, 1 Aug 1994 00:00:00 -0800 Procmail can be used to create mail-servers, mailing lists, sort your incoming mail into separate folders/files (real convenient when subscribing to one or more mailing lists or for prioritizing your mail), preprocess your mail, start any programs upon mail arrival (e.g. to generate different chimes on your workstation for different types of mail) or selectively forward certain incoming mail automatically to someone. From: Raphael Manfredi Date: Tue, 28 Jul 1998 13:22:07 +0200 "mailagent" is yet another mail filter, written in perl, which will let you do anything with your mail. It has all the features you may expect from a filter: mailing lists sorting, forwarding to MTA or to inews, pre-processing of message before saving into folder, vacation mode, etc. It was initially written as an Elm-filter replacement, but has now enough power to also supplant MMDF's .maildelivery. There is also a support for @SH mail hooks, which allows you to automatically distribute patches or software via command mails. The mailagent was designed to make mail filtering as easy as it can be. It is highly configurable and fairly complete. Rules are specified in a lex-like style, with the full power of perl's regular expressions. The automaton supports the notion of mode, and header selection has many magic features built-in, to ease the rule writing process. The distribution comes with a set of examples, an exhaustive test suite, and naturally a detailed manual page. It should be noted that the mailagent will work even if your system administrator forbids "| programs" hooks in the ~/.forward, provided you have access to some sort of cron daemon. http://www.cpan.org/authors/Raphael_Manfredi/ ------------------------------ Subject: 07.02 Why slocal writes messages to system mailbox that from(1) can't read. From: Bill Wohler Date: Mon, 1 May 1995 00:00:00 -0800 Upgrade to MH 6.8 and set the RPATHS option. Better yet, use a more MH-like command instead of from: "scan -file $MAIL". ------------------------------ Subject: 07.03 Where can I read about slocal and the format of .maildelivery? From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 See the slocal man page. Here is brief example of a .maildelivery file that stores messages to babble in a folder and the system mailbox, stores mh-users in a folder but not the system mailbox, and puts the rest in the system mailbox. to mh-users | A "$MHLIB/rcvstore -create +lists/mh-users" cc mh-users | A "$MHLIB/rcvstore -create +lists/mh-users" to babble | R "$MHLIB/rcvstore -create +lists/babble" cc babble | R "$MHLIB/rcvstore -create +lists/babble" default - > ? /usr/spool/mail/wohler Your .forward file may look like (quotes necessary): "| $MHLIB/slocal -user your_login" In some implementations, the "-user your_login" is not needed. If not, manually running slocal with the flag will produce an error. See also chapter 12 (11) in the MH book, or the URL: http://rand-mh.sourceforge.net/book/mh/tocs/prmaau.html Alternatives to slocal include deliver, procmail, and mailagent. (See "What mail filters are available?") ------------------------------ Subject: 07.04 How do I debug my .maildelivery file? From: Bill Wohler Date: Mon, 1 Mar 1993 00:00:00 -0800 Use as many of the following as necessary. Put a message into a file and call slocal directly on it. $MHLIB/slocal -user $USER -verbose -debug < test-msg Modify your .forward to look like: "|/bin/sh -c 'exec >> /tmp/out 2>&1; $MHLIB/slocal -user $USER -verbose -debug'" Or modify a rule in .maildelivery to look like this: to foo | R "set -xv; exec >/tmp/out 2>&1; $MHLIB/rcvstore +foo" The previous examples are broken up for readability; the text must appear on one line. See also MH book section 12.11 (11.11), or the URL: http://rand-mh.sourceforge.net/book/mh/debugti.html ------------------------------ Subject: 07.05 Why isn't slocal working? From: Bill Wohler Date: Mon, 1 Mar 1993 00:00:00 -0800 If slocal doesn't appear to be doing anything, run the following $MHLIB/slocal -user your_login -verbose < file where "file" is some message in a mail folder. If you get something like: .maildelivery: ownership/modes bad (0, 154,154,0100666) your .maildelivery is writable by too many people. Make it writable only by you by running "chmod 644 .maildelivery". See also "How do I debug my .maildelivery file?" ------------------------------ Subject: 07.06 Are there any good biff applications for MH? From: Rob Austein Date: Tue, 01 Dec 1998 03:02:34 -0500 I've been been using a program called xlbiff (X Literate Biff) and have been quite happy with it. By default, xlbiff generates its pop-up listings by running scan on your mail drop file, but it's not a big deal to customize xlbiff for more complicated setups if you make heavy use of procmail, multiple mail drops, and so on. From: Richard Coleman Date: 07 Jul 1997 03:31:42 -0400 nmh (new MH) has an additional command (flist) that will tell you which folders have unseen messages. I can't imagine using MH without it. From: crow at tivoli.com (David L. Crow) Date: 7 Jul 97 09:36:32 GMT I have used the following X resource with xbiff before: xbiff*checkCommand: grep -q '^unread' `mhpath +inbox`/.mh_sequences \ && exit 0 || exit 2 This should be all one line, but I split it with a line continuation character for readability. ------------------------------ Subject: 07.07 How do I read new messages filed by procmail? From: Bill Wohler Date: Sun, 17 Oct 2004 15:17:14 -0700 If you use MH-E, use "F n (mh-index-new-messages)" to display unseen messages. From: Neil W Rickert Date: 23 Apr 2002 20:38:57 GMT Here is my "unseen" shell script: #! /bin/sh - case "$1" in "") grep unseen $HOME/Mail/context $HOME/Mail/*/.mh_sequences | sed -e '/\/fromme\//d' \ -e "s=$HOME/Mail/==" \ -e 's=/.mh_sequences:unseen==' ;; "+") shift mark -sequence unseen -add "$@" ;; "-") shift mark -sequence unseen -delete "$@" ;; *) echo "Invalid arguments $*" ;; esac From: Paul Fox Date: Tue, 23 Apr 2002 20:13:42 GMT I have procmail deliver to a set of mbox files and use "inc -f foo" to inc from them. The names of the mbox files are the same as the MH folders which makes it easy to write a script that does something like this: cd Mailboxes for x in *; do inc -f $x +$x done ------------------------------ Subject: 08.00 ***** MH-E ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 08.01 I have a question about MH-E From: Bill Wohler Date: Sat, 3 Mar 2001 13:51:29 -0800 Let me send you over to: http://mh-e.sourceforge.net/ This is the SourceForge MH-E project. It has mailing lists and files to download, and will let you submit patches or support requests. The Support Requests section may already contain an answer to your question. If not, you can post your question: http://sourceforge.net/tracker/?group_id=13357&atid=213357 ------------------------------ Subject: 09.00 ***** Xmh ***** From: Bill Wohler Date: Fri, 1 Mar 1991 13:03:15 -0800 ------------------------------ Subject: 09.01 How can I get xmh to use Emacs as the editor? From: Bob Ellison Date: Fri, 1 Mar 1991 13:03:15 -0800 The modifications to xmh to support an external editor, annotations, and an append command can be found in the these places. ftp://ftp.x.org/R5contrib/xmh-mods-R5-1.7.Z 37k ftp://ftp.sei.cmu.edu/pub/xmh/xmh-mods-R5-1.7.Z 37k ftp://ftp.sei.cmu.edu/pub/xmh/xmh-mods-R6-1.0.Z 37k From: Andrew Wason Date: Fri, 1 Mar 1991 13:03:15 -0800 As of R5, xmh has a new action proc called XmhShellCommand. A string parameter will be executed as a shell command with the currently selected messages as parameters (or the current message if there are no selected messages). Using this new action, a couple of shell scripts, a window version of emacs (e.g. xemacs) and some elisp code, xmh can use emacs as its editor instead of the built in Athena text widget editor. This doesn't require any source code changes to xmh. These are included in the Appendix "Switching xmh's editor". ------------------------------ Subject: 09.02 Does xmh support subfolders? From: Steve Malowany Date: Fri, 1 Mar 1991 13:03:15 -0800 Yes. Create one by invoking "Create Folder" as usual, and enter something like: existing-folder/new-sub-folder. You can then access the subfolder by popping up a menu over the "existing-folder" button item. But: From: John Cooper Date: Fri, 1 Mar 1991 13:03:15 -0800 The R5 version of xmh does *not* handle nested sub-folders. If you create a folder as 'grab/some/bandwidth', xmh displays this folder name for the remainder of the session where it was created, BUT if you later re-run xmh, the folder is no longer visible to xmh. See also MH book section 15.6.2 (15.6.2), or the URL: http://rand-mh.sourceforge.net/book/xmh/orgfol.html#FolaSub ------------------------------ Subject: 09.03 How do I precede included messages with ">" when replying in xmh? From: Len Makin Date: Fri, 1 Mar 1991 13:03:15 -0800 Include the following line in your ~/app-defaults/XMh file: Xmh*replyInsertFilter: "sed 's/^/> /'" or, Xmh.ReplyInsertFilter: $MHLIB/mhl -form repl.filter From: Andy Linton Date: Fri, 1 Mar 1991 13:03:15 -0800 Using this means that you can chose to insert the original by use of the "Insert" button in the Draft message pane. See "How do I include messages in repl with or without ">"?" to find examples of repl.filter. See also MH book sections 15.1.4 (15.1.4), 16.3.3 (16.3.3), or the URLs: http://rand-mh.sourceforge.net/book/xmh/senmai.html#MorRep http://rand-mh.sourceforge.net/book/xmh/resfun.html#Rep ------------------------------ Subject: Glossary From: Bill Wohler Date: Wed, 29 Sep 2004 00:04:34 -0700 MH Mail Handler MHLIB Where MH support routines and files are kept; usually /usr/lib/mh or /usr/local/lib/mh. POP3 Post Office Protocol, RFC 1939 MMDF Multi-channel Memo Distribution Facility MIME Multipurpose Internet Mail Extensions, RFC 1521 IMAP Internet Message Access Protocol, RFC 1064, 1176 TIS Trusted Information Systems PEM Privacy Enhanced Mail PGP Pretty Good Privacy SMTP Simple Mail Transport Protocol (STD 10; RFC 821) ------------------------------ Subject: Acknowledgments From: Bill Wohler Date: Mon, 9 Sep 1996 01:37:27 -0700 I'd like to thank the following people for providing ideas on the layout of this article: Joe Wells Richard M. Stallman David Elliott Tom Christiansen Eugene N. Miya We are also grateful to Kim F. Storm and Edward Vielmetti and the folks mentioned in the text of this document who have provided answers or other information to make this a better document. I regret that it is possible that some names have been accidently omitted. I would also like to thank all the readers of comp.mail.mh. I'd also like to thank John Romine for maintaining MH and the MH Web page, Jerry Peek for writing the MH bible and for all his hard work with the entire MH project, Stephen Gildea for maintaining MH-E in years past and always sending me lots of great comments, Kimmo Suominen for maintaining the MH patch page, and Richard Coleman for taking MH to nmh. ------------------------------ Subject: Switching xmh's editor From: Andrew Wason Date: Fri, 1 Mar 1991 13:03:15 -0800 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'README' <<'END_OF_FILE' XThis is a short description of what to do with each of the enclosed files. X XXmh.ad X Merge this in with your xmh resources. If you already have X user defined buttons, then you may need to renumber the X buttons in this resource file. X Xxmh-command.el X Byte compile this file and put it in your GNU emacs load-path. X Xxmhcommand Xxmhemacs X Put these somewhere in your path. X X XOnce you have installed these, restart the R5 xmh with the new Xresources. When you press the repl, forw or comp buttons Xan xemacs window will come up with your draft message. X XOnce you have written your mail, save it and exit GNU emacs (C-xC-c). XYou will be prompted if you want to send the current message. XIf you enter 'y', the message will be sent and the output will Xbe displayed in an emacs window (in case you use -verbose or -snoop). XThen you will be prompted to exit emacs. Enter 'y' when you are ready. X XIf you answered 'n' when prompted to send the message, Xthen the draft message will be deleted and emacs will exit. X XYou can modify the Xmh.ad resources to add more buttons. XAny MH command which accepts "+folder msg" can be used X(e.g. a replx shell script which includes the body of the Xmessage being replied to can be bound to a replx button) X X XAndrew Wason Xaw at bae.bellcore.com END_OF_FILE if test 1269 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'Xmh.ad' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Xmh.ad'\" else echo shar: Extracting \"'Xmh.ad'\" \(457 characters\) sed "s/^X//" >'Xmh.ad' <<'END_OF_FILE' XXmh*CommandButtonCount: 3 X XXmh*commandBox.button1.label: repl XXmh*commandBox.button1.translations:\ X #override\n\ X : XmhShellCommand(xmhcommand y repl) unset() X XXmh*commandBox.button2.label: forw XXmh*commandBox.button2.translations:\ X #override\n\ X : XmhShellCommand(xmhcommand y forw) unset() X XXmh*commandBox.button3.label: comp XXmh*commandBox.button3.translations:\ X #override\n\ X : XmhShellCommand(xmhcommand n comp) unset() END_OF_FILE if test 457 -ne `wc -c <'Xmh.ad'`; then echo shar: \"'Xmh.ad'\" unpacked with wrong size! fi # end of 'Xmh.ad' fi if test -f 'xmh-command.el' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xmh-command.el'\" else echo shar: Extracting \"'xmh-command.el'\" \(1294 characters\) sed "s/^X//" >'xmh-command.el' <<'END_OF_FILE' X;;; These functions are for use with xemacs and xmh. X;;; The R5 xmh has a new action - XmhShellCommand which executes X;;; a shell command with the current msg as an arg. X;;; By executing something like: X;;; XmhShellCommand(xmhcommand repl) X;;; you can use xemacs as your editor with xmh. X;;; X;;; The following elisp functions perform the basic whatnowproc functionality X;;; (quitting and deleting, sending) X;;; X;;; Andrew Wason aw at bae.bellcore.com X X X;;; Override C-xC-c X(define-key indented-text-mode-map "\C-x\C-c" 'xmh-command-send-or-delete) X X X(setq mhdraft (getenv "mhdraft")) ; save the filename of the draft X X X(find-file mhdraft) ; load the draft letter X(indented-text-mode) X(setq draft-buffer (current-buffer)) ; save the buffer the draft is in X X X(defun xmh-command-send-or-delete () X "Prompt to send or delete letter, then quit." X (interactive) X (set-buffer draft-buffer) X (if (y-or-n-p "Send message? ") X (progn X (save-buffer) ; save the draft buffer X (message "Sending...") X (pop-to-buffer "MH mail delivery"); pop to a buffer for "send" output X (erase-buffer) X (call-process "send" nil t t mhdraft) ; call MH "send" X (if (y-or-n-p "Exit? ") X (kill-emacs))) ; exit emacs X (delete-file mhdraft) ; delete the draft letter X (kill-emacs))) ; exit emacs END_OF_FILE if test 1294 -ne `wc -c <'xmh-command.el'`; then echo shar: \"'xmh-command.el'\" unpacked with wrong size! fi # end of 'xmh-command.el' fi if test -f 'xmhcommand' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xmhcommand'\" else echo shar: Extracting \"'xmhcommand'\" \(669 characters\) sed "s/^X//" >'xmhcommand' <<'END_OF_FILE' X#!/bin/sh X# This shell should be invoked by the xmh XmhShellCommand() action as X# XmhShellCommand(xmhcommand y repl) X# XmhShellCommand(xmhcommand n comp) etc. X# If the second arg is y, then the message list will be used. X X# We invoke the passed MH command on the identified message X# (we must strip the message number and folder from the pathname) X(if [ $1 = "y" ] Xthen X $2 -whatnowproc xmhemacs +`dirname \`echo $3 | \ X sed "s;\\\`mhpath +\\\`/;;"\`` `basename $3` X X# You can use this more readable version instead if you have ksh X# $2 -whatnowproc xmhemacs +$(dirname $(echo $3 | \ X# sed "s;$(mhpath +)/;;")) $(basename $3) X Xelse X $2 -whatnowproc xmhemacs Xfi)& END_OF_FILE if test 669 -ne `wc -c <'xmhcommand'`; then echo shar: \"'xmhcommand'\" unpacked with wrong size! fi chmod +x 'xmhcommand' # end of 'xmhcommand' fi if test -f 'xmhemacs' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xmhemacs'\" else echo shar: Extracting \"'xmhemacs'\" \(116 characters\) sed "s/^X//" >'xmhemacs' <<'END_OF_FILE' X#!/bin/sh X# Invoke xemacs and load the xmh-command.el stuff. X# xmhemacs is used by xmhcommand Xxemacs -l xmh-command END_OF_FILE if test 116 -ne `wc -c <'xmhemacs'`; then echo shar: \"'xmhemacs'\" unpacked with wrong size! fi chmod +x 'xmhemacs' # end of 'xmhemacs' fi echo shar: End of shell archive. exit 0 ------------------------------ Subject: babyl2mh.pl From: Vivek Khera Date: Fri, 1 Mar 1991 13:03:15 -0800 #!/usr/gnu/bin/perl # incorporate an RMAIL babyl file into an MH folder # # usage: babyl2mh +folder babyl-file # # V. Khera 17-JUL-1991 # where to find rcvstore $rcvstore = "/usr/local/lib/mh/rcvstore"; # # pull out command line args # die "usage: babyl2mh +folder babyl-file\n" unless @ARGV == 2; $folder = shift; # make sure folder name starts with a "+" (substr($folder,0,1) eq "+") || (substr($folder,0,0) = "+"); $bfname = shift; print "Incorporating RMAIL file $bfname into MH folder $folder\n"; # # read in babyl file. # $/ = "\037"; # this separates the records in a babyl file $* = 1; # records are multi-lines open(BABYL,$bfname) || die "Couldn't open $bfname\n"; $_ = ; # discard header. $msgnum = 0; while () { chop; # get rid of delimeter s/\f(.|\n)*\*\*\* EOOH \*\*\*\n//; # remove duplicate header information open(RCVSTORE,"|" . $rcvstore . " $folder"); print RCVSTORE $_; $msgnum++; print "Message $msgnum done.\n"; } ------------------------------ Subject: inco - babyl to MH converter From: Juergen Nickelsen Date: Fri, 1 Mar 1991 13:03:15 -0800 #!/bin/sh # Usage: inco [from [folder]] # "from" defaults to $HOME/Mail/outbound, "folder" to +inbox. lispfile=/tmp/inco.$$.el input=${1-$HOME/Mail/outbound} tmpmbox=/tmp/inc.$$.mbox folder=${2-+inbox} if [ $# -ge 3 ]; then echo Usage: `basename $0` [ from [ folder ]] exit 2 fi trap "rm -f $lispfile $tmpmbox ; exit 1" 1 2 15 touch $tmpmbox chmod 600 $tmpmbox echo '(rmail-input "'$input'") (rmail-last-message) (setq last (rmail-what-message)) (rmail-show-message 1) (while (not (equal (rmail-what-message) last)) (rmail-output "'$tmpmbox'") (rmail-delete-forward nil)) (rmail-output "'$tmpmbox'") (kill-buffer (current-buffer)) ' > $lispfile emacs -batch -l $lispfile inc -file $tmpmbox $folder > $input rm -f $lispfile $tmpmbox ------------------------------ Subject: t2h - add hyperlinks to message viewed From: TANAKA Tomoyuki Date: Mon, 13 Sep 1999 11:35:43 -0600 #! /bin/sed -f # "t2h" by TT news:alt.tanaka-tomoyuki http://listen.to/TT # USE: t2h file.html # Or: show | t2h | lynx - s/&/\&/g s//\>/g s/http:[^ "&) ]*/&<\/a>/g s/news:[^ "&) ]*/&<\/a>/g s/ftp:[^ "&) ]*/&<\/a>/g s/telnet:[^ "&) ]*/&<\/a>/g 1i\

$a\
------------------------------ Subject: srvrsmtp.c patch From: Paul Pomes Date: Fri, 1 Mar 1991 13:03:15 -0800 >From the 5.67 sources: *** srvrsmtp.c- Mon Feb 22 12:25:54 1993 --- srvrsmtp.c Mon Feb 22 12:29:09 1993 *************** *** 384,389 **** --- 384,395 ---- message("250", "Reset state"); if (InChild) finis(); + + /* clean up a bit if running in parent */ + hasmail = FALSE; + dropenvelope(CurEnv); + CurEnv = newenvelope(CurEnv); + CurEnv->e_flags = BlankEnvelope.e_flags; break; case CMDVRFY: /* vrfy -- verify address */ ------------------------------ Subject: IRIX config file From: Jack Repenning Date: 25 Jul 1995 02:35:41 GMT # Irix 5.3 (based on examples/sys5r4) bboards on bin /usr/local/bin/mh cc cc ccoptions -g chown /bin/chown curses -lcurses etc /usr/local/lib/mh ldoptions -L/usr/local/lib/mh mail /usr/mail mailgroup: mail manuals local mts sendmail/smtp pop on popdir /usr/local/bin ranlib off #sharedlib sys5 #slibdir /usr/local/lib/mh signal void sprintf int options BIND options DBMPWD options DUMB options FOLDPROT='"0700"' options MHE options MHRC options MIME options MORE='"/usr/bsd/more"' options MSGPROT='"0600"' options RENAME options RPATHS options SBACKUP='"\\#"' #options SENDMTS options SGI #options SMTP options SOCKETS options SVR4 options SYS5 options SYS5DIR options UNISTD options _XOPEN_SOURCE options VSPRINTF From: David Paschich Date: 23 Apr 96 21:27:12 GMT # @(#)$Id$ # a 4.2BSD VAX system running SendMail bin /usr/local/bin/mh bboards off etc /usr/local/lib/mh mail /var/mail manuals local mandir /usr/local/man chown /sbin/chown ranlib off mts sendmail signal void options BIND LOCKF FOLDPROT='"0700"' MHE MHRC MORE='"/usr/bsd/more"' options MSGPROT='"0600"' RPATHS SENDMTS SGI SMTP SOCKETS SYS5 options TYPESIG="void" ncr MIME VSPRINTF UNISTD SYSVR4 SYS5DIR ------------------------------ Subject: HP-UX 10.20 config file From: Marko Heikkinen Date: 06 Jan 1997 17:19:07 +0000 bin /opt/mail/bin bboards on etc /opt/mail/lib/mh editor prompter remove mv -f mail /var/mail mandir /opt/man manuals standard chown /bin/chown cc cc ccoptions +DA1.0 +DS1.0 curses -lcurses mts sendmail/smtp pop off slibdir: /opt/mail/lib options SYS5 options MHE options MIME options ATZ options BIND options MHE options MIME options ATZ options BIND options MHE options MHRC options MORE='"/opt/gnu/bin/less"' options MSGPROT='"0600"' options NDIR options NTOHLSWAP options POPUUMBOX options SOCKETS options SYS5 options TZNAME options TYPESIG=void options VSPRINTF options WHATNOW options _STRINGS signal void curses -lcurses -ltermlib sprintf int ------------------------------ Subject: Removing duplicate messages (Bourne) From: Jerry Peek Date: 20 Nov 1995 18:51:24 GMT Here's a simple-minded Bourne shell version. It uses "scan" to get the message number and message-id of each message. If a message has the same message-id as the previous message, the script adds its message number to the "remove" shell variable. #!/bin/sh lastmsgid=hahahaha remove= scan -width 300 -format '%(msg) %{message-id}' | while read msg msgid; do if [ "$msgid" = "$lastmsgid" ]; then remove="$remove $msg" else lastmsgid="$msgid" fi done rmm $remove That's pretty simple-minded. For example, if the $remove variable gets too big, your system may complain. And I'm sure there are some more-efficient ways to find the list of duplicate message-ids. But that's the idea. Subject: Removing duplicate messages (Perl) From: rtor at ansa.co.uk (Owen Rees) Date: 20 Nov 1995 12:39:47 GMT I wrote a perl script to do this some time ago. All the usual dire warnings about destructive technology apply - take a backup, do it on a copy, try it on a small test case first etc. Don't use this script unless you are prepared to accept the consequences. #!/usr/local/bin/perl $version = "rmmdup 1"; if (@ARGV == 0) { $folder = ""; } elsif (@ARGV == 1) { $folder = $ARGV[0]; unless ( $folder =~ /^\+.+$/ ) { die "usage $0 [+folder]\n"; }; } else { die "usage $0 [+folder]\n"; }; $rmmlist = ""; open (scan, "scan $folder -format '%(msg) %{message-id}'|"); while () { if ( ($msg,$msgid) = /^(\d+) (<.*>)$/) { if ($msgs{$msgid}) { print "$msg duplicates $msgs{$msgid}\n"; $rmmlist .= " $msg"; } else { $msgs{$msgid} = $msg; }; }; }; if ( $rmmlist ) { exec "rmm $folder $rmmlist"; }; exit; Subject: Removing duplicate messages (Perl) From: Bill Wohler Date: Sun, 17 Oct 2004 13:00:20 -0700 #!/usr/bin/perl -w # # Id: mhfinddup 6593 2004-09-02 16:34:24Z wohler =head1 NAME mhfinddup - find duplicate messages =head1 SYNOPSIS mhfinddup [options] [folder ...] =head1 DESCRIPTION B finds and removes duplicate MH messages in the folders listed on the command line (default: current folder). By default, you deal with duplicate messages interactively. You can either remove the duplicate, not remove the duplicate, or view the original and duplicate message before deciding. If you use the B<-msgid> option to B, then you probably don't want to list any F<+outbox> folders if you are using the B<--no-same-folder> option and you want to preserve your sent messages as well as your messages to mailing lists. Note that if you specify one or more folders, or if you use the B<--all> option, B recursively descends the given folders. =head1 CONTEXT Context is per B(1). That is, if F<+folder> is given, it will become the current folder. If multiple folders are given, the last one specified will become the current folder. =head1 OPTIONS =over 4 =item --all Look for duplicates in all folders. If any folders are specified, this option is ignored. =item --debug Turn on debugging messages. =item --help Display the usage of this command. =item --list List duplicated messages. =item --no-same-folder Since it is common to use C to file a message in multiple folders, this script doesn't consider messages in different folders to be duplicates. Specify this option to list or remove duplicates across folders. =item --rmm Remove messages non-interactively. Use with care! For safety, the B<--list> option takes precedence if specified and is a good option to use before using B<--rmm>. =item --version Display program version. =back =head1 RETURN VALUE Returns 0 if all is well; non-zero otherwise. =head1 EXAMPLES =over 0 =item mhfinddup Interactively remove duplicates from the current folder. =item mhfinddup --all --list --no-same-folder List all duplicates regardless if they are in different folders or not. =item mhfinddup --rmm +lists Remove all duplicates in F<+lists>, recursively. =back =head1 SEE ALSO B(1), B(1), B(1) =head1 VERSION Revision: 6593 =head1 AUTHOR Bill Wohler Copyright (c) 2003 Newt Software. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, you can find it at http://www.gnu.org/copyleft/gpl.html or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =head1 METHODS =cut # Packages and pragmas. use Getopt::Long; use strict; # Constants. my $cmd; # name by which command called ($cmd = $0) =~ s|^\./||; # ...minus the leading ./ my $ver = '6593'; # program version with CVS noise # Variables (may be overridden by arguments). my $all = 0; # look in all folders my $debug = 0; # verbose mode my $help = 0; # display usage my $version = 0; # display version my $list = 0; # list duplicates my $no_same_folder = 0; # consider duplicates across folders my $rmm = 0; # remove duplicates without asking # Constants. my $mhl = "/usr/lib/mh/mhl"; my $tmp = "/tmp/mhfinddup$$"; # Parse command line. # The use of the posix_default option is to ensure that folders like +a are # not confused with --all. I'd really prefer to set prefix_pattern to "(--|-)" # so that abbreviations of options can be used without being confused with # folders, but I couldn't make it so. my %opts; Getopt::Long::Configure("pass_through", "posix_default"); GetOptions('all' => \$all, 'debug' => \$debug, 'help' => \$help, 'list' => \$list, 'no-same-folder' => \$no_same_folder, 'rmm' => \$rmm, 'version' => \$version, ) or usage(); show_version() if ($version); usage() if ($help || int(@ARGV) != int(map(/^\+/, @ARGV))); my @folders = expand_folders(@ARGV); print("Expanded " . join(" ", @ARGV) . " into\n" . join("\n", @folders) . "\n") if ($debug); print("Scanning for duplicate messages...\n"); my %msgs; foreach my $folder (sort @folders) { print("Scanning $folder...\n") if ($debug); open (SCAN, "MHCONTEXT=$tmp scan +$folder -format '%(msg) %{message-id}'|"); while () { if (my ($msg, $msgid) = /^(\d+) (<.*>)$/) { if ($msgs{$msgid}) { $msgs{$msgid} =~ m|^\+(.*)/(\d+)$|; my($f, $m) = ($1, $2); if ($folder eq $f || $no_same_folder) { handle_dup($f, $m, $folder, $msg); } } else { $msgs{$msgid} = "+$folder/$msg"; } } } close(SCAN); } unlink("$tmp"); sub expand_folders { my @folders = @_; print("Getting list of folders..."); open(FOLDERS, "flist -recurse " . (($all == 1 && @folders == 0) ? "-all" : join(" ", @folders)) . "|") or die("Could not determine folders\n"); @folders = (); chomp(my $current_folder = `mhparam Current-Folder`); $current_folder = quotemeta($current_folder); while () { chomp; my ($folder, $a, $b, $c, $d, $e, $f, $g, $count) = split; if ($folder =~ /^$current_folder\+$/) { $folder =~ s/\+$//; # remove current folder indication } next if ($count == 0); push(@folders, $folder); } close(FOLDERS); print("done\n"); return(@folders); } sub handle_dup { my($f1, $m1, $f2, $m2) = @_; my $ans; repeat: print("+$f2/$m2 duplicate of +$f1/$m1"); if ($list) { print("\n"); } else { if ($rmm) { $ans = "y"; print("\n"); } else { print(", remove? [Yns?] "); chomp($ans = ); } if ($ans eq "y" || $ans eq "") { system("rmm +$f2 $m2"); } elsif ($ans eq "s") { system("$mhl `mhpath +$f1 $m1` `mhpath +$f2 $m2`"); goto repeat; } elsif ($ans eq "?") { print("y, remove message (default)\n" . "n, don't remove message\n" . "s, show messages\n" . "?, show this message\n"); goto repeat; } } } =head2 usage Display usage information and exit. =cut sub usage { print <\n\n". "$cmd comes with ABSOLUTELY NO WARRANTY.\n\n". "This is free software, and you are welcome\n". "to redistribute it under certain conditions.\n\n". "See `http://www.gnu.org/copyleft/gpl.html' for details.\n"); exit(0); } Local Variables: mode: outline outline-regexp: "^Subject:" fill-prefix: " " End: nmh-1.5/docs/MAIL.FILTERING000644 007761 000765 00000007646 11713401273 015025 0ustar00kenhkenh000000 000000 INTRODUCTION ------------ It is a common practice when using nmh to filter your inbound mail directly into nmh folders. There are several programs which allow you to do this, of which two common ones are procmail and slocal. SLOCAL ------ The slocal command is part of the nmh distribution. It is a fairly simple mail filtering program. Check the slocal man page for an example filtering file (called .maildelivery). PROCMAIL -------- Probably the most popular mail filtering command is procmail. It can filter mail into standard mbox-style spool files, as well as into MH/nmh style folders. Although procmail knows how to put a message directly into an nmh folder, this is not recommended. Procmail doesn't know about nmh sequences. Instead you should have procmail use the nmh command `rcvstore' to put the message into the folder. The `rcvstore' command will (by default) add each new message to the "unseen" sequence, so you can detect new messages in folders with the `flist' command. Also, nmh commands generally like to keep mail messages in RFC-822 format. But by default, procmail will leave the first line of the message unchanged. This line (which usually begins with "From ") is not in the standard RFC-822 format. It is recommended that you use the command `formail' (which comes in the procmail distribution) to rewrite this line so that it begins with the header name "X-Envelope-From:". An example of how to do this is given below. The reason the header name "X-Envelope-From:" is recommended, is that the nmh command `packf' (as of version 0.23) will check for this header when packing folders. The `packf' command knows how to undo the rewriting of the "From " line to the "X-Envelope-From:" line. By checking for this header name, `packf' is able to pack the folder into exactly the form that is used if procmail delivers to the standard mail spool. If you do not rewrite the "From " line into this format, the `packf' command will still work. But it may create fake "From " lines which are not the same as the originals. Alternatively, you might be able to suppress generation of the "From " line. If your procmail invocation includes the -f or -r option, remove. Those options add a "From " line to incoming beginning of messages that do not have them. Here is a typical .procmailrc file for using procmail in conjunction with nmh. For more information, see the manual pages for procmail, procmailrc and procmailex. ################################################################### # .procmailrc ################################################################### # To use procmail, put the next line in your .forward file: # "|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #XXX" # Do not remove the double quotes. Change XXX to your username. # Edit path to procmail above, and the VARIABLES below, as needed. # Adapt the MAILING LIST section below for lists you subscribe to. # Your .forward needs to be world-readable, but not world-writable. ################################################################### # This .procmailrc is written for use with nmh/mh/exmh/mh-e ################################################################### ### VARIABLES ### VERBOSE=off SHELL=/bin/sh PATH=/usr/local/nmh/lib:/usr/local/nmh/bin:/usr/bin:/usr/local/bin MAILDIR=$HOME/Mail LOGFILE=$MAILDIR/procmail.log LOCKEXT=.lock ################# # CLEANUP MESSAGE ################# # Force the "From user date" to become part of header :0 Whf | formail -z -R 'From ' X-Envelope-From: ############### # MAILING LISTS ############### :0 w: nmh-workers/$LOCKEXT * ^Resent-from: *nmh-workers | rcvstore +nmh-workers # catches exmh-{announce,users,workers} :0 w: exmh/$LOCKEXT * ^TOexmh | rcvstore +exmh # Catch junk. Don't add it to "unseen" sequence (nmh only) :0 w: junk/$LOCKEXT * ^(reply-to|from|sender):.*(spammer|flamer|evil-host) | rcvstore -nounseen +junk ################ # DEFAULT ACTION ################ :0 w: inbox/$LOCKEXT | rcvstore +inbox nmh-1.5/docs/MAILING-LISTS000644 007761 000765 00000002331 11762736344 014735 0ustar00kenhkenh000000 000000 There are currently three mailing lists related to nmh: nmh-announce@nongnu.org ----------------------- This is a very low-traffic mailing list for announcing new releases, patches, and important events related to nmh. To subscribe or manage your subscription options, go to: https://lists.nongnu.org/mailman/listinfo/nmh-announce nmh-workers@nongnu.org ---------------------- This is the main list for discussing work on nmh. There is currently no nmh-users mailing list, so user questions are acceptable here (the comp.mail.mh newsgroup is another good option). Bug reports and feedback should be submitted here. To subscribe or manage your subscription options, go to: https://lists.nongnu.org/mailman/listinfo/nmh-workers nmh-commits@nongnu.org ---------------------- All commits to the nmh source code repository are copied to this list. Therefore, it is probably only of interest to nmh developers. To subscribe or manage your subscription options, go to: https://lists.nongnu.org/mailman/listinfo/nmh-commit mail archives ------------- The nmh-workers and nmh-commits mailings lists archives are available here: http://lists.nongnu.org/archive/html/nmh-workers/ http://lists.nongnu.org/archive/html/nmh-commits/ nmh-1.5/docs/README-ATTACHMENTS000644 007761 000765 00000024640 11713401273 015460 0ustar00kenhkenh000000 000000 Jon Steinhart's (jon@fourwinds.com) Attachment Handling Mods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A bunch of changes have been made to improve the nmh user interface for handling MIME attachments. Why Did I Do This? ~~~~~~~~~~~~~~~~~~ Although nmh contains the necessary functionality for MIME message handing, the interface to this functionality is pretty obtuse. There's no way that I'm ever going to convince my partner to write mhbuild composition files! And even though I know how to write them, I often screw up when sending a message that contains a shell script because I forget that I have to double any # at the start of a line, which shell scripts have galore. These changes simplify the task of managing attachments on draft files. They allow attachments to be added, listed, and deleted. MIME messages are automatically created when drafts with attachments are sent. The Simple Setup ~~~~~~~~~~~~~~~~ The gory details are all given below. Here's how to set things up simply. This only works if you're using the "standard" interface, i.e., whatnow. Life is more complicated if you run mh-e. Add the following to your .mh_profile: send: -attach X-MH-Attachment whatnow: -attach X-MH-Attachment You may already have send and whatnow lines in your .mh_profile; if you do, just add the new stuff to the end of the line. For example, mine looks like: send: -alias aliases -attach X-MH-Attachment whatnow: -attach X-MH-Attachment That's it. Next time you want to send an attachment, say "attach filename" at the whatnow prompt and you're done. You can check your attachments by saying "alist". Did I Do This Correctly? ~~~~~~~~~~~~~~~~~~~~~~~~ Hard to say. Despite lots of time looking at the nmh code, I can't say that I get the philosophy behind its structure. I am aware of two deviations from what I saw in the nmh code. 1. I commented my changes. 2. It's been years since I've used a VT-100, so I don't try to make code fit into 80 columns anymore. Seems silly to me. What Did I Do? ~~~~~~~~~~~~~~ I made changes to the following files: h/ prototypes.h man/ anno.man send.man whatnow.man uip/ Makefile.in anno.c annosbr.c send.c sendsbr.c viamail.c (needed change for new sendsbr argument) whatnowsbr.c Attachments are associated with messages using header fields. For example, a draft that looks like this To: jon Subject: test of attachments X-MH-Attachment: /export/home/jon/foo X-MH-Attachment: /export/home/jon/bar X-MH-Attachment: /export/home/jon/test/foo -------- has the files "foo", "bar", and foo as attachments. Although I use the header field name "X-MH-Attachment" to indicate attachments, the implementation allows any header field name. The advantage of using header fields is that the list of attachments travels with the draft so it remains valid across editing sessions. Note that the header fields for attachments are removed from the message before it is sent. Since I was adding header fields to messages, it seemed sensible to use the existing anno program to do this for me. This required several changes to generalize anno: o I added a -draft option that permits annotations (header fields) to be added to the draft instead of a message sequence. o I added a -delete option that allows annotations to be deleted. o I added a -list option that allows annotations to be listed. o I added a -number option that modifies the behavior of -delete and -list. o I added a -append option so that annotations are appended to the headers instead of the default prepend. Without this, attachments come out in reverse order. Using the modified anno, the example above could be created (assuming that the draft exists) by prompt% anno -draft -comp X-MH-Attachment -text /export/home/jon/foo -nodate -append prompt% anno -draft -comp X-MH-Attachment -text /export/home/jon/bar -nodate -append prompt% anno -draft -comp X-MH-Attachment -text /export/home/jon/test/foo -nodate -append One can quite easily make an "attach" command using shell scripts, aliases or functions. For example, here's a bash function that does the job: function attach() { for i in $*; do anno -append -nodate -draft -comp X-MH-Attachment -text "$i"; done; } The following examples show the different ways in which attachments can be listed. prompt% anno -list -draft -comp X-MH-Attachment foo bar foo prompt% anno -list -draft -comp X-MH-Attachment -text / /export/home/jon/foo /export/home/jon/bar /export/home/jon/test/foo prompt% anno -list -draft -comp X-MH-Attachment -number 1 foo 2 bar 3 foo prompt% anno -list -draft -comp X-MH-Attachment -text / -number 1 /export/home/jon/foo 2 /export/home/jon/bar 3 /export/home/jon/test/foo prompt% Why all these listing options? I feel that the listing as produced by the first example is what most people would want most of the time. The listing as produced by the second example seemed necessary for situations where there were several attachments with the same file name in different directories. I included the numbering option so that attachments could be deleted by number which might be easier in situations where there were several attachments with the same file name in different directories, as in the above example. Attachments are deleted using the -delete option. prompt% anno -delete -draft -comp X-MH-Attachment -text foo deletes the first attachment since the foo matches the basename of the attachment name. prompt% anno -delete -draft -comp X-MH-Attachment -text /export/home/jon/test/foo deletes the third attachment since the text is a full path name and matches. prompt% anno -delete -draft -comp X-MH-Attachment -number 2 deletes the second attachment. The attachment annotations are converted to a MIME message by send. I'm not completely sure that this is the right place to do it, as opposed to doing it in post, but both would work. It seemed to me to make more sense to do it in send so that all of the various post options would apply to the MIME message instead of the original draft file. I added an -attach option to send that specifies the header field name used for attachments. Send performs the following additional steps if this option is set: o It scans the header of the draft for attachments. Normal behavior applies if none exist. o A temporary mhbuild composition file is created if there are attachments. o All non-attachment headers are copied from the draft file to the composition file. o The body of the draft is copied to a temporary body file if it contains at least one non-whitespace character. A mhbuild directive for this file is appended to the composition file. Note that this eliminates the problem of lines beginning with the # character in the message body. o A mhbuild directive is appended to the composition file for each attachment header. o mhbuild is run on the composition file, converting it to a MIME message. o The converted composition file is substituted for the original draft file and run through the rest of send. o The original draft file is renamed instead of the converted composition file. This preserves the original message instead of the composition file which is really what a user would want. o The ,file.orig file created by mhbuild is removed as it's a nuisance. The mhbuild directives appended to the composition file are constructed as follows: o The content-type a file with a dot-suffix is obtained from the list of mhshow-suffix- entries in the profile. o A file with no dot-suffix or no entry in the profile is assigned a content-type of application/octet-stream if it contains any non-ASCII characters. o A file with no dot-suffix or no entry in the profile is assigned a content-type of text/plain if it contains only ASCII characters. o The directive is of the form: #content-type; name="basename"; x-unix-mode=mode [ description ] filename The content type is derived as discussed above. The basename is the last component of the pathname given in the body of the attachment header field. The mode is file permissions. The description is obtained by running the file command on the attachment file. The filename is the field body from the attachment header field. I added an -attach option to whatnow that specifies the header field name for attachments. I added to the commands available at the whatnow prompt to provide an interface to the attachment mechanism. I'm not completely happy with some of these additions because they duplicate shell functionality. I'm not sure that there's a good way around it other than to not use whatnow. The first three additions (the ones I'm not happy with) are cd, ls, and pwd. These do the same thing as their system counterparts. As a matter of fact, these are implemented by running the commands in a subshell. I did this because I wanted proper interpretation of shell-specific things like ~ and wildcard expansion. The next command is attach. This takes a list of files and adds them to the draft as attachments using the same code as the modified anno. The list of files is run through ls using the user's shell, so wildcard expansion and all that works. The alist command lists the attachments on the current draft using listing function that I added to anno. It takes two optional options, -l for a long listing meaning full path names, and -n for a numbered listing. The detach command removes attachments from the current draft, again using the modified anno. The arguments are interpreted as numbers if the -n option is used, otherwise they're interpreted as file names. File names are shoveled through ls using the user's shell in the directory containing the file for wildcard expansion and such. File names are matched against the last pathname component unless they begin with a / in which case they're matched against the entire name. What's Left To Do? ~~~~~~~~~~~~~~~~~~ Nothing on this stuff. When I get time I'd like to improve the interface for reading messages with attachments. It's my opinion that, because of the command line nature of nmh, it makes the most sense to treat attachments as separate messages. In other words one should be able to read the next attachment using next, and the previous one using prev. One should be able to show and scan attachments. This would probably involve a major change in the message numbering scheme to allow something like 123.4 to indicate attachment 4 on message 123. Jon Steinhart nmh-1.5/docs/README-components000644 007761 000765 00000004263 11762736344 016107 0ustar00kenhkenh000000 000000 As of the 1.5 release, nmh has made significant changes to the way most of the message composition utilites work, specifically with the way the components templates are handled. If you use the default components templates that come with nmh then everything should work with only minor changes, but if you have custom component templates you should read this information carefully to understand how you might need to adapt your component templates. - "post" now requires a From: header in all drafts that it processes for sending (a "Resent-From" header is accepted for use with "dist"). - You should now use %(localmbox) instead of %(me) especially in replcomps and replgroupcomps. - The nmh programs "comp", "forw", and "dist" now process all component template files using the format routines in mh-format(5). The default templates are configured to place an appropriate From: header in them. Any custom templates you use will either have to be adapter to add an appropriate From: header or you will have to manually put one in the draft. - "comp", "forw", and "dist" all have new switches "-from", "-to", "-cc", "-fcc", and "-subject" that can be used to adjust the headers that appear in the draft. See the default component files and the program man pages to see exactly how this works with mh-format. - The default From: header is constructed based on the Unix username and the local hostname. This can be overridden using the Local-Mailbox profile entry. - A number of new format instructions are available: %(myhost) - The local hostname %(myname) - The local user's name (GECOS field) %(localmbox) - The local mailbox (either Local-Mailbox or user@host). This should now be used instead of %(me) in nearly all cases (%(me) only outputs the local Unix username). %(putlit) - Out the contents of the str register without space compression. %(concataddr) - Construct an address list like %(formataddr), except that it will NOT perform duplicate supression (currently duplicate supression only happens inside of "repl"). One possible use of this function is to construct an address list and use %(match) to decide which "From:" address to use. nmh-1.5/docs/README-HOOKS000644 007761 000765 00000010055 11713401273 014563 0ustar00kenhkenh000000 000000 Jon Steinhart's (jon@fourwinds.com) External Program Hooks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This blurb describes a changes to nmh that implement an interface to external programs. This interface is different than the limited interface provided by things like the rmmproc context entry. Why Did I Do This? ~~~~~~~~~~~~~~~~~~ I'm working on a project (grokmail) that will get released via GPL sometime soon. This project keeps a database synchronized with the messages in the mail system. New functionality is built on top of this database. This functionality allows fast searching, and searching based on interest criteria. The latter can be used for spam filtering. The changes to nmh allow external programs to be run whenever a message is added to a folder, removed from a folder, or refiled. The changes are implemented in a general way so that it can be used for other purposes than mine. What Are The Changes? ~~~~~~~~~~~~~~~~~~~~~ The changes add four new profile components: add-hook: This is the full pathname of a program that is invoked whenever a message is added to a folder. The program is passed one argument which is the full pathname of the message file. The program is executed after the message is written so that it can act upon that message. del-hook: This is the full pathname of a program that is invoked whenever a message is deleted from a folder. The program is passed one argument which is the full pathname of the message file. The program is executed before the message is written so that it can act upon that message. ref-hook: This is the full pathname of a program that is invoked whenever a message is refiled. The program is passed two arguments: the first is the full pathname of the original message file, the second is the full pathname of the final message file. The program is executed after the message is written. msg-hook: This is a text message that is output if the execution of one of the external hook programs fails. There is a built-in default message if none is specified. The definition of refiling is a bit tricky. The refile hook is executed if a message is moved from one place to another. So, for example, the command refile -link causes the add hook to be executed, not the refile hook, because a new message is created, the old one isn't moved. These changes affect the following commands: burst: The add hook is executed for messages burst from a digest, and for the table of contents if -inplace is specified. The delete hook is executed for the original message if -inplace is specified. The refile hook is executed for messages that are moved. folder: The refile hook is executed for -pack. inc: The add hook is executed when messages are incorporated. refile: Either the add or refile hooks are executed. rmf: The delete hook is executed when messages are deleted. rmm: The delete hook is executed when messages are deleted. sortm: The refile hook is executed for each message moved. Note that a magic temporary message number of 2147483647 is used to hold messages as they are being shuffled. rcvstore: The add hook is executed when messages are stored. mhstore: The add hook is executed when messages are stored. Did I Do This Correctly? ~~~~~~~~~~~~~~~~~~~~~~~~ Well, sort of. This all works, but I'm not really happy with it. The issue is that an examination of the nmh code shows that message handling is scattered all over the place. Although there are library routines such as folder_addmsg and folder_delmsgs, they are not used consistently. Long term, I think that it would be better to make all message handling go through the same choke points. Also, I added a function to run the external programs. This sort of stuff is also scattered around the nmh code, for example in the code to run the rmmproc. Again, I'd like to make this more consistent in the long term. What Files Did I Change? ~~~~~~~~~~~~~~~~~~~~~~~~ uip/ burst.c inc.c refile.c rmf.c sortm.c sbr/ folder_addmsg.c folder_delmsgs.c folder_pack.c ext_hook.c (new file) nmh-1.5/docs/README.about000644 007761 000765 00000003471 11713401273 015017 0ustar00kenhkenh000000 000000 # # README.about -- about nmh # ----------- what is it? ----------- nmh (new MH) is an electronic mail handling system. It was originally based on the package MH-6.8.3, and is intended to be a (mostly) compatible drop-in replacement for MH. If you have previously used MH, check the file DIFFERENCES for a list of the differences between nmh and MH (not up-to-date as of this writing). Although development of nmh is ongoing, it is generally stable and is in current use. But it is possible that we may break things as changes are made. -------------------------------- ftp and web sites, mailing lists -------------------------------- To find out about the mailing lists, ftp sites, and web page for nmh, check the FAQ included in this distribution. --------------- nmh maintenance --------------- nmh is currently being developed and maintained by a loosely organized group of volunteers. General discussion of the development work takes place on the nmh-workers@nongnu.org mailing list. Please send bug reports and suggestions there. ---------------- acknowledgments ---------------- The MH system was originally developed in 1979 by the RAND Corporation. It was written primarily by Bruce S. Borden after ideas in a memo by R. Stockton Gaines and Norman Z. Shapiro. In 1982, the University of California, Irvine took up maintenance of the software, under the direction of Marshall T. Rose and John L. Romine. nmh was started by Richard Coleman (coleman@math.gatech.edu) after development on MH mostly stopped. He did the original autoconfiscation and most of the other work up until version 1.0. nmh uses (v)snprintf code from the Apache web server, so we need to make the following acknowlegement: This product includes software developed by the Apache Group for use in the Apache HTTP server project (http://www.apache.org/). nmh-1.5/docs/README.developers000644 007761 000765 00000016433 11765267273 016100 0ustar00kenhkenh000000 000000 # # README.developers # This file is intended to provide a few tips for anyone doing development on nmh. Developers who learn things "the hard way" about the nmh codebase (as opposed to local info best encoded in a comment) are encouraged to share their wisdom here. The topics are organized alphabetically. ------------------------- autoconf & automake files ------------------------- If you wish to change the `configure' script, the generated Makefile or other related files, you'll need to first install GNU m4, available from , then GNU autoconf () and GNU automake (). Nmh is currently using a minimum of autoconf 2.61 and automake 1.10. Most of the configure-related files are automatically generated. The only files you should need to manually edit are configure.ac and any autoconf macros in the m4 directory. Don't, for instance, edit config.h.in. Though it is an input file from the point of view of the users (and the configure script) it is an output file from the point of view of the developers (and the autoconf script). If you wish to add a new autoconf macro, it should be placed in it's own file and put in the m4 directory; aclocal will automatically pick it up and automake will add it to the distribution target automatically. If you wish to make changes to the Makefile, you will need to edit Makefile.am. See the automake documentation if you need further help. You should always check changes to Makefile.am by using "make distcheck". Note that the automatically generated autotools files (such as config.h.in, Makefile.in, and configure), are NOT kept in git. Thus, when you check out a git tree, you need to run the autogen.sh script before you can build anything: % ./autogen.sh ------------------- directory structure ------------------- Following is a list of nmh's directories along with a brief description of the purpose of each one. Meanings are given for the abbreviations, but note that these meanings are just informed guesses as to what the MH developers were thinking. ./ The top-level directory. Contains files like README and INSTALL. config/ Contains utility files for the `configure' process. Ordinarily nothing in here needs to be messed with. docs/ Contains more specialized documentation, such as this file and the FAQ. etc/ Contains files, file templates, and scripts to generate files that will be installed in the ${prefix}/etc directory. Stuff like replcomps. h/ Most of nmh's header (.h) files are kept not in the individual source directories, but in this central location. man/ Contains all the input files that are processed to generate nmh's manual pages. mts/ "mts" stands for "Message Transfer Service". Source files specific to the different MTSs go in the subdirectories. mts/smtp/ When nmh is configured to just talk to an SMTP server over TCP/IP, the source in this directory is compiled. sbr/ "sbr" stands for "subroutine(s)". For the most part, each source file in this directory contains a single function with the same name as the source file. These functions are of general use and are called from throughout nmh. test/ The num unit test suite. uip/ "uip" stands for "User Interface Programs". Most nmh commands have a file in this directory named .c containing the code for that command (e.g. repl.c). In some cases there is also an auxiliary file called sbr.c which contains additional subroutines called from .c (which would contain not much else besides main()). --- git --- As of December 2010, nmh has switched to using git for revision control instead of CVS. While the topic of git is beyond the scope of this FAQ, to get started with git & nmh, you can run the following command to checkout the nmh repository: % git clone git://git.savannah.nongnu.org/nmh.git That will create a workspace call nmh. To update that workspace with changes to the master, cd to it and run: % git pull ------------------------------------------------------- nmh-local functions to use in preference to OS versions ------------------------------------------------------- For some system functions whose availability or behavior varies from OS to OS, nmh conditionally uses a local definition with the same name as the OS function (e.g. snprintf()). For other functions, developers need to avoid the OS versions and always use the nmh-supplied function. Here is a list of such functions: OS function nmh-local version to use instead =========== ================================ getpass() nmh_getpass() ------------- releasing nmh ------------- To make a public release of nmh (we'll use version 1.5 as the example here; the convention for release candidates is to use something like "1.5-RC1"): 1. % echo 1.5 > VERSION % date +"%e %B %Y" > DATE (DATE should contain something like "30 December 2000") 2. % git commit VERSION DATE; git push 3. % git tag -a 1.5 -m 'Releasing nmh-1.5.' Note that the new convention for tagging is to simply tag with the version number (tag formats in the past have varied). 4. % make distcheck If you want to check the distribution build with some particular configure options, set the DISTCHECK_CONFIGURE_FLAGS variable. E.g.: % make distcheck DISTCHECK_CONFIGURE_FLAGS=--with-cyrus-sasl 5. If all is well and your tarball is final, go back to your workspace and do: % echo 1.5+dev > VERSION 6. % git commit VERSION; git push 7. Upload the distribution file to savannah. You can automate this process by doing: % make upload SAVANNAH_USERNAME=username This will automatically call gpg to sign the release. You can bypass this step by setting the SKIP_GPG_SIG variable. 8. Update the http://www.nongnu.org/nmh/ homepage. (It lives in the CVS 'webpages repository'; see https://savannah.nongnu.org/cvs/?group=nmh) 9. Add a news item to the savannah nmh page. You'll have to submit it first and then separately approve it (under News->Manage). 10. Send the release announcement email to the following places: nmh-workers@nongnu.org nmh-announce@nongnu.org exmh-users@redhat.com exmh-workers@redhat.com mh-e-users@lists.sourceforge.net mh-users@ics.uci.edu *or* comp.mail.mh (there is a bidirectional gateway) If the release fixes significant security holes, also send an announcement to bugtraq@securityfocus.com. The exmh lists require you to be subscribed in order to post. Note that you don't need to post separately to comp.mail.mh, as the mh-users mailing list is apparently bidirectionally gatewayed to it. Preferably, the announcement should contain the MD5 hash generated above, and should be PGP-signed. It should include the URL for the tarball as well as the URL of the website. It should contain a brief summary of visible changes, as well as the URL of the git diff page that would show a detailed list of changes. The changes between 1.5 and 1.4 would be shown by [this is just a guess, I don't know anything about cgit, and it assumes that we tag with nmh-x_x-release from now on]: http://git.savannah.gnu.org/cgit/nmh.git/diff/?h=nmh-1_5-release?h=nmh-1_4-release nmh-1.5/docs/README.manpages000644 007761 000765 00000010431 11713401273 015472 0ustar00kenhkenh000000 000000 NMH MANPAGE STYLE GUIDE nmh manpages should be in this general form: .\" .\" %nmhwarning% .\" .TH COMP %manext1% "%nmhdate%" MH.6.8 [%nmhversion%] .SH NAME comp \- compose a message .SH SYNOPSIS .HP 5 .B comp .RI [ +folder ] .RI [ msgs ] .RB [ \-form .IR formfile ] .RB [ \-use " | " \-nouse ] .RB [ \-version ] .RB [ \-help ] .SH DESCRIPTION .B Comp is used to create a new message to be mailed. It copies something. .SH FILES .fc ^ ~ .nf .ta \w'/usr/local/nmh/etc/ExtraBigFileName 'u ^%etcdir%/components~^The standard message skeleton .SH "PROFILE COMPONENTS" .fc ^ ~ .nf .ta 2.4i .ta \w'ExtraBigProfileName 'u ^Path:~^To determine the user's nmh directory .SH "SEE ALSO" dist(1), forw(1), repl(1), send(1), whatnow(1), mh-profile(5) .SH DEFAULTS .nf .RB ` +folder "' defaults to the current folder" .SH CONTEXT None .SH BUGS None --------------------------------------- In the FILES section, use a spacer of "/usr/local/nmh/etc" for now, we'll parametrize that into %etcdir% later. Source files There should be no ".so" commands to source an external file, since these break on Linux, where the man program does not allow source files outside the man/ hierarchy. Instead, insert this fragment: .PP .RS 5 .nf %components% .fi .RE .PP Of course, replace "components" with a unique identifier that reflects the content being included, like "mts_conf" for etc/mts.conf. Then, add two lines to the man.sed target in Makefile.in like: echo '/%components%/r $(top_srcdir)/etc/components' >> $@ echo ' s,%components%,,g' >> $@ At compile time, the contents of the file will physically incorporated into the body of the man page. This is somewhat unfortunate, since later modifications won't be reflected in the manpage, but on the other hand, the manpage will show the default configuration and not local modifications. Program names All nmh program names should be bolded. If there is punctuation after the name, use a .BR construct to avoid the automatic space that's inserted with just a .B: .B comp .BR comp , If this is a manpage reference (outside of the SEE ALSO section, which just uses regular text), use: .BR mh-draft (5) SYNPOSIS section Literal text (such as flags) should be in bold. Parameters should be italicized. Mutually exclusive options (like "-foo" and "-nofoo") should be grouped together and seperated by a "|": .RI [ +folder ] <---- parameter .RI [ msgs ] <---- parameter .RB [ \-version ] <---- flag .RB [ \-editor <---- flag with .IR editor ] parameter .RB [ \-use " | " \-nouse ] <---- exclusive parameters References to these flags or parameters in the body text of the manpage should reflect these conventions: You may not supply both a .B \-form .I formfile and a .I +folder or .I msg argument. In particular, don't enclose them in single quotes (except in the DEFAULT section, which might be inconsistent, but seems a little clearer. For "-flag param" situations, try to use a .B/.I combination instead of a single .BI, since it allows more flexibility in case of punctuation, and we get an automatic space between flag and param for free, without having to manual force it. Subsections Use ".SS" to denote a subsection Tables The folder manpage has an example of a table. .PP .RS 5 .nf .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u FOLDER \0\0\0\0\0\0# MESSAGES RANGE CUR (OTHERS) ff has \0no messages. inbox+ has \016 messages (\03\-\022); cur=\05. mh has \076 messages (15\-\076); cur=70. .fi .RE .PP Other italicized text Italicize file names, profile entries, and folder names: If a file named .RI \*(lq components \*(rq exists in the user's nmh directory, If the user's profile contains a .RI \*(lq "Msg\-Protect: nnn" \*(rq entry, it The \*(lq+\*(rq after .I inbox indicates that it is the current folder. Enclose the file names and profile entries in lq/rq quotes, too. Pointer manpages Certain manpages are shared between one or more programs (such as folder/folders). The secondary program should have a man page that only contains: .so man1/folder.1 Also, add this manpage to the appropriate section in Makefile.in nmh-1.5/docs/README.SASL000644 007761 000765 00000003473 11713401273 014451 0ustar00kenhkenh000000 000000 # # README.SASL - Readme about SASL support in nmh # SASL is short for the Simple Authentication and Security Layer. Is is a framework for adding authentication and encryption to network protocols. It is described in IETF RFC 2222. This release of nmh supports SASL for POP and SMTP. The SASL support is implemented using the Cyrus-SASL library. This library can be found at ftp://ftp.andrew.cmu.edu/pub/cyrus-mail. Obviously, SASL support only works if you use --enable-pop and the SMTP mail transport. This release of NMH only supports "Version 2" of the Cyrus SASL library. It should work with any newer Cyrus SASL release, but it was tested with Cyrus SASL 2.1.22. In particular, the CRAM-MD5 and GSSAPI (Kerberos 5) mechanisms were tested. Older versions of Cyrus-SASL had a bug which could manifest when negotiating encrypting depending on the encryption type you used, so a newer version of Cyrus-SASL is recommended. Currently, security layers ("encryption" in SASL-speak) are supported for both POP and SMTP. This means that if your POP or SMTP server _and_ the selected SASL mechanism supports it, client-server communications will be encrypted. In theory this should work with any SASL mechanism that supports security layers; it has only been tested with the GSSAPI mechanism. If you are curious as to whether or not your communications are actually encrypted or not, you can use the -snoop flag to the POP or SMTP utilities. Communication that is encrypted is preceeded by an (encrypted) or (decrypted), depending on the direction of communication. If you would like to use the GSSAPI SASL mechanism (Kerberos V), you should read very carefully the documentation that comes with Cyrus-SASL, specifically the GSSAPI documentation. Getting the GSSAPI plugin to work correctly with SASL can be "interesting" to say the least. nmh-1.5/docs/TODO000644 007761 000765 00000015172 11762736344 013535 0ustar00kenhkenh000000 000000 [TODO] * fix msh/mmdf problems. * Add IPv6 support. * Write different function to read configuration files, instead of using m_getfld.c * convert calls from sprintf/vsprintf to snprintf/vsnprintf * convert calls from getcpy to strdup * modularize access to context/profile list. * add command printm to print messages * finish changing to macros for msgstats and msgflags * Add support for Mail-Followup-To and Mail-Reply-To * Add support for profile entry "Mailing-Lists" * let mhn and mhl accept files on standard in, and output to standard out, when filtering files. * Add switch -more to `show' to call moreproc. * Add new command "show" at WhatNow? prompt. * Add command to reverse the action of rmm [-nounlink] -- "urmm"? "umm"? "um"? * Allow user customization of which kinds of text parts in multipart/alternative messages are preferred. It would be nice if one selectable behavior would be to be prompted at runtime for which version to show. * Add a new %-escape that makes temp files more permanent than %f, so that you can use gnuclient -q or netscape -remote on message parts. Put netscape -remote in mhn.defaults for text/html once this is done. * Change all man pages to group all the commandline options together in one section with each as a separate mini-heading. Having to dig through prose to find what a particular option does is a pain in the nads. * Add some way to configure whether you prefer to see text/plain or text/html parts of multipart/alternative messages. * Allow multiple simultaneous differing contexts, probably each tied to a parent (terminal) process. [POSSIBILITIES] MAN PAGES --------- * Update mh-tailor man page. * update default mode in man pages with sed SEQUENCES --------- * Change so you can have more than 26 sequences. Unfortunately, given the way that the bit flags for sequences work, this is not easy. * Maybe add option gracefully handle empty sequences (-force). ENVIRONMENT/PROFILE ------------------- * Maybe add profile entry "Pager" to change the default pager? * Should nmh check for EDITOR or PAGER environment variable? OPTIONS ------- * change switches to accept two dashes (--help) * can we move option checking to its own function? Currently each command is doing that itself. * make the option parsing code dynamic, so that there is no limit to the number of command line arguments (this has been done for most all the commands). * Add switch descriptions to -help output. COMP ---- * add option so that prompter can be used to input addresses, before the real editor is called to edit message. * fix -nowhatnowproc switch. Right now whatnowproc starts the edit session instead of comp, so -nowhatnowproc does nothing. FLIST ----- * add -format option so you can specify the look of the output of flist. * add Flist-Exclude profile component FOLDER ------ * add Folder-Order profile component (same as flist) * add Folder-Exclude profile component FORMATS ------- * add escape %(sequence{foobar}) to detect arbitrary sequences. FORW ---- * Decode RFC-2047 headers in messages included when replying or forwarding. * Merge code for forw and repl. INC --- * Add ability to do filtering (call filterproc) when incorporating mail * Change inc to use libary function folder_addmsg(). MHBUILD ------- * add ability to specify Content-Transfer-Encoding in composition drafts. * remove the code for caching from mhbuild. MHL --- * remove naming hack in mhlsbr.c for adios and done. * add ability to filter parts of the message by calling an external filtering program. * fix internal pager for mhl? MHMAIL ------ * add -attach option (send could use this). This should be done by hooking in mhbuildsbr.c MHN/MHSHOW/MHLIST/MHSTORE ------------------------- * add way so user can tell mhn to use internal method for handling type, such as multipart/mixed. * add way so user can tell mhn to use a certain `proc' such as moreproc, for certain content types. * add support for Content-Disposition header (rfc1806, rfc2183). * merge the two places in which mhshowsbr.c reads display strings. * when storing to a folder, should we save the folder context first, so that storage string of "+" stores to the new folder? MSH --- * change conditional includes in msh.c to use termios.h * Add -version to mshcmd.c for each command. * Change msh to use mbox style files, instead of mmdf. Add options -mbox, -mmdf to choose. *) There are couple calls to copyip() which should be changed to getarguments(). One problem is freeing the string getcopy'ed by getarguments(). PICK ---- * split regex code out into library. * replace regex code with Henry Spencer's regex library. POST ---- * make -msgid the default * factor msgid code into own function PROMPTER -------- * maybe add ability to use prompter just for headers, and then use primary editor for editing message. RCVSTORE -------- * Change rcvstore so that it can store into multiple folders. * Add folder locking. REPL ---- * Decode RFC-2047 headers in messages included when replying or forwarding. * Merge code for forw and repl. SEND/SENDSBR ------------ * Add ability for returned messages from "send -push" to be in MIME format (this is actually a change in mhmail). * make -msgid the default. * Add RFC-2047 encoding support for out-going messages. This will probably require hooking mhparse into sendsbr.c, and doing a complete MIME parsing. Then all handling of Content encoding can be on the backend. SLOCAL ----- * Change slocal to use .slocalrc file, instead of .maildelivery? * Add ability to use regular expressions in header matching. * Add support for Berkeley db. * Clean up output from -debug option. * Add -debuglevel to control the amount of debug info that is output. * Add -debuglog to specify file to save debugging output. * Add -logfile (or -audit) to specify where to record info about successful deliveries. MTA INTERFACE ------------- * Fix locking code. Add lockfile command. * Think about support for DSN (Delivery Status Notification) * Test nmh with qmail. Add qmail's maildir format. * Relax restrictions on what can be done with headers in send/post. * figure out why smail.c and client.c need their own copies of getcpy, copyip, etc... (funny linking problem) GENERAL ------- * see if the various versions of copyfile and copyf can be merged. * Add MH-6.8.4 features into nmh (mostly done). * Maybe should move etcpath to sbr and add to libmh. * collect winsize, struct termio, etc... together into a ttyinfo structure. * change adios to take exit code argument. * use wait3 if not waitpid (maybe) * some of the calls to setjmp/longjmp should be replaced with sigsetjmp/siglongjmp. * replace use of ftell with fgetpos. nmh-1.5/docs/contrib/build_nmh000755 007761 000765 00000022274 11765267273 016400 0ustar00kenhkenh000000 000000 #! /bin/sh # # Configures and builds nmh. # * This script must be invoked from an nmh source directory. # * This script retrieves configuration from the first existing nmh # installation on your $PATH, if any, as well as any $EDITOR/$VISUAL # and $PAGER environment variable settings. # * Unless the -y option is provided, this script then interactively # walks you through confirmation of common configuration settings. # # Typical usage: # The first time you invoke this script, use the -i option to install # nmh in the specified location. The script will walk you through the # common nmh configuration settings. The -v option will cause display # of brief progress indicators. Be sure to add the bin directory of # the install location to your $PATH, if not already there. # Subsequently, invoke this script with the -y option, to use the # relevant configuration settings from the installed nmh without # confirmation. # # Option summary: # First time use: # -i to install nmh # -v to display progress # Subsequent uses, assuming installed nmh bin directory is on $PATH: # -y to accept all configuration options without confirmation # Output control: # -l , default 'build_nmh.log' # Advanced/developer use: # -c to run 'make distcheck' instead of 'make check' # -d to build nmh with debug enabled # -s to use 'make superclean': requires recent autoconf and automake, # see docs/README.developers # -r to build rpm # # On Fedora, at least these rpms must be installed: # gdbm-devel # ncurses-devel # cyrus-sasl-devel, if using sasl # openssl-devel, if using TLS # autoconf and automake, with -s (see docs/README.developers for versions) # rpm-build, with -r #### #### OS-specific setup. #### which=which ldd=ldd locking=dot os=${OSTYPE:-`uname -s`} #### It'd be nice to have configure decide what locking style to use. #### In the meantime, select it manually. To determine what style #### locking your system uses by default, try something like this, #### assuming that strace is installed: #### $ echo test | strace -o /tmp/mail.strace mail -s test $LOGNAME #### Then look in /tmp/mail.strace for fcntl, flock, and lockf system #### calls and opens of dot files in the mail spool. #### These might help but are old: #### https://bugzilla.mozilla.org/show_bug.cgi?id=239013#c9 #### http://www.jwz.org/doc/movemail.html case "$os" in aix) locking=fcntl ;; freebsd*) locking=flock ;; linux* ) locking=fcntl ;; esac #### #### Interpret command arguments. #### check=check debug=0 install=0 logfile=build_nmh.log build_rpm=0 superclean=0 verbose=0 yes=0 usage="usage: $0 [-c to run 'make distcheck' instead of 'make check'] [-d to build nmh with debug enabled] [-i to install nmh] [-l , default '$logfile'] [-r to build rpm] [-s to use 'make superclean': requires recent autoconf and automake] [-v to display progress] [-y to accept all configuration options without confirmation]" while getopts 'cdil:rsvy?' arg; do case $arg in c ) check=distcheck ;; d ) debug=1 ;; i ) install=1 ;; l ) logfile=$OPTARG ;; r ) build_rpm=1 ;; s ) superclean=1 ;; v ) verbose=1 ;; y ) yes=1 ;; '?') echo "$usage"; exit 0 ;; esac done shift `expr $OPTIND - 1` #### No command line arguments are supported. if [ $# -gt 0 ]; then echo "usage: $0" exit 1 fi #### Check to see that we're in a nmh source directory. if grep 'the authors of nmh' COPYRIGHT >/dev/null; then : else echo "$0: not in nmh source directory" exit 1 fi #### #### Set up configure options. Handle options that can have embedded #### spaces (currently just smtpservers) specially. #### #### dotlocking, the usual default, requires chgrp and chmod of inc. installpriv= if [ $install -ge 1 -a `id -u` -ne 0 -a "$OSTYPE" != cygwin ]; then if [ "x$locking" = x -o "$locking" = dot ]; then echo "$0: "'install requires chgrp and chmod 2755' echo 'so will sudo to install. Terminate with Ctrl-C if unacceptable.' installpriv=sudo fi fi #### Here are the config options that we will try to detect, then #### confirm, and finally set. config_prefix=/usr/local/nmh config_locking="$locking" config_mts=smtp config_smtpservers=localhost config_sasl=n config_tls=n config_editor=vi for i in more less most cat; do if which $i >/dev/null 2>&1; then config_pager=$i break fi done config_debug=n if install-mh -check >/dev/null 2>&1; then # Determine config options from installed nmh. mhparam=`which mhparam` mhbin=`dirname "$mhparam"` config_prefix=`cd $mhbin/.. && pwd` mtsconf=`dirname "$mhbin"`/etc/mts.conf if [ -f "$mtsconf" ]; then mts_entry=`grep '^mts:' $mtsconf` if [ "$mts_entry" ]; then mts=`echo $mts_entry | sed -e 's/^mts: *//'` if [ "$mts" -a "$mts" != smtp ]; then config_mts="$mts" fi fi mtsconfservers=`grep '^servers:' $mtsconf` if [ "$mtsconfservers" ]; then servers=`echo $mtsconfservers | sed -e 's/^servers: *//' -e 's/ /\\\ /g'` [ "$servers" ] && config_smtpservers="$servers" fi fi if $ldd $mhbin/inc | grep sasl >/dev/null; then config_sasl=y fi if $ldd $mhbin/inc | grep ssl >/dev/null; then config_tls=y fi fi if [ "$EDITOR" ]; then config_editor="$EDITOR" elif [ "$VISUAL" ]; then config_editor="$VISUAL" fi [ "$PAGER" ] && config_pager="$PAGER" [ $debug -ge 1 ] && config_debug=y if [ $yes -eq 0 ]; then #### Confirm each config setting with user. printf 'Install prefix [%s]: ' $config_prefix read prefix [ "$prefix" ] && config_prefix="$prefix" printf 'Locking type (dot|fcntl|flock|lockf) [%s]: ' $config_locking read locking [ "$locking" ] && config_locking="$locking" printf 'MTS (smtp|sendmail) [%s]: ' $config_mts read mts [ "$mts" ] && config_mts="$mts" if [ "$config_mts" = smtp ]; then printf 'SMTP server(s), space separated [%s]: ' $config_smtpservers read response servers=`echo $response | sed -e 's/ /\\\ /g'` [ "$servers" ] && config_smtpservers="$servers" fi printf 'Cyrus SASL support [%s]: ' $config_sasl read response if [ "$response" = y -o "$response" = Y ]; then config_sasl=y elif [ "$response" = n -o "$response" = N ]; then config_sasl=n fi printf 'TLS support [%s]: ' $config_tls read response if [ "$response" = y -o "$response" = Y ]; then config_tls=y elif [ "$response" = n -o "$response" = N ]; then config_tls=n fi printf 'Default editor [%s]: ' $config_editor read editor [ "$editor" ] && config_editor=$editor printf 'Pager [%s]: ' $config_pager read pager [ "$pager" ] && config_pager=$pager #### Don't confirm debug here: obey the -d option to this script. fi smtpservers= config_opts="--prefix=$config_prefix" [ "$config_locking" ] && \ config_opts="$config_opts --with-locking=$config_locking" [ "$config_mts" -a "$config_mts" != smtp ] && \ config_opts="$config_opts --with-mts=$config_mts" [ "$config_smtpservers" -a "$config_smtpservers" != localhost ] && \ smtpservers="--with-smtpservers=$config_smtpservers" [ "$config_sasl" = y ] && \ config_opts="$config_opts --with-cyrus-sasl" [ "$config_tls" = y ] && \ config_opts="$config_opts --with-tls" [ "$config_editor" ] && \ config_opts="$config_opts --with-editor=$config_editor" [ "$config_pager" ] && \ config_opts="$config_opts --with-pager=$config_pager" [ $config_debug = y ] && \ config_opts="$config_opts --enable-debug" #### #### Clean up, and set up with autoconfig if necessary. #### if [ -f Makefile ]; then [ $verbose -ge 1 ] && echo cleaning . . . if [ $superclean -ge 1 ]; then make superclean >/dev/null else make distclean >/dev/null fi fi /bin/rm -f $logfile if [ -f configure -a -f Makefile.in ]; then : else [ $verbose -ge 1 ] && echo autoconfiguring . . . ./autogen.sh >>$logfile 2>&1 fi #### #### Build. #### [ $verbose -ge 1 ] && echo configuring . . . echo ./configure $config_opts ${smtpservers:+"$smtpservers"} >>$logfile 2>&1 ./configure $config_opts ${smtpservers:+"$smtpservers"} >>$logfile 2>&1 status=$? if [ $status -eq 0 ]; then [ $verbose -ge 1 ] && echo building . . . make >>$logfile 2>&1 status=$? if [ $status -eq 0 ]; then [ $verbose -ge 1 ] && echo testing . . . checkoutput=`make $check 2>>$logfile` status=$? tests_summary=`echo "$checkoutput" | grep tests` if [ "$tests_summary" ]; then echo '===================' >>$logfile echo $tests_summary >>$logfile echo '===================' >>$logfile [ "$check" = distcheck ] && \ echo "$checkoutput" | tail -n 4 >>$logfile fi if [ $status -eq 0 ]; then if [ $install -ge 1 ]; then [ $verbose -ge 1 ] && echo installing . . . ($installpriv make install) >/dev/null 2>>$logfile status=$? fi if [ $status -eq 0 -a $build_rpm -ge 1 ]; then [ $verbose -ge 1 ] && echo building rpm . . . make rpm >/dev/null 2>>$logfile status=$? fi fi fi fi grep 'Error' $logfile grep 'warn' $logfile if [ $status -ne 0 ]; then echo build failed! echo build log is in $logfile fi [ $status -eq 0 -a $verbose -ge 1 ] && echo build completed successfully exit $status nmh-1.5/docs/contrib/nmh.spec000644 007761 000765 00000007703 11765267273 016147 0ustar00kenhkenh000000 000000 # This spec supports two methods of RPM creation: # # 1) Start from an nmh workspace, run configure as desired and then "make rpm". # For example: # $ git clone git://git.savannah.nongnu.org/nmh.git # $ cd nmh # $ ./autogen.sh # $ ./configure --with-cyrus-sasl --with-locking=fcntl && make rpm # # 2) Start with a source RPM and use rpmbuild. Configure options are hard # coded below, but they can be overridden on the rpmbuild command line # with --define 'configure_opts --opt=value [...]'. # For example: # $ rpm -i nmh-1.4-0.fc16.src.rpm # $ rpmbuild --rmsource --rmspec \ # --define '_sysconfdir /usr/local/nmh/etc' \ # --define 'configure_opts --with-cyrus-sasl --with-locking=fcntl' \ # --bb ~/lib/rpmbuild/SPECS/nmh.spec # # If configure has previously been run successfully in the workspace, # it will not be invoked again, even if configure_opts is defined. # # Note that "make rpm" sets _sysconfdir. If configuring to install # anyplace other than the default _sysconfdir, typically /etc, and # you're not using this through "make rpm", be sure to set _sysconfdir. # # With kernel (fcntl, flock, or lockf) locking, or with dot locking # and a lockdir that's writable by the user, bin/inc does not need to # be setgid. This spec assumes that. But if needed, add something # like this to the %files section to make bin/inc setgid: # %attr(2755,-,mail) /usr/local/nmh/bin/inc # # Note that Version cannot contain any dashes. # # The description, summary, and a few other tags were taken from the # nmh.spec used to build the Fedora 15 nmh rpm. Name: nmh Version: %(sed "s/-/_/g" VERSION) %define rawversion %(cat VERSION) Release: 1%{?dist} Summary: A capable mail handling system with a command line interface Group: Applications/Internet License: BSD URL: http://savannah.nongnu.org/projects/nmh BuildRequires: gdbm-devel ncurses-devel %define tarfile nmh-%rawversion.tar.gz Source0: %tarfile Source1: VERSION %define srcdir %(pwd) %description Nmh is an email system based on the MH email system and is intended to be a (mostly) compatible drop-in replacement for MH. Nmh isn't a single comprehensive program. Instead, it consists of a number of fairly simple single-purpose programs for sending, receiving, saving, retrieving and otherwise manipulating email messages. You can freely intersperse nmh commands with other shell commands or write custom scripts which utilize nmh commands. If you want to use nmh as a true email user agent, you'll want to also install exmh to provide a user interface for it--nmh only has a command line interface. %prep if [ ! -f $RPM_SOURCE_DIR/%tarfile ]; then #### The tarfile wasn't already installed and we started with a #### workspace (using make rpm), so get it from there. [ -f %srcdir/%tarfile ] || (cd %srcdir && make dist) cp -p %srcdir/%tarfile $RPM_SOURCE_DIR/%tarfile fi [ -f $RPM_SOURCE_DIR/VERSION ] || cp -p %srcdir/VERSION $RPM_SOURCE_DIR %setup -q -n %name-%rawversion %build if [ -f %srcdir/config.status ]; then echo reusing existing configuration cp -pf %srcdir/config.status . ./config.status else %if %{undefined configure_opts} %define configure_opts --with-cyrus-sasl --with-locking=fcntl %endif %configure %configure_opts fi make all dist %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT gz_manpages='-e ' if find $RPM_BUILD_ROOT -name 'inc.1*' | \ egrep -q '/usr(/lib|/share)?/man/([^/]+/)?man'; then #### brp-compress will gzip the man pages, so account for that. gz_manpages='-e s#\(/man/man./.*\)#\1.gz#' fi #### etc is brought into files using %config{noreplace} find $RPM_BUILD_ROOT -name etc -prune -o ! -type d -print | \ sed -e "s#^$RPM_BUILD_ROOT##" "$gz_manpages" > nmh_files %clean rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/%buildsubdir %files -f nmh_files %defattr(-,root,root,-) %config(noreplace) %_sysconfdir/* nmh-1.5/docs/contrib/replyfilter000755 007761 000765 00000034330 11762736344 016771 0ustar00kenhkenh000000 000000 #!/usr/bin/perl # # replyfilter - A reply filter for nmh # # The idea behind this program is that it will act as a format filter # for nmh. It will try to extract out all text/plain parts and format # them if necessary using a filter program. # # To use this program, configure nmh in the following way (nmh 1.5 or later): # # - Put the path to this program in your .mh_profile under formatproc: # # formatproc: replyfilter # # - Create a mhl reply filter that consists of the following line: # # body:nocomponent,format,nowrap,formatarg="%(trim{content-type})%(putstr)",formatarg="%(trim{content-transfer-encoding})%(putstr)",formatarg=">" # # To decode this a bit: # # body - Output the "body" component # nocomponent - Don't output a component prefix (normally here we use a # component prefix of ">" as a quote character, but we're # going to have replyfilter do that). # nowrap - Don't wrap lines if they exceed the column width # formatarg - Arguments to fmtproc. The first argument is the value of # the Content-type header; the second is the value of the # Content-Transfer-Encoding header. The last "formatarg" # is used as your quoting prefix. Replace it with whatever # you want. # use Mail::Field; use MIME::Head; use MIME::QuotedPrint; use MIME::Base64; use Encode; # # The program we use to format "long" text. Should be capable of reading # from standard input and sending the formatted text to standard output. # $filterprogram = 'par'; # # If the above filter program has problems with some input, use the following # regular expression to remove any problematic input. In this example we # filter out the UTF-8 non-breaking space (U+00A0) because that makes par # mangle the output. Uncomment this if this ends up being a problem for # you, or feel free to add others. # #%filterreplace = ( "\N{U+a0}" => " " ); # # Our output character set. This script assumes a UTF-8 locale, but if you # want to run under a different locale the change it here. # $outcharset = 'utf-8'; # # Maximum column width (used by the HTML converter and to decide if we need # to invoke the filter program # $maxcolwidth = 78; # # Out HTML converter program & arguments # @htmlconv = ('w3m', '-dump', '-cols', $maxcolwidth - 2, '-T', 'text/html', '-O', $outcharset); die "Usage: $0 Content-type content-transfer-encoding quote-prefix\n" if $#ARGV != 2; if ($ARGV[0] ne "") { my $ctype = Mail::Field->new('Content-Type', $ARGV[0]); $content_type = $ctype->type; $charset = $ctype->charset; $boundary = $ctype->boundary; } else { $content_type = 'text/plain'; $charset = 'us-ascii'; } $encoding = $ARGV[1] eq "" ? '7bit' : lc($ARGV[1]); $quoteprefix = $ARGV[2]; # # Set up our output to be in our character set # binmode(STDOUT, ":encoding($outcharset)"); # # The simplest case: if we have a single type of text/plain, send it # to our format subroutine. # if ($content_type eq 'text/plain') { process_text(\*STDIN, $encoding, $charset); exit 0; } # # Alright, here's what we need to do. # # Find any text/plain parts and decode them. Decode them via base64 or # quoted-printable, and feed them to our formatting filter when appropriate. # Put markers in the output for other content types. # ($type) = (split('/', $content_type)); if ($type eq 'multipart') { # # For multipart messages we have to do a little extra. # Eat the MIME prologue (everything up until the first boundary) # if (! defined $boundary || $boundary eq '') { print "No boundary in Content-Type header!\n"; eat_part(\*STDIN); exit 1; } while () { last if match_boundary($_, $boundary); } if (eof(STDIN)) { print "Unable to find boundary in message\n"; exit 1; } } else { undef $boundary; } process_part(\*STDIN, $content_type, $encoding, $charset, $boundary); if ($boundary) { # # Eat the MIME epilog # eat_part(\*STDIN); } exit 0; # # Handled encoded text. I think we can assume if the encoding is q-p # or base64 to feed it into a formatting filter. # sub process_text (*$$;$) { my ($input, $encoding, $charset, $boundary) = @_; my $text, $filterpid, $prefixpid, $finread, $finwrite; my $foutread, $foutwrite, $decoder, $ret, $filterflag; my $text, $maxline = 0; # # In the simple case, just spit out the text prefixed by the # quote character # if ($encoding eq '7bit' || $encoding eq '8bit') { # # Switch the character set to whatever is specified by # the MIME message # binmode($input, ":encoding($charset)"); while (<$input>) { $ret = match_boundary($_, $boundary); if (defined $ret) { binmode($input, ':encoding(us-ascii)'); return $ret; } print $quoteprefix, $_; } return 'EOF'; } else { # # If we've got some other encoding, the input text is almost # certainly US-ASCII # binmode($input, ':encoding(us-ascii)'); $decoder = find_decoder(lc($encoding)); if (! defined $decoder) { return 'EOF'; } } # # Okay, assume that the encoding will make it so that we MIGHT need # to filter it. Read it in; if the lines are too long, filter it # my $chardecode = find_encoding($charset); while (<$input>) { my @lines, $len; last if ($ret = match_boundary($_, $boundary)); $text .= $_; } binmode($input, ':encoding(us-ascii)'); $text = $chardecode->decode(&$decoder($text)); grep { my $len; if (($len = length) > $maxline) { $maxline = $len; }} split(/^/, $text); if (! defined $ret) { $ret = 'EOF'; } if ($maxline <= $maxcolwidth) { # # These are short enough; just output it now as-is # foreach my $line (split(/^/, $text)) { print STDOUT $quoteprefix, $line; } return $ret; } # # We fork a copy of ourselves to read the output from the filter # program and prefix the quote character. # pipe($finread, $finwrite) || die "pipe() failed: $!\n"; pipe($foutread, $foutwrite) || die "pipe() (second) failed: $!\n"; binmode($finread, ":encoding($outcharset)"); binmode($finwrite, ":encoding($outcharset)"); binmode($foutread, ":encoding($outcharset)"); binmode($foutwrite, ":encoding($outcharset)"); if ($filterpid = fork) { # # Close the pipes in the parent that we're not using # close($finread); close($foutwrite); } elsif (defined $filterpid) { # # Close our ununsed filehandles # close($finwrite); close($foutread); # # Dup() down the filehandles to standard input and output # open(STDIN, "<&", $finread) || die "dup(filterin) failed: $!\n"; open(STDOUT, ">&", $foutwrite) || die "dup(filterout) failed: $!\n"; # # Close our copies. # close($finread); close($foutwrite); # # Exec our filter # exec $filterprogram || die "Unable to exec $filterprogram: $!\n"; } else { die "Fork for $filterprogram failed: $!\n"; } # # Fork our output handler. # if ($prefixpid = fork) { # # We don't need these anymore # close($foutread); } elsif (defined $prefixpid) { # # Read from foutwrite, and output (with prefix) to stdout # close($finwrite); while (<$foutread>) { print STDOUT $quoteprefix, $_; } exit 0; } # # Send our input to the filter program # if (%filterreplace) { foreach my $match (keys %filterreplace) { $text =~ s/$match/$filterreplace{$match}/g; } } print $finwrite $text; close($finwrite); waitpid $filterpid, 0; warn "Filter process exited with ", ($? >> 8), "\n" if $?; waitpid $prefixpid, 0; warn "Pipe reader process exited with ", ($? >> 8), "\n" if $?; return $ret; } # # Filter HTML through a converter program # sub process_html (*$$;$) { my ($input, $encoding, $charset, $boundary) = @_; my $filterpid, $prefixpid, $finread, $finwrite; my $foutread, $foutwrite, $decoder, $ret; if (! defined($decoder = find_decoder(lc($encoding)))) { return 'EOF'; } # # We fork a copy of ourselves to read the output from the filter # program and prefix the quote character. # pipe($finread, $finwrite) || die "pipe() failed: $!\n"; pipe($foutread, $foutwrite) || die "pipe() (second) failed: $!\n"; binmode($finread, ":encoding($outcharset)"); binmode($finread, ":encoding($outcharset)"); binmode($foutread, ":encoding($outcharset)"); binmode($foutwrite, ":encoding($outcharset)"); if ($filterpid = fork) { # # Close the pipes in the parent that we're not using # close($finread); close($foutwrite); } elsif (defined $filterpid) { # # Close our ununsed filehandles # close($finwrite); close($foutread); # # Dup() down the filehandles to standard input and output # open(STDIN, "<&", $finread) || die "dup(filterin) failed: $!\n"; open(STDOUT, ">&", $foutwrite) || die "dup(filterout) failed: $!\n"; # # Close our copies. # close($finread); close($foutwrite); # # Exec our converter # exec (@htmlconv) || die "Unable to exec $filterprogram: $!\n"; } else { die "Fork for $htmlconv[0] failed: $!\n"; } # # Fork our output handler. # if ($prefixpid = fork) { # # We don't need these anymore # close($foutread); } elsif (defined $prefixpid) { # # Read from foutwrite, and output (with prefix) to stdout # close($finwrite); while (<$foutread>) { print STDOUT $quoteprefix, $_; } exit 0; } # # Send our input to the filter program # while (<$input>) { last if ($ret = match_boundary($_, $boundary)); print $finwrite (&$decoder($_)); } if (! defined $ret) { $ret = 'EOF'; } close($finwrite); waitpid $filterpid, 0; warn "HTML converter process exited with ", scalar($? >> 8), "\n" if $?; waitpid $prefixpid, 0; warn "Pipe reader process exited with ", $? >> 8, "\n" if $?; return $ret; } # # Decide what to do, based on what kind of content it is. # sub process_part (*$$$$;$) { my ($input, $content_type, $encoding, $charset, $boundary, $name) = @_; my ($type, $subtype) = (split('/', $content_type, -1), ''); if ($type eq 'text') { # # If this is a text part, right now we only deal with # plain and HTML parts. # if ($subtype eq 'plain') { return process_text($input, $encoding, $charset, $boundary); } elsif ($subtype eq 'html') { return process_html($input, $encoding, $charset, $boundary); } else { print ">>> $content_type content\n"; return eat_part($input, $boundary); } } elsif ($type eq 'multipart') { return process_multipart($input, $subtype, $boundary); } else { # # Other types we're not sure what to do with right now # Just put a marker in there # print ">>> $content_type attachment"; if (defined $name) { print ", name=$name"; } print "\n"; return eat_part($input, $boundary); } } # # Process a multipart message. # # When called, we should be right after the beginning of the first # boundary marker. So we should be pointed at header lines which describe # the content of this part # sub process_multipart ($$$) { my ($input, $subtype, $boundary) = @_; my $altout; while (1) { my $encoding, $type, $end, $name, $charset; # # Use the Mail::Header package to read in any headers # corresponding to this part # my $head = Mail::Header->new($input, (MailFrom => 'IGNORE')); # # Extract out any Content-Type, Content-Transfer-Encoding, and # Content-Disposition headers # my $ctype = Mail::Field->extract('Content-Type', $head); my $cte = Mail::Field->extract('Content-Transfer-Encoding', $head); my $cdispo = Mail::Field->extract('Content-Disposition', $head); if (defined $ctype) { $type = $ctype->type; $charset = $ctype->charset; } else { $type = 'text/plain'; $charset = 'us-ascii'; } $encoding = defined $cte ? lc($cte->param('_')) : '7bit'; $name = defined $cdispo ? $cdispo->param('filename') : undef; # # Special handling for multipart/alternative; pick # the "first" one we can handle (which is usually # text/plain) and silently eat the rest, but output a # warning if we can't handle anything. # if ($altout) { $end = eat_part($input, $boundary); } else { my $subboundary = $boundary; my $maintype = (split('/', $type))[0]; if ($maintype eq 'multipart') { $subboundary = $ctype->boundary; # # Go until we find our beginning of this # part # my $subend = eat_part($input, $subboundary); if ($subend ne 'EOP') { print ">>> WARNING: malformed ", "nested multipart\n"; return $subend; } } $end = process_part($input, $type, $encoding, $charset, $subboundary, $name); if ($subtype eq 'alternative' && ! defined $altout && $type eq 'text/plain') { $altout = 1; } # # Since we changed the semantics of $boundary # above for nested multiparts, if we are # handling a nested multipart then find the end # of our current part # if ($maintype eq 'multipart') { $end = eat_part($input, $boundary); } } if ($end eq 'EOM' || $end eq 'EOF') { if ($subtype eq 'alternative' && !defined $altout) { print ">>>multipart/alternative: no suitable ", "parts\n"; } return $end; } } } # # "Eat" a MIME part; consume content until we hit the boundary or EOF # sub eat_part ($$) { my ($input, $boundary) = @_; my $ret; # # If we weren't given a boundary just eat input until EOF # if (! defined $boundary) { while (<$input>) { } return 'EOF'; } # # Otherwise, consume data until we hit our boundary # while (<$input>) { if ($ret = match_boundary($_, $boundary)) { return $ret; } } return 'EOF'; } # # Return the decoder subroutine to use # sub find_decoder ($) { my ($encoding) = @_; if ($encoding eq '7bit' || $encoding eq '8bit') { return \&null_decoder; } elsif ($encoding eq 'base64') { return \&decode_base64; } elsif ($encoding eq 'quoted-printable') { return \&decode_qp; } else { warn "Unknown encoding: $encoding\n"; return undef; } } sub null_decoder ($) { my ($input) = @_; return $input; } # # Match a line against the boundary string # sub match_boundary($$) { my ($line, $boundary) = @_; return if ! defined $boundary; if (substr($line, 0, 2) eq '--') { $line =~ s/[ \t\r\n]+\Z//; if ($line eq "--$boundary") { return 'EOP'; } elsif ($line eq "--$boundary--") { return 'EOM'; } } return undef; } nmh-1.5/config/config.c000644 007761 000765 00000017700 11765267273 014775 0ustar00kenhkenh000000 000000 /* * config.c -- master nmh configuration file * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include #include #include #define nmhbindir(file) NMHBINDIR#file #define nmhetcdir(file) NMHETCDIR#file #define nmhlibdir(file) NMHLIBDIR#file /* * Find the location of a format or configuration * file, and return its absolute pathname. * * 1) If already absolute pathname, then leave unchanged. * 2) Next, if it begins with ~user, then expand it. * 3) Next, check in nmh Mail directory. * 4) Next, check in nmh `etc' directory. * */ char * etcpath (char *file) { static char epath[PATH_MAX]; char *cp; char *pp; struct passwd *pw; context_read(); switch (*file) { case '/': /* If already absolute pathname, return it */ return file; case '~': /* Expand ~username */ if ((cp = strchr(pp = file + 1, '/'))) *cp++ = '\0'; if (*pp == '\0') { pp = mypath; } else { if ((pw = getpwnam (pp))) pp = pw->pw_dir; else { if (cp) *--cp = '/'; goto try_it; } } snprintf (epath, sizeof(epath), "%s/%s", pp, cp ? cp : ""); if (cp) *--cp = '/'; if (access (epath, R_OK) != NOTOK) return epath; /* else fall */ try_it: default: /* Check nmh Mail directory */ if (access ((cp = m_mailpath (file)), R_OK) != NOTOK) return cp; } /* Check nmh `etc' directory */ snprintf (epath, sizeof(epath), nmhetcdir(/%s), file); return (access (epath, R_OK) != NOTOK ? epath : file); } /* * Standard yes/no switches structure */ struct swit anoyes[] = { { "no", 0 }, { "yes", 0 }, { NULL, 0 } }; /* * nmh constants */ /* initial profile for new users */ char *mh_defaults = nmhetcdir (/mh.profile); /* default name of user profile */ char *mh_profile = ".mh_profile"; /* name of current message "sequence" */ char *current = "cur"; /* standard component files */ char *components = "components"; /* comp */ char *replcomps = "replcomps"; /* repl */ char *replgroupcomps = "replgroupcomps"; /* repl -group */ char *forwcomps = "forwcomps"; /* forw */ char *distcomps = "distcomps"; /* dist */ char *rcvdistcomps = "rcvdistcomps"; /* rcvdist */ char *digestcomps = "digestcomps"; /* forw -digest */ /* standard format (filter) files */ char *mhlformat = "mhl.format"; /* show */ char *mhlreply = "mhl.reply"; /* repl -filter */ char *mhlforward = "mhl.forward"; /* forw -filter */ char *draft = "draft"; char *inbox = "Inbox"; char *defaultfolder = "inbox"; char *pfolder = "Current-Folder"; char *usequence = "Unseen-Sequence"; char *psequence = "Previous-Sequence"; char *nsequence = "Sequence-Negation"; /* profile entries for storage locations */ char *nmhstorage = "nmh-storage"; char *nmhcache = "nmh-cache"; char *nmhprivcache = "nmh-private-cache"; /* profile entry for external ftp access command */ char *nmhaccessftp = "nmh-access-ftp"; char *mhlibdir = NMHLIBDIR; char *mhetcdir = NMHETCDIR; /* * nmh not-so constants */ /* * Default name for the nmh context file. */ char *context = "context"; /* * Default name of file for public sequences. If NULL, * then nmh will use private sequences by default, unless the * user defines a value using the "mh-sequences" profile entry. */ #ifdef NOPUBLICSEQ char *mh_seq = NULL; #else char *mh_seq = ".mh_sequences"; #endif /* * nmh globals */ char ctxflags; /* status of user's context */ char *invo_name; /* command invocation name */ char *mypath; /* user's $HOME */ char *defpath; /* pathname of user's profile */ char *ctxpath; /* pathname of user's context */ struct node *m_defs; /* profile/context structure */ /* * nmh processes */ /* * This is the program to process MIME composition files */ char *buildmimeproc = nmhbindir (/mhbuild); /* * This is the program to `cat' a file. */ char *catproc = "/bin/cat"; /* * mhl runs this program as a visual-end. */ char *faceproc = NULL; /* * This program is usually called directly by users, but it is * also invoked by the post program to process an "Fcc", or by * comp/repl/forw/dist to refile a draft message. */ char *fileproc = nmhbindir (/refile); /* * This program is used to optionally format the bodies of messages by * "mhl". */ char *formatproc = NULL; /* * This program is called to incorporate messages into a folder. */ char *incproc = nmhbindir (/inc); /* * When a user runs an nmh program for the first time, this program * is called to create his nmh profile, and mail directory. */ char *installproc = nmhlibdir (/install-mh); /* * This is the default program invoked by a "list" response * at the "What now?" prompt. It is also used by the draft * folder facility in comp/dist/forw/repl to display the * draft message. */ char *lproc = DEFAULT_PAGER; /* * This is the path for the Bell equivalent mail program. */ char *mailproc = nmhbindir (/mhmail); /* * This is used by mhl as a front-end. It is also used * by mhn as the default method of displaying message bodies * or message parts of type text/plain. */ char *moreproc = DEFAULT_PAGER; /* * This is the program (mhl) used to filter messages. It is * used by mhn to filter and display the message headers of * MIME messages. It is used by repl/forw (with -filter) * to filter the message to which you are replying/forwarding. * It is used by send/post (with -filter) to filter the message * for "Bcc:" recipients. */ char *mhlproc = nmhlibdir (/mhl); /* * This is the super handy BBoard reading program, which is * really just the nmh shell program. */ char *mshproc = nmhbindir (/msh); /* * This program is called to pack a folder. */ char *packproc = nmhbindir (/packf); /* * This is the delivery program called by send to actually * deliver mail to users. This is the interface to the MTS. */ char *postproc = nmhlibdir (/post); /* * This is program is called by slocal to handle * the action `folder' or `+'. */ char *rcvstoreproc = nmhlibdir (/rcvstore); /* * This program is called to remove a message by rmm or refile -nolink. * It's usually empty, which means to rename the file to a backup name. */ char *rmmproc = NULL; /* * This program is usually called by the user's whatnowproc, but it * may also be called directly to send a message previously composed. */ char *sendproc = nmhbindir (/send); /* * This is the path to the program used by "show" * to display non-text (MIME) messages. */ char *showmimeproc = nmhbindir (/mhshow); /* * This is the default program called by "show" to filter * and display standard text (non-MIME) messages. It can be * changed to a pager (such as "more" or "less") if you prefer * that such message not be filtered in any way. */ char *showproc = nmhlibdir (/mhl); /* * This program is called by vmh as the back-end to the window management * protocol */ char *vmhproc = nmhbindir (/msh); /* * This program is called after comp, et. al., have built a draft */ char *whatnowproc = nmhbindir (/whatnow); /* * This program is called to list/validate the addresses in a message. */ char *whomproc = nmhbindir (/whom); /* * This is the editor invoked by the various message * composition programs. It SHOULD be a full screen * editor, such as vi or emacs, but any editor will work. */ char *defaulteditor = DEFAULT_EDITOR; /* * This is the global nmh alias file. It is somewhat obsolete, since * global aliases should be handled by the Mail Transport Agent (MTA). */ char *AliasFile = nmhetcdir (/MailAliases); /* * File protections */ /* * Folders (directories) are created with this protection (mode) */ char *foldprot = "700"; /* * Every NEW message will be created with this protection. When a * message is filed it retains its protection, so this only applies * to messages coming in through inc. */ char *msgprot = "600"; nmh-1.5/config/version.c000644 007761 000765 00000000177 11765270265 015210 0ustar00kenhkenh000000 000000 char *version_str = "nmh-1.5 [compiled on pendragon.internal at Mon Jun 11 00:14:45 EDT 2012]"; char *version_num = "nmh-1.5"; nmh-1.5/config/version.sh000755 007761 000765 00000001353 11713401273 015364 0ustar00kenhkenh000000 000000 #!/bin/sh # # version.sh -- script to create version string(s) for nmh. # # You need to pass the script the version number to use. # if [ -z "$1" ]; then echo "usage: version.sh VERSION" 1>&2 exit 1 fi VERSION=$1 OFS="$IFS" IFS=: HOSTNAME=unknown # Find out the name of the host we are compiling on for prog in uname hostname do for dir in $PATH do if [ ! -f $dir/$prog ]; then continue fi case $prog in uname) HOSTNAME=`$prog -n` ;; hostname) HOSTNAME=`$prog` ;; esac break done if [ X"$HOSTNAME" != X -a X"$HOSTNAME" != Xunknown ]; then break fi done IFS=" " echo "char *version_str = \"nmh-$VERSION [compiled on $HOSTNAME at `date`]\";" echo "char *version_num = \"nmh-$VERSION\";"