The primary goal was to only indent with tabs and not mix them with spaces.
Also, no more tabs should appear past the first printable char on each line.
Now editing the sources will be much easier, no matter which editor one uses,
and rearranging won't break aligned code.
(Beware, the changeset is huge, but the `diff -w' changes are moderate.)
.SUFFIXES:
# all files in this directory included in the distribution
-DIST = ChangeLog COPYRIGHT DATE INSTALL MACHINES README VERSION \
- ChangeLog install-sh mkinstalldirs Makefile.in aclocal.m4 \
- acconfig.h config.h.in configure.ac configure stamp-h.in \
+DIST = ChangeLog COPYRIGHT DATE INSTALL MACHINES README VERSION \
+ ChangeLog install-sh mkinstalldirs Makefile.in aclocal.m4 \
+ acconfig.h config.h.in configure.ac configure stamp-h.in \
config.sub config.guess
# subdirectories in distribution
Makefile: Makefile.in ../config.status
cd .. && ./config.status $(subdir)/$@
-
+
distdir = ../`cat ../distname`/$(subdir)
nmhdist: $(DIST)
@echo "Copying distribution files in $(subdir)"
-
/*
* config.c -- master nmh configuration file
*
* 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;
+ static char epath[PATH_MAX];
+ char *cp;
#ifdef MHRC
- char *pp;
- struct passwd *pw;
+ char *pp;
+ struct passwd *pw;
#endif
#ifdef MHRC
- context_read();
+ context_read();
#endif
- switch (*file) {
- case '/':
- /* If already absolute pathname, return it */
- return file;
+ switch (*file) {
+ case '/':
+ /* If already absolute pathname, return it */
+ return file;
#ifdef MHRC
- 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;
+ 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 = '/';
+ snprintf (epath, sizeof(epath), "%s/%s", pp, cp ? cp : "");
+ if (cp)
+ *--cp = '/';
- if (access (epath, R_OK) != NOTOK)
- return epath; /* else fall */
+ if (access (epath, R_OK) != NOTOK)
+ return epath; /* else fall */
try_it:
#endif /* MHRC */
- default:
- /* Check nmh Mail directory */
- if (access ((cp = m_mailpath (file)), R_OK) != NOTOK)
- return cp;
- }
+ 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);
+ /* 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 }
+ { "no", 0 },
+ { "yes", 0 },
+ { NULL, 0 }
};
-/*
+/*
* nmh constants
*/
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 */
+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 *mhlformat = "mhl.format"; /* show */
+char *mhlreply = "mhl.reply"; /* repl -filter */
+char *mhlforward = "mhl.forward"; /* forw -filter */
char *draft = "draft";
char *mhlibdir = NMHLIBDIR;
char *mhetcdir = NMHETCDIR;
-/*
+/*
* nmh not-so constants
*/
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 */
+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
*/
/*
* mhl runs this program as a visual-end.
*/
-
char *faceproc = NULL;
/*
* also invoked by the spost program to process an "Fcc", or by
* comp/repl/forw/dist to refile a draft message.
*/
-
char *fileproc = nmhbindir (/refile);
-/*
+/*
* 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);
/*
* folder facility in comp/dist/forw/repl to display the
* draft message.
*/
-
char *lproc = "more";
/*
* This is the path for the Bell equivalent mail program.
*/
-
char *mailproc = nmhbindir (/mhmail);
/*
* by mhshow as the default method of displaying message bodies
* or message parts of type text/plain.
*/
-
char *moreproc = "more";
-/*
+/*
* This is the program (mhl) used to filter messages. It is
* used by mhshow to filter and display the message headers of
* MIME messages. It is used by repl/forw (with -filter)
* It is used by send/spost (with -filter) to filter the message
* for "Bcc:" recipients.
*/
-
char *mhlproc = nmhlibdir (/mhl);
-/*
- * This program is called to pack a folder.
+/*
+ * 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 (/spost);
/*
* This is program is called by slocal to handle
* the action `folder' or `+'.
*/
-
char *rcvstoreproc = nmhlibdir (/rcvstore);
-/*
- * This program is called to remove a folder.
+/*
+ * This program is called to remove a folder.
*/
-
char *rmfproc = nmhbindir (/rmf);
-/*
+/*
* 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);
/*
* 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 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 sendmail interface to use for sending mail.
*/
-
char *sendmail = SENDMAILPATH;
/*
* The prefix that is prepended to the name of message files when they
* are "removed" by rmm. This should typically be `,' or `#'.
*/
-
char *backup_prefix = ",";
/*
* composition programs. It SHOULD be a full screen
* editor, such as vi or emacs, but any editor will work.
*/
-
char *defaulteditor = "vi";
/*
*/
char *altmsglink = "@";
-/*
+/*
* 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";
/*
* message is filed it retains its protection, so this only applies
* to messages coming in through inc.
*/
-
char *msgprot = "600";
-
#
if [ -z "$1" ]; then
- echo "usage: version.sh VERSION" 1>&2
- exit 1
+ echo "usage: version.sh VERSION" 1>&2
+ exit 1
fi
VERSION=$1
# 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
+ 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
- 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=" "
fi
fi
] )
-
+
echo "configuring for AC_PACKAGE_NAME-AC_PACKAGE_VERSION"
AC_SUBST(VERSION,AC_PACKAGE_VERSION)dnl
dnl because gcc 4 now produces a lot of new warnings which are probably mostly
dnl spurious and which in any case we don't want to deal with now.
if test "$nmh_cv_has_noptrsign" = "yes"; then
- nmh_gcc_warnflags="-Wall -Wno-pointer-sign"
+ nmh_gcc_warnflags="-Wall -Wno-pointer-sign"
else
- nmh_gcc_warnflags="-Wall"
+ nmh_gcc_warnflags="-Wall"
fi
if test -n "$auto_cflags"; then
else
if test -z "$LDFLAGS"; then
case "$build_os" in
- darwin*)
- LDFLAGS=
+ darwin*)
+ LDFLAGS=
+ ;;
+ *)
+ LDFLAGS=-s
;;
- *)
- LDFLAGS=-s
- ;;
esac
fi
if test -n "$GCC"; then
fi
fi
-AC_C_CONST dnl Does compiler support `const'.
+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_LEX dnl Check for lex/flex
+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_LEX dnl Check for lex/flex
dnl Look for `cut'
pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
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,
+ 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 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,
+ 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
langinfo.h wchar.h wctype.h iconv.h netdb.h \
sys/param.h sys/time.h sys/utsname.h sys/stream.h \
arpa/inet.h arpa/ftp.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
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 <libio.h>.]) ]) ])
+ AC_DEFINE(LINUX_STDIO,1,[Use the Linux _IO_*_ptr defines from <libio.h>.]) ]) ])
AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1,
[Define to 1 if `struct winsize' requires <sys/ptem.h>.]),,
dnl Look for the initgroups() declaration. On AIX 4.[13], Solaris 4.1.3, and
dnl ULTRIX 4.2A the function is defined in libc but there's no declaration in
-dnl any system header.
+dnl any system header.
dnl
dnl On Solaris 2.[456], the declaration is in <grp.h>. On HP-UX 9-11 and
dnl (reportedly) FreeBSD 3.[23], it's in <unistd.h>. Any other locations we
dnl need to check?
AH_TEMPLATE(INITGROUPS_HEADER, [Define to the header containing the declaration of `initgroups'.])
AC_EGREP_HEADER(initgroups, grp.h, AC_DEFINE(INITGROUPS_HEADER, <grp.h>),
- AC_EGREP_HEADER(initgroups, unistd.h,
+ AC_EGREP_HEADER(initgroups, unistd.h,
AC_DEFINE(INITGROUPS_HEADER, <unistd.h>)))
dnl On AIX 4.1, snprintf() is defined in libc.a but there's no prototype in
dnl seems to work perfectly and IBM apparently uses it in internal code).
dnl Anyhow, if we omit our own snprintf() and vsnprintf() prototypes when we
dnl HAVE_SNPRINTF, we get a billion warnings at compile time. Use the C
-dnl preprocessor to preprocess stdio.h and make sure that there's actually a
-dnl prototype.
+dnl preprocessor to preprocess stdio.h and make sure that there's actually a
+dnl prototype.
AC_EGREP_HEADER(snprintf, stdio.h, AC_DEFINE(HAVE_SNPRINTF_PROTOTYPE,1,
[Define to 1 if <stdio.h> has a prototype for snprintf().]))
nmh_cv_decl_ospeed_include_defines,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#if HAVE_TERMIOS_H
-#include <termios.h>
+# include <termios.h>
#endif
#if HAVE_TERMCAP_H
-#include <termcap.h>
+# include <termcap.h>
#endif]], [[ospeed = 0;]])],
nmh_cv_decl_ospeed_include_defines=yes,nmh_cv_decl_ospeed_include_defines=no)])
-
+
if test $nmh_cv_decl_ospeed_include_defines = no; then
AC_CACHE_CHECK(if you must define ospeed,
nmh_cv_decl_ospeed_must_define,
[[extern short ospeed; ospeed = 0;]])],
nmh_cv_decl_ospeed_must_define=yes,nmh_cv_decl_ospeed_must_define=no)])
fi
-
+
AH_TEMPLATE(HAVE_OSPEED, [Define to 1 if your termcap library has the ospeed variable.])
if test $nmh_cv_decl_ospeed_include_defines = yes; then
AC_DEFINE(HAVE_OSPEED)dnl
[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);
+ 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
[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);
+ 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
/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 && \
+ grep '#[ ]*define[ ][ ]*SIG[0-9A-Z]*[ ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \
break
done
nmh_cv_path_signal_h=$SIGNAL_H
sunos4*)
AC_DEFINE(BSD42)
;;
- freebsd*)
+ freebsd*)
AC_DEFINE(BSD42)
;;
netbsd*)
dnl OUTPUT MAKEFILES
dnl ----------------
AC_CONFIG_FILES(Makefile config/Makefile h/Makefile sbr/Makefile uip/Makefile \
- etc/Makefile docs/Makefile man/Makefile)
+ etc/Makefile docs/Makefile man/Makefile)
AC_CONFIG_COMMANDS([stamp],[test -z "$CONFIG_HEADERS" || echo > stamp-h])
AC_OUTPUT
sendmail path : ${sendmailpath}
file locking type : ${LOCKTYPE}
-email address masq. : ${masquerade}
+address masquerading : ${masquerade}
"
prev=${COMP_WORDS[COMP_CWORD-1]}
command=$1
- orig_opts=$(shopt -p extglob)
+ orig_opts=$(shopt -p extglob)
shopt -s extglob
# Get the folder, if specified
do
case "${COMP_WORDS[i]}" in
\++([a-zA-Z_]) )
- folder=${COMP_WORDS[i]}
+ folder=${COMP_WORDS[i]}
origfolder=$( folder -f )
;;
esac
done
- case $current in
- -* )
+ case $current in
+ -* )
# Command-line switches for the most common commands.
case $command in
- ali )
+ ali )
# no sequences or messages
options=(-alias -list -nolist -normalize -nonormalize -user
-nouser -version -help)
;;
- burst )
+ burst )
options=(-inplace -noinplace -quiet -noquiet -verbose
-noverbose -version -help)
;;
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
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 mhparam mhpath mhshow mhstore msgchk next packf pick prev prompter rcvdist rcvpack rcvstore rcvtty refile repl rmf rmm scan send sendfiles show slocal sortm whatnow whom
+[ "$have" ] && complete -F _nmh ali anno burst comp dist flist flists folder folders forw inc mark mhbuild mhl mhlist mhmail mhparam mhpath mhshow mhstore msgchk next packf pick prev prompter rcvdist rcvpack rcvstore rcvtty refile repl rmf rmm scan send sendfiles show slocal sortm whatnow whom
Thu Feb 20 22:57:33 1986 /mtr <mrose@nrtc-gremlin>
-
+
MH 6.4 #1[UCI] (nrtc-gremlin) made available to Van Jacobson
for inclusion in 4.3BSD UNIX
Wed Feb 5 11:25:05 1986 /mtr <mrose@nrtc-gremlin>
-
+
MH 6.3 #1[UCI] (nrtc-gremlin) is official, still awaiting Berkeley
enhancements
Wed Oct 9 19:49:04 1985 /mtr <mrose@nrtc-gremlin>
- uip/send.c: fix bogus annotation handling, e.g.,
+ 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)
Tue Mar 26 18:32:49 1985 /mtr (agent: Marshall Rose) <mh@uci-icsa>
- conf/{config/mts.c,tailor/READ-ME}, config/aliasbr.h, mts/mts.h,
+ 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:32:49 1985 /mtr (agent: Marshall Rose) <mh@uci-icsa>
- conf/{config/mts.c,tailor/READ-ME}, config/aliasbr.h, mts/mts.h,
+ 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
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) <uci@udel-dewey>
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) <uci@udel-dewey>
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) <mh@uci-750a>
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
----------------------------------------------------------------------
-
+
Subject: Table of Contents
From: Bill Wohler <wohler at newt.com>
Date: Sat, 3 Mar 2001 11:29:16 -0800
Removing duplicate messages (Perl)
------------------------------
-
+
Subject: Viewing This Article
From: Bill Wohler <wohler at newt.com>
Date: Mon, 27 Nov 1995 14:44:19 -0800
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 *****
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 <wohler at newt.com>
Date: Sun, 23 Sep 2007 23:51:52 -0700
http://www.gnu.org/software/mailutils/.
------------------------------
-
+
Subject: !01.03 Where can I get MH?
From: Bill Wohler <wohler at newt.com>
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
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 <wohler at newt.com>
Date: Sun, 23 Sep 2007 23:51:41 -0700
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://www.faqs.org/faqs/usenet/signature-faq/
------------------------------
-
+
Subject: 01.05 What other MH software is available?
From: Stephen Gildea <gildea at stop.mail-abuse.org>, Bill Wohler <wohler at newt.com>
Date: Thu, 19 May 2005 21:20:57 -0700
[MH-E has had these capabilities since version 7.0 so mew is
obsolete if you use MH-E. --Ed]
-From: James Perkins <jamesp at sp-eug.com>
+From: James Perkins <jamesp at sp-eug.com>
Date: Fri, 1 Jan 1993 00:00:00 -0800
Vmh is designed for people using the bulletin-board features of MH,
compile nmh with the Cygwin tools (http://www.cygwin.com/).
------------------------------
-
+
Subject: !01.06 How can I print a MH manual?
From: Bill Wohler <wohler at newt.com>, Jos Vos <jos at bull.nl>
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
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 <wohler at newt.com>
Date: Wed, 29 Sep 2004 00:12:42 -0700
http://sourceforge.net/tracker/?atid=113357&group_id=13357
------------------------------
-
+
Subject: 01.08 How can I convert from my mailer to MH?
From: Mike Sutton <mws115 at llcoolj.dayton.saic.com>
Date: 7 Jul 1995 10:03:50 GMT
See also MH book second edition (Appendix D).
------------------------------
-
+
Subject: 01.09 What is the copyright status of nmh?
From: Richard Coleman <coleman at math.gatech.edu>
Date: Mon, 10 Oct 2005 18:16:58 -0700
If you have a computer running Unix, you can probably run MH.
------------------------------
-
+
Subject: 02.02 How do I build MH?
From: Bill Wohler <wohler at newt.com>
Date: Sun, 8 Sep 1996 15:13:12 -0700
info.
------------------------------
-
+
Subject: 02.03 What options should I use?
From: Bill Wohler <wohler at newt.com>
Date: Tue, 1 Dec 1992 00:00:00 -0800
tools like from work.
------------------------------
-
+
Subject: 02.04 What do I need to do to use POP?
From: Bill Wohler <wohler at newt.com>
Date: Sun, 8 Sep 1996 23:31:01 -0700
configuration and recompile:
------------------------------
-
+
Subject: 02.05 Does MH support IMAP?
From: Lyndon Nerenberg <lyndon at MessagingDirect.COM>
Date: 27 Jul 1999 11:33:39 -0600
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
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 <jromine at ics.uci.edu>
Date: Fri, 1 Jan 1993 00:00:00 -0800
(See "What mail filters are available?")
------------------------------
-
+
Subject: 02.07 How can I build MH on Solaris 2?
From: Richard Coleman <coleman at math.gatech.edu>
Date: Tue, 20 Jan 1998 02:19:58 -0500
-
+
nmh builds out of the box on Solaris.
From: Bill Wohler <wohler at newt.com>
MH configuration.
------------------------------
-
+
Subject: 02.08 How can I build MH on Linux?
From: Richard Coleman <coleman at math.gatech.edu>
Date: Tue, 20 Jan 1998 02:19:58 -0500
please let me know if they are missing.
------------------------------
-
+
Subject: 02.09 How can I build MH on IRIX?
From: Richard Coleman <coleman at math.gatech.edu>
Date: Tue, 20 Jan 1998 02:19:58 -0500
(See "IRIX config file") below.
------------------------------
-
+
Subject: 02.10 How can I get MH to interpret the Content-Length field?
From: Casper H.S. Dik <Casper.Dik at Holland.Sun.COM>
Date: Sun, 8 Sep 1996 15:38:30 -0700
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 <wohler at newt.com>
Date: Sun, 8 Sep 1996 15:50:54 -0700
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 <tedr at hood.sd.com>
around line 613.
------------------------------
-
+
Subject: 02.13 Is there a patch to fix this or that?
From: Kimmo Suominen <kim at tac.nyc.ny.us>
Date: Sat, 3 Mar 2001 13:40:35 -0800
gw.com>.
------------------------------
-
+
Subject: 02.14 How can I build MH on OS/2?
From: Sanjay Aiyagari <sanjay at sandbox.snetnsa.com>
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" <csg at eng.sun.com>
Date: 27 May 1997 07:24:34 GMT
.mailboxlist file in your home directory.
------------------------------
-
+
Subject: 02.16 How can I build MH on Windows?
From: Satyaki Das <satyaki at theforce.stanford.edu>
Date: Wed, 19 Jun 2002 20:57:19 -0700
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.
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 <el at lisse.na>
Date: Sun, 05 Jun 2005 13:43:19 +0100
I have submitted patches to nmh-workers.
------------------------------
-
+
Subject: 03.02 How would one go about reading Usenet with MH?
From: Bill Wohler <wohler at newt.com>
Date: Sun, 26 Nov 1995 12:32:09 -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 <jpeek at jpeek.com>
Date: Mon, 1 Mar 1993 00:00:00 -0800
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 <anthony at aaii.oz.au>
Date: Sun, 1 May 1994 00:00:00 -0800
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 <jpeek at jpeek.com>
Date: Mon, 1 Aug 1994 00:00:00 -0800
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 <coleman at math.gatech.edu>
Date: Tue, 20 Jan 1998 02:19:58 -0500
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 <coleman at math.gatech.edu>
Date: Tue, 20 Jan 1998 02:19:58 -0500
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
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
(See also "Why does inc hang (on Sun)?")
------------------------------
-
+
Subject: 03.10 Can I read my mail with a Web browser?
From: Jerry Heyman <jerry@fourwinds.cx>
Date: Sat, 09 Oct 2004 12:41:03 -0400
http://www.mhonarc.org/
------------------------------
-
+
Subject: 03.11 How can I run inc automatically with POP?
From: Bill Wohler <wohler at newt.com>
Date: Mon, 27 Nov 1995 12:23:51 -0800
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
so that MH uses dotfile locking rather than FLOCK or LOCKF.
------------------------------
-
+
Subject: 03.13 How can I get POP to work?
From: Jonathan George <jmg at hpopd.pwd.hp.com>
Date: Tue, 23 Apr 1996 10:23:16 GMT
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 <joel at panacea.null.org>
Date: Tue, 13 Nov 2001 16:49:04 +1100
mhn-charset-iso-8859-1: %s # MH
------------------------------
-
+
Subject: 03.15 How do I turn off of all the mhshow (mhn) prompts?
From: Bill Wohler <wohler at newt.com>
Date: Sun, 11 Mar 2001 11:33:10 -0800
In nmh, use mhshow -nopause.
-
+
From: Larry Daffner <ldaffner at convex.com>
Date: 27 Mar 1996 16:53:39 -0600
worth reading.
------------------------------
-
+
Subject: 03.16 Why is inc splitting messages improperly?
From: Mayank Choudhary <micky at eng.sun.com>
Date: Mon, 29 Apr 1996 09:39:29 -0700
is found within the body, inc splits the message.
Add the following line to your .forward
-
+
"|/usr/bin/mailcompat <user-name>"
-
+
where user-name is your login-id.
See mailcompat(1) for more information.
------------------------------
-
+
Subject: 03.17 Can MH thread messages?
From: "John W. Coomes" <jcoomes at delirius.cs.uiuc.edu>
Date: 30 Apr 1997 13:02:10 -0500
sortm -textfield subject
------------------------------
-
+
Subject: 03.18 How can I avoid reading the HTML version of the message?
From: Bill Wohler <wohler at gbr.newt.com>
Date: 23 Jun 2000 10:19:34 -0700
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 <wohler at gbr.newt.com>
Date: Mon, 5 Mar 2001 09:12:15 -0800
the man pages for more details.
------------------------------
-
+
Subject: 03.20 How do I view HTML attachments with Netscape?
From: Bill Wohler <wohler at gbr.newt.com>
Date: Mon, 5 Mar 2001 09:58:05 -0800
M-w and go back to reading mail.
------------------------------
-
+
Subject: 03.21 Fixing folders: unable to allocate storage for msgstats
From: Pete Phillips <pete at smtl.co.uk>
Date: 30 Jan 2003 03:33:57 -0800
fixed the problem.
------------------------------
-
+
Subject: 03.22 How do I recursively list message attachments?
From: Joel Reicher <joel at panacea.null.org>
Date: 31 Oct 2001 00:36:14 +1100
env MHSTORE=mhn.rec mhstore
------------------------------
-
+
Subject: 03.23 Why do folder and flist overlook some of my sub-folders?
From: Richard Coleman <coleman at math.gatech.edu>
Date: Mon, 10 Oct 2005 18:14:24 -0700
Yes, see $MHLIB/packmbox.
------------------------------
-
+
Subject: 04.02 Can I append MH messages to a GNU Emacs rmail BABYL-format file?
From: Bill Wohler <wohler at newt.com>
Date: Fri, 1 Mar 1991 13:03:15 -0800
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 <coleman at math.gatech.edu>
Date: Tue, 20 Jan 1998 02:19:58 -0500
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 <jpeek at jpeek.com>
Date: Mon, 1 May 1995 00:00:00 -0800
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 <wohler at newt.com>
Date: Sun, 23 Sep 2007 18:35:53 -0700
http://www.webglimpse.org/
------------------------------
-
+
Subject: 04.06 How can I remove duplicate messages?
From: Bill Wohler <wohler at newt.com>
Date: Sun, 17 Oct 2004 13:04:57 -0700
not require that you first sort the folder.
------------------------------
-
+
Subject: 04.07 How can I remove holes in numbering?
From: Bill Wohler <wohler at newt.com>
went away.
------------------------------
-
+
Subject: 05.02 How do I include messages in repl with or without ">"?
From: Richard Coleman <coleman at math.gatech.edu>
Date: Tue, 20 Jan 1998 02:19:58 -0500
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 <wohler at newt.com>
Date: Fri, 1 Mar 1991 13:03:15 -0800
Alternate-Mailboxes: asriniva
------------------------------
-
+
Subject: 05.04 How can I include my signature?
From: Eric W. Ziegast <ziegast at uunet.uu.net>,
Hardy Mayer <hardy at golem.ps.uci.edu>
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 <jromine at ics.uci.edu>
Date: Mon, 1 May 1995 00:00:00 -0800
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 <jpeek at jpeek.com>, Bill Wohler <wohler at newt.com>
Date: Fri, 1 Mar 1991 13:03:15 -0800
works beautifully with MIME-capable mail readers, especially exmh.
------------------------------
-
+
Subject: 05.07 How can I change my return address?
From: Bill Wohler <wohler at newt.com>
Date: Tue, 1 Dec 1992 00:00:00 -0800
Reply-To: jack@newt.com
------------------------------
-
+
Subject: 05.08 How can I change my From header?
From: Bill Wohler <wohler at newt.com>
Date: Mon, 27 Nov 1995 11:40:50 -0800
thinks is your real address.
------------------------------
-
+
Subject: 05.09 How can I save a copy of all messages I send?
From: Ping Huang <pshuang at sgihub.corp.sgi.com>
Date: Mon, 18 Dec 1995 17:51:33 -0800
as sendmail's--it doesn't include the date.
------------------------------
-
+
Subject: 05.10 Can the folder in Fcc: be dynamically specified?
From: Andy Rabagliati <andyr at wizzy.com>
Date: Mon, 1 Aug 1994 00:00:00 -0800
for incoming and outgoing mail.
------------------------------
-
+
Subject: 05.11 Can I post secure/encryped mail?
From: Bill Wohler <wohler at newt.com>
Date: Thu, 19 May 2005 18:06:39 -0700
for details.
------------------------------
-
+
Subject: 05.12 How can I send multi-media (MIME) attachments?
From: Brian Exelbierd <bex at ncsu.edu>
Date: Mon, 09 Oct 1995 08:05:55 -0400
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 <wohler at newt.com>
Date: Thu, 12 Oct 1995 07:53:53 -0700
(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
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" <super@wierdlmpc.msci.memphis.edu>
+ To: "Faculty members, c/o" <super@wierdlmpc.msci.memphis.edu>
dcc: faculty
There are some other choices, like using an un-replyable group list
(or worse).
------------------------------
-
+
Subject: 05.15 How can I make sense of the replcomps file?
From: Bill Wohler <wohler at newt.com>
Date: Thu, 9 Mar 2006 19:27:14 -0800
Comments fields above.
------------------------------
-
+
Subject: 05.16 How can I convert quoted-printable to 8bit in quoted text in replies?
From: Jarle F. Greipsland <jarle at idt.unit.no>
Date: 22 Aug 1995 10:42:07 +0200
in the .mh_profile, isoextract exec's this editor.
------------------------------
-
+
Subject: 05.17 Can I have aliases include aliases?
From: Bruce Cox <bruce at maths.su.oz.au>
Date: Fri, 16 Aug 1996 14:26:12 +1000
presidents, authors
------------------------------
-
+
Subject: 05.18 Why doesn't mhmail understand aliases?
From: "John L. Romine" <jromine at yoyodyne.ics.uci.edu>
Date: 25 Apr 1996 16:34:10 GMT
them before passing them as arguments (e.g., "mhmail `ali joe`").
------------------------------
-
+
Subject: 05.19 How do I send blind carbon copies?
From: Bill Wohler <wohler at newt.com>
Date: Mon, 9 Sep 1996 00:32:14 -0700
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 <jpeek at jpeek.com>
Date: Sun, 17 Nov 1996 20:16:31 -0800
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 <tomlinson at acm.com>
Date: Wed, 11 Jun 1997 09:16:41 -0500
rebuild.
------------------------------
-
+
Subject: 05.22 Can I automate the comp -editor mhn process?
From: Soren Dayton <csdayton at gargoyle164.cs.uchicago.edu>
Date: Tue, 21 Jan 1997 17:23:32 GMT
to your MH profile.
------------------------------
-
+
Subject: 05.23 How can I remove those "=20" characters when forwarding?
From: Dave Marquardt <marquard at Austin.IBM.Com>
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 <marquard at Austin.IBM.Com>
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 <jpeek at jpeek.com>
Date: Fri, 14 May 1999 11:15:07 -0400
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 <jpeek at jpeek.com>
Date: Fri, 1 Mar 1991 13:03:15 -0800
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 <rtor at ansa.co.uk>
Date: Fri, 1 Jan 1993 00:00:00 -0800
(Mr. Foo Bar) fb@somewhere.edu
------------------------------
-
+
Subject: 06.04 Fixing "post: problem initializing server; [BHST] no servers available"
From: Peter Marvit <marvit at hplabs.hpl.hp.com>,
Eric Bracken <bracken at bacon.performance.com>
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 <rickert+nn at cs.niu.edu>
command line sendmail.
------------------------------
-
+
Subject: 06.05 Fixing "post: problem initializing server; [RPLY] 503 Sender already specified"
From: Paul Pomes <ppomes at Qualcomm.com>
Date: Mon, 1 Mar 1993 00:00:00 -0800
MH sources to not use the ONEX verb.
------------------------------
-
+
Subject: 06.06 Fixing "post: unexpected response; [BHST] no socket opened"
From: Steve Lembark <lembark at wrkhors.la.ca.us>, Bill Wohler <wohler at newt.com>
Date: Mon, 1 Aug 1994 00:00:00 -0800
solutions seem to be the most prevalent.
------------------------------
-
+
Subject: 06.07 How do I fix the "X-Authentication-Warning" header?
From: Bill Wohler <wohler at newt.com>
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 <bjoerns at acm.org>
Date: Mon, 1 May 1995 00:00:00 -0800
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 <gianluca at noroboter.rotoni.com>
Date: Thu, 8 Mar 2001 09:18:14 +0000 (UTC)
<inetd PID>".
------------------------------
-
+
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
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" <whalenm at aol.net>
Date: Mon, 1 May 1995 00:00:00 -0800
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 <wohler at newt.com>
Date: Mon, 1 May 1995 00:00:00 -0800
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 <wohler at newt.com>
Date: Fri, 1 Mar 1991 13:03:15 -0800
(See "What mail filters are available?")
------------------------------
-
+
Subject: 07.04 How do I debug my .maildelivery file?
From: Bill Wohler <wohler at newt.com>
Date: Mon, 1 Mar 1993 00:00:00 -0800
http://rand-mh.sourceforge.net/book/mh/debugti.html
------------------------------
-
+
Subject: 07.05 Why isn't slocal working?
From: Bill Wohler <wohler at newt.com>
Date: Mon, 1 Mar 1993 00:00:00 -0800
See also "How do I debug my .maildelivery file?"
------------------------------
-
+
Subject: 07.06 Are there any good biff applications for MH?
From: Rob Austein <sra at epilogue.com>
Date: Tue, 01 Dec 1998 03:02:34 -0500
character for readability.
------------------------------
-
+
Subject: 07.07 How do I read new messages filed by procmail?
From: Bill Wohler <wohler at newt.com>
Date: Sun, 17 Oct 2004 15:17:14 -0700
in the Appendix "Switching xmh's editor".
------------------------------
-
+
Subject: 09.02 Does xmh support subfolders?
From: Steve Malowany <malowany at cenparmi.concordia.ca>
Date: Fri, 1 Mar 1991 13:03:15 -0800
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 <len at mel.dit.csiro.au>
Date: Fri, 1 Mar 1991 13:03:15 -0800
SMTP Simple Mail Transport Protocol (STD 10; RFC 821)
------------------------------
-
+
Subject: Acknowledgments
From: Bill Wohler <wohler at newt.com>
Date: Mon, 9 Sep 1996 01:37:27 -0700
Richard Coleman <coleman at math.gatech.edu> for taking MH to nmh.
------------------------------
-
+
Subject: Switching xmh's editor
From: Andrew Wason <aw at bae.bellcore.com>
Date: Fri, 1 Mar 1991 13:03:15 -0800
exit 0
------------------------------
-
+
Subject: babyl2mh.pl
From: Vivek Khera <khera at cs.duke.edu>
Date: Fri, 1 Mar 1991 13:03:15 -0800
}
------------------------------
-
+
Subject: inco - babyl to MH converter
From: Juergen Nickelsen <nickel at cs.tu-berlin.de>
Date: Fri, 1 Mar 1991 13:03:15 -0800
rm -f $lispfile $tmpmbox
------------------------------
-
+
Subject: t2h - add hyperlinks to message viewed
From: TANAKA Tomoyuki <tanaka at step.mother.com>
Date: Mon, 13 Sep 1999 11:35:43 -0600
</PRE>
------------------------------
-
+
Subject: srvrsmtp.c patch
From: Paul Pomes <ppomes at Qualcomm.com>
Date: Fri, 1 Mar 1991 13:03:15 -0800
case CMDVRFY: /* vrfy -- verify address */
------------------------------
-
+
Subject: IRIX config file
From: Jack Repenning <jackr at informix.com>
Date: 25 Jul 1995 02:35:41 GMT
options TYPESIG="void" ncr MIME VSPRINTF UNISTD SYSVR4 SYS5DIR
------------------------------
-
+
Subject: HP-UX 10.20 config file
From: Marko Heikkinen <hema at iki.fi>
Date: 06 Jan 1997 17:19:07 +0000
pop off
slibdir: /opt/mail/lib
options SYS5
-options MHE
+options MHE
options MIME
options ATZ
options BIND
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
#!/usr/bin/perl -w
#
-# Id: mhfinddup 6593 2004-09-02 16:34:24Z wohler
+# Id: mhfinddup 6593 2004-09-02 16:34:24Z wohler
=head1 NAME
=head1 VERSION
-Revision: 6593
+Revision: 6593
=head1 AUTHOR
nmh-announce@mhost.com
----------------------
This is a very low-traffic mailing list for announcing new releases,
-patches, and important events related to nmh.
+patches, and important events related to nmh.
nmh-bugs@mhost.com
------------------
nmh-workers@mhost.com
---------------------
This is the main list for discussing work on nmh. Both of the above
-mailing lists are forwarded to this one. There is currently no
+mailing lists are forwarded to this one. There is currently no
nmh-users mailing list, so user questions are acceptable here (the
comp.mail.mh newsgroup is another good option).
mail to nmh-workers-request with an archive access command. You can
get a current list of commands the archive server understands by
sending a message to nmh-workers-request@mhost.com with the subject
-"archive help".
+"archive help".
Of interest in the archive are the directories "latest" which contains
everything since the nmh-workers mailing list has been hosted on
Makefile: Makefile.in ../config.status
cd .. && ./config.status $(subdir)/$@
-
+
distdir = ../`cat ../distname`/$(subdir)
-nmhdist:
+nmhdist:
@echo "Copying distribution files in $(subdir)"
@for file in $(DIST); do \
cp -p $(srcdir)/$$file $(distdir); \
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.
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.
+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
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.
+thinking.
./
The top-level directory. Contains files like README and INSTALL.
"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.
+ nmh.
uip/
"uip" stands for "User Interface Programs". Most nmh commands have a file
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:
+functions:
OS function nmh-local version to use instead
=========== ================================
comp \- compose a message
.SH SYNOPSIS
.HP 5
-.B comp
+.B comp
.RI [ +folder ]
.RI [ msgs ]
.RB [ \-form
; everyone: *
; Blank lines and lines beginning with a ; are ignored.
-; < file -> read more aliases from "file"
+; < 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
+; with gid == group
; foo: * -> list replacement by ALL users in /etc/passwd
-; with uid >= 200
+; with uid >= 200
; foo*: fum -> matches foo<string> (including the empty string)
;
; using a ';' instead of a ':' indicates that the alias should be displayed
.SUFFIXES:
# static configuration, format, and components files
-STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
- mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
- mhl.reply rcvdistcomps rcvdistcomps.outbox \
- replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
- scan.default scan.mailx scan.nomime scan.size scan.time \
- scan.timely scan.unseen
+STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
+ mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
+ mhl.reply rcvdistcomps rcvdistcomps.outbox \
+ replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
+ scan.default scan.mailx scan.nomime scan.size scan.time \
+ scan.timely scan.unseen
# templates and scripts from which non-static files are generated
GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
Makefile: Makefile.in ../config.status
cd .. && ./config.status $(subdir)/$@
-
+
distdir = ../`cat ../distname`/$(subdir)
nmhdist: $(DIST)
@echo "Copying distribution files in $(subdir)"
@for file in $(DIST); do \
cp -p $(srcdir)/$$file $(distdir); \
done
-
-From: %{digest}-Request
-To: %{digest} Distribution: dist-%{digest};
+From: %{digest}-Request
+To: %{digest} Distribution: dist-%{digest};
Subject: %{digest} Digest V%(cur) #%(msg)
Reply-To: %{digest}
--------
-%{digest} Digest %(weekday{date}), %2(mday{date}) %(month{date}) %(year{date})
- Volume %(cur) : Issue %(msg)
+%{digest} Digest %(weekday{date}), %2(mday{date}) %(month{date}) %(year{date})
+ Volume %(cur) : Issue %(msg)
Today's Topics:
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
+ 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 "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<NF;i++)printf "/%s", $i;}'`"/
- echo "mhstore-store-audio/basic: | ${AUDIODIR}raw2audio -e ulaw -s 8000 -c 1 > %m%P.au" >> $TMP
+ AUDIODIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
+ echo "mhstore-store-audio/basic: | ${AUDIODIR}raw2audio -e ulaw -s 8000 -c 1 > %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<NF;i++)printf "/%s", $i;}'`"/
- if [ ! -z "$AUDIOTOOL" ]; then
- echo "mhbuild-compose-audio/x-next: $AUDIOTOOL '%f' && ${DIR}adpcm_enc < '%f'" >> $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
+ 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<NF;i++)printf "/%s", $i;}'`"/
+ if [ ! -z "$AUDIOTOOL" ]; then
+ echo "mhbuild-compose-audio/x-next: $AUDIOTOOL '%f' && ${DIR}adpcm_enc < '%f'" >> $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 "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
+ 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
+ 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
+ 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
+ echo "mhshow-show-application/x-ivs: %p$PGM -o '%F'" >> $TMP
fi
echo "mhshow-suffix-text/html: .html" >> $TMP
# 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
+ 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
+ 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
+ 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
+ echo "mhshow-show-application/msword: %psoffice '%F'" >> $TMP
+ echo "mhshow-suffix-application/msword: .doc" >> $TMP
fi
# output a sorted version of the file
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
+ echo "mhshow-show-application/PostScript: %p$PGM -- '%F'" >> $TMP
+ echo "mhshow-suffix-application/PostScript: .ps" >> $TMP
fi
fi
PGM="`$SEARCHPROG $SEARCHPATH ivs_record`"
if [ ! -z "$PGM" ]; then
- echo "mhbuild-compose-application/x-ivs: $PGM -u localhost '%F'" >> $TMP
+ echo "mhbuild-compose-application/x-ivs: $PGM -u localhost '%F'" >> $TMP
fi
# skip the directories `.' and `..'
if test "$A" = "." -o "$A" = ".."; then
- continue
+ 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
+ if test "$A" = "/usr/local/bin"; then
+ PGM="$PROGRAM"
+ else
+ PGM="$A/$PROGRAM"
+ fi
+
+ echo "$PGM"
+ exit 0
fi
done
IFS="$oIFS"
#
# nmh mail transport interface customization file.
-#
+#
# Check the mh-tailor(5) man page for a list of
# all the available options for this file.
#
# 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
- ;;
+ -gzip)
+ METHOD=gzip
+ shift
+ ;;
+ -compress)
+ METHOD=compress
+ shift
+ ;;
+ -none)
+ METHOD=none
+ shift
+ ;;
+ -*)
+ DELAY="`echo $1 | sed -e 's%-%%'`"
+ shift
+ ;;
+ *)
+ break
+ ;;
esac
done
tar cvf - "$@" | $COMPRESS | \
%libdir%/viamail -to "$mailpath" -subject "$subject" \
- -parameters "type=tar$CONVERSION" \
- -comment "extract with $UNCOMPRESS | tar xvpf -" \
- -delay "$DELAY" \
- -verbose $FROM
+ -parameters "type=tar$CONVERSION" \
+ -comment "extract with $UNCOMPRESS | tar xvpf -" \
+ -delay "$DELAY" \
+ -verbose $FROM
VPATH = @srcdir@
# header files included in distribution
-HDRS = addrsbr.h aliasbr.h crawl_folders.h dropsbr.h fmt_compile.h fmt_scan.h \
- md5.h mf.h mh.h mhcachesbr.h mhparse.h mime.h mts.h \
- netdb.h nmh.h picksbr.h popsbr.h prototypes.h rcvmail.h \
- scansbr.h signals.h tws.h utils.h
+HDRS = addrsbr.h aliasbr.h crawl_folders.h dropsbr.h fmt_compile.h \
+ fmt_scan.h md5.h mf.h mh.h mhcachesbr.h mhparse.h mime.h mts.h \
+ netdb.h nmh.h picksbr.h popsbr.h prototypes.h rcvmail.h \
+ scansbr.h signals.h tws.h utils.h
# auxiliary files
AUX = Makefile.in
Makefile: Makefile.in ../config.status
cd .. && ./config.status $(subdir)/$@
-
+
distdir = ../`cat ../distname`/$(subdir)
nmhdist: $(DIST)
@echo "Copying distribution files in $(subdir)"
@for file in $(DIST); do \
cp -p $(srcdir)/$$file $(distdir); \
done
-
-
/*
* 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 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
+#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;
+ 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)
+#define adrformat(m) auxformat ((m), 1)
/*
* prototypes
-
/*
* 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 */
+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 */
+ 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) */
+ 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 */
+ 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 *);
/* 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 */
+#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 */
-
/*
* crawl_folders.h -- crawl folder hierarchy
*/
-
/*
* dropsbr.h -- definitions for maildrop-style files
*/
* of such an map is special, it contains:
*
* d_id = number of messages in file
- * d_size = version number of map
+ * 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
+ * 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
#define MBOX_FORMAT 1
#define MMDF_FORMAT 2
-#define DRVRSN 3
+#define DRVRSN 3
struct drop {
- int d_id;
- int d_size;
- off_t d_start;
- off_t d_stop;
+ int d_id;
+ int d_size;
+ off_t d_start;
+ off_t d_stop;
};
/*
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);
-
-
/*
* 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_PUTADDR 11 /* split and print address line */
+#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_PUTADDR 11 /* split and print address line */
-/* types that modify the "str" or "value" registers */
-#define FT_LS_COMP 12 /* set "str" to component text */
-#define FT_LS_LIT 13 /* set "str" to literal text */
-#define FT_LS_GETENV 14 /* set "str" to getenv(text) */
-#define FT_LS_CFIND 15 /* set "str" to context_find(text) */
-#define FT_LS_DECODECOMP 16 /* set "str" to decoded component text */
-#define FT_LS_DECODE 17 /* decode "str" as RFC-2047 header */
-#define FT_LS_TRIM 18 /* trim trailing white space from "str" */
-#define FT_LV_COMP 19 /* set "value" to comp (as dec. num) */
-#define FT_LV_COMPFLAG 20 /* set "value" to comp flag word */
-#define FT_LV_LIT 21 /* set "value" to literal num */
-#define FT_LV_DAT 22 /* set "value" to dat[n] */
-#define FT_LV_STRLEN 23 /* set "value" to length of "str" */
-#define FT_LV_PLUS_L 24 /* set "value" += literal */
-#define FT_LV_MINUS_L 25 /* set "value" -= literal */
-#define FT_LV_DIVIDE_L 26 /* set "value" to value / literal */
-#define FT_LV_MODULO_L 27 /* set "value" to value % literal */
-#define FT_LV_CHAR_LEFT 28 /* set "value" to char left in output */
+/* types that modify the "str" or "value" registers */
+#define FT_LS_COMP 12 /* set "str" to component text */
+#define FT_LS_LIT 13 /* set "str" to literal text */
+#define FT_LS_GETENV 14 /* set "str" to getenv(text) */
+#define FT_LS_CFIND 15 /* set "str" to context_find(text) */
+#define FT_LS_DECODECOMP 16 /* set "str" to decoded component text */
+#define FT_LS_DECODE 17 /* decode "str" as RFC-2047 header */
+#define FT_LS_TRIM 18 /* trim trailing white space from "str" */
+#define FT_LV_COMP 19 /* set "value" to comp (as dec. num) */
+#define FT_LV_COMPFLAG 20 /* set "value" to comp flag word */
+#define FT_LV_LIT 21 /* set "value" to literal num */
+#define FT_LV_DAT 22 /* set "value" to dat[n] */
+#define FT_LV_STRLEN 23 /* set "value" to length of "str" */
+#define FT_LV_PLUS_L 24 /* set "value" += literal */
+#define FT_LV_MINUS_L 25 /* set "value" -= literal */
+#define FT_LV_DIVIDE_L 26 /* set "value" to value / literal */
+#define FT_LV_MODULO_L 27 /* set "value" to value % literal */
+#define FT_LV_CHAR_LEFT 28 /* set "value" to char left in output */
-#define FT_LS_MONTH 29 /* set "str" to tws month */
-#define FT_LS_LMONTH 30 /* set "str" to long tws month */
-#define FT_LS_ZONE 31 /* set "str" to tws timezone */
-#define FT_LS_DAY 32 /* set "str" to tws weekday */
-#define FT_LS_WEEKDAY 33 /* set "str" to long tws weekday */
-#define FT_LS_822DATE 34 /* set "str" to 822 date str */
-#define FT_LS_PRETTY 35 /* set "str" to pretty (?) date str */
-#define FT_LV_SEC 36 /* set "value" to tws second */
-#define FT_LV_MIN 37 /* set "value" to tws minute */
-#define FT_LV_HOUR 38 /* set "value" to tws hour */
-#define FT_LV_MDAY 39 /* set "value" to tws day of month */
-#define FT_LV_MON 40 /* set "value" to tws month */
-#define FT_LV_YEAR 41 /* set "value" to tws year */
-#define FT_LV_YDAY 42 /* set "value" to tws day of year */
-#define FT_LV_WDAY 43 /* set "value" to tws weekday */
-#define FT_LV_ZONE 44 /* set "value" to tws timezone */
-#define FT_LV_CLOCK 45 /* set "value" to tws clock */
-#define FT_LV_RCLOCK 46 /* set "value" to now - tws clock */
-#define FT_LV_DAYF 47 /* set "value" to tws day flag */
-#define FT_LV_DST 48 /* set "value" to tws daylight savings flag */
-#define FT_LV_ZONEF 49 /* set "value" to tws timezone flag */
+#define FT_LS_MONTH 29 /* set "str" to tws month */
+#define FT_LS_LMONTH 30 /* set "str" to long tws month */
+#define FT_LS_ZONE 31 /* set "str" to tws timezone */
+#define FT_LS_DAY 32 /* set "str" to tws weekday */
+#define FT_LS_WEEKDAY 33 /* set "str" to long tws weekday */
+#define FT_LS_822DATE 34 /* set "str" to 822 date str */
+#define FT_LS_PRETTY 35 /* set "str" to pretty (?) date str */
+#define FT_LV_SEC 36 /* set "value" to tws second */
+#define FT_LV_MIN 37 /* set "value" to tws minute */
+#define FT_LV_HOUR 38 /* set "value" to tws hour */
+#define FT_LV_MDAY 39 /* set "value" to tws day of month */
+#define FT_LV_MON 40 /* set "value" to tws month */
+#define FT_LV_YEAR 41 /* set "value" to tws year */
+#define FT_LV_YDAY 42 /* set "value" to tws day of year */
+#define FT_LV_WDAY 43 /* set "value" to tws weekday */
+#define FT_LV_ZONE 44 /* set "value" to tws timezone */
+#define FT_LV_CLOCK 45 /* set "value" to tws clock */
+#define FT_LV_RCLOCK 46 /* set "value" to now - tws clock */
+#define FT_LV_DAYF 47 /* set "value" to tws day flag */
+#define FT_LV_DST 48 /* set "value" to tws daylight savings flag */
+#define FT_LV_ZONEF 49 /* set "value" to tws timezone flag */
-#define FT_LS_PERS 50 /* set "str" to person part of addr */
-#define FT_LS_MBOX 51 /* set "str" to mbox part of addr */
-#define FT_LS_HOST 52 /* set "str" to host part of addr */
-#define FT_LS_PATH 53 /* set "str" to route part of addr */
-#define FT_LS_GNAME 54 /* set "str" to group part of addr */
-#define FT_LS_NOTE 55 /* set "str" to comment part of addr */
-#define FT_LS_ADDR 56 /* set "str" to mbox@host */
-#define FT_LS_822ADDR 57 /* set "str" to 822 format addr */
-#define FT_LS_FRIENDLY 58 /* set "str" to "friendly" format addr */
-#define FT_LV_HOSTTYPE 59 /* set "value" to addr host type */
-#define FT_LV_INGRPF 60 /* set "value" to addr in-group flag */
-#define FT_LS_UNQUOTE 61 /* remove RFC 2822 quotes from "str" */
-#define FT_LV_NOHOSTF 62 /* set "value" to addr no-host flag */
+#define FT_LS_PERS 50 /* set "str" to person part of addr */
+#define FT_LS_MBOX 51 /* set "str" to mbox part of addr */
+#define FT_LS_HOST 52 /* set "str" to host part of addr */
+#define FT_LS_PATH 53 /* set "str" to route part of addr */
+#define FT_LS_GNAME 54 /* set "str" to group part of addr */
+#define FT_LS_NOTE 55 /* set "str" to comment part of addr */
+#define FT_LS_ADDR 56 /* set "str" to mbox@host */
+#define FT_LS_822ADDR 57 /* set "str" to 822 format addr */
+#define FT_LS_FRIENDLY 58 /* set "str" to "friendly" format addr */
+#define FT_LV_HOSTTYPE 59 /* set "value" to addr host type */
+#define FT_LV_INGRPF 60 /* set "value" to addr in-group flag */
+#define FT_LS_UNQUOTE 61 /* remove RFC 2822 quotes from "str" */
+#define FT_LV_NOHOSTF 62 /* set "value" to addr no-host flag */
/* Date Coercion */
-#define FT_LOCALDATE 63 /* Coerce date to local timezone */
-#define FT_GMTDATE 64 /* Coerce date to gmt */
+#define FT_LOCALDATE 63 /* Coerce date to local timezone */
+#define FT_GMTDATE 64 /* Coerce date to gmt */
/* pre-format processing */
-#define FT_PARSEDATE 65 /* parse comp into a date (tws) struct */
-#define FT_PARSEADDR 66 /* parse comp into a mailaddr struct */
-#define FT_FORMATADDR 67 /* let external routine format addr */
-#define FT_MYMBOX 68 /* do "mymbox" test on comp */
+#define FT_PARSEDATE 65 /* parse comp into a date (tws) struct */
+#define FT_PARSEADDR 66 /* parse comp into a mailaddr struct */
+#define FT_FORMATADDR 67 /* let external routine format addr */
+#define FT_MYMBOX 68 /* do "mymbox" test on comp */
-/* misc. */ /* ADDTOSEQ only works if you include "options LBL" */
-#define FT_ADDTOSEQ 69 /* add current msg to a sequence */
+/* misc. */
+/* ADDTOSEQ only works if you include "options LBL" */
+#define FT_ADDTOSEQ 69 /* add current msg to a sequence */
/* conditionals & control flow (must be last) */
-#define FT_SAVESTR 70 /* save current str reg */
-#define FT_DONE 71 /* stop formatting */
-#define FT_PAUSE 72 /* pause */
-#define FT_NOP 73 /* nop */
-#define FT_GOTO 74 /* (relative) goto */
-#define FT_IF_S_NULL 75 /* test if "str" null */
-#define FT_IF_S 76 /* test if "str" non-null */
-#define FT_IF_V_EQ 77 /* test if "value" = literal */
-#define FT_IF_V_NE 78 /* test if "value" != literal */
-#define FT_IF_V_GT 79 /* test if "value" > literal */
-#define FT_IF_MATCH 80 /* test if "str" contains literal */
-#define FT_IF_AMATCH 81 /* test if "str" starts with literal */
-#define FT_S_NULL 82 /* V = 1 if "str" null */
-#define FT_S_NONNULL 83 /* V = 1 if "str" non-null */
-#define FT_V_EQ 84 /* V = 1 if "value" = literal */
-#define FT_V_NE 85 /* V = 1 if "value" != literal */
-#define FT_V_GT 86 /* V = 1 if "value" > literal */
-#define FT_V_MATCH 87 /* V = 1 if "str" contains literal */
-#define FT_V_AMATCH 88 /* V = 1 if "str" starts with literal */
+#define FT_SAVESTR 70 /* save current str reg */
+#define FT_DONE 71 /* stop formatting */
+#define FT_PAUSE 72 /* pause */
+#define FT_NOP 73 /* nop */
+#define FT_GOTO 74 /* (relative) goto */
+#define FT_IF_S_NULL 75 /* test if "str" null */
+#define FT_IF_S 76 /* test if "str" non-null */
+#define FT_IF_V_EQ 77 /* test if "value" = literal */
+#define FT_IF_V_NE 78 /* test if "value" != literal */
+#define FT_IF_V_GT 79 /* test if "value" > literal */
+#define FT_IF_MATCH 80 /* test if "str" contains literal */
+#define FT_IF_AMATCH 81 /* test if "str" starts with literal */
+#define FT_S_NULL 82 /* V = 1 if "str" null */
+#define FT_S_NONNULL 83 /* V = 1 if "str" non-null */
+#define FT_V_EQ 84 /* V = 1 if "value" = literal */
+#define FT_V_NE 85 /* V = 1 if "value" != literal */
+#define FT_V_GT 86 /* V = 1 if "value" > literal */
+#define FT_V_MATCH 87 /* V = 1 if "str" contains literal */
+#define FT_V_AMATCH 88 /* V = 1 if "str" starts with literal */
-#define IF_FUNCS FT_S_NULL /* start of "if" functions */
+#define IF_FUNCS FT_S_NULL /* start of "if" functions */
-
/*
* fmt_scan.h -- definitions for fmt_scan()
*/
* 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;
+ 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
/*
* c_type bits
*/
-#define CT_ADDR (1<<0) /* referenced as address */
-#define CT_DATE (1<<1) /* referenced as date */
+#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_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 */
extern int fmt_norm;
*/
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.
+ * single character component names.
*/
-#define CHASH(nm) (((((nm)[0]) - ((nm)[1])) & 0x1f) + (((nm)[2]) & 0x5f))
+#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) ;
+ 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;
+ 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_skip f_width /* instr to skip (false "if") */
#define f_comp f_un.f_u_comp
#define f_text f_un.f_u_text
* with C compiler flags.
*/
#ifndef PROTOTYPES
-#define PROTOTYPES 0
+# define PROTOTYPES 0
#endif
/* POINTER defines a generic pointer type */
typedef unsigned long int 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 using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
+ * returns an empty list.
*/
#if PROTOTYPES
-#define PROTO_LIST(list) list
+# define PROTO_LIST(list) list
#else
-#define PROTO_LIST(list) ()
+# define PROTO_LIST(list) ()
#endif
/* MD5.H - header file for MD5C.C
/* 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 */
+ 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 *));
-
-
/*
* mf.h -- include file for mailbox filters
*/
#include <h/nmh.h>
-#ifndef TRUE
+#ifndef TRUE
# define TRUE 1
#endif
-#ifndef FALSE
+#ifndef FALSE
# define FALSE 0
#endif
-#ifndef NOTOK
+#ifndef NOTOK
# define NOTOK (-1)
#endif
-#ifndef OK
+#ifndef OK
# define OK 0
#endif
-#ifndef DONE
+#ifndef DONE
# define DONE 1
#endif
-#define LINESIZ 512
+#define LINESIZ 512
-#define MBXMODE 0600
-#define TMPMODE 0600
+#define MBXMODE 0600
+#define TMPMODE 0600
-#define OWIDTH 75 /* length of a header line */
+#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 */
+#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;
+ 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 */
+#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 */
/*
struct adrx *seekadrx (char *);
struct adrx *getadrx (char *);
struct adrx *uucpadrx (char *);
-
-
/*
* mh.h -- main header file for all of nmh
*/
/*
* Well-used constants
*/
-#define NOTOK (-1) /* syscall()s return this on error */
-#define OK 0 /* ditto on success */
-#define DONE 1 /* trinary logic */
+#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 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 */
+#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
+# define FALSE 0
#endif
#ifndef TRUE
-#define TRUE 1
+# define TRUE 1
#endif
typedef unsigned char boolean; /* not int so we can pack in a structure */
* functions that abort.
*/
#if __GNUC__ > 2
-#define NORETURN __attribute__((__noreturn__))
+# define NORETURN __attribute__((__noreturn__))
#else
-#define NORETURN
+# define NORETURN
#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 */
+ 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 */
+#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;
+ char *sw;
+ /*
+ * The minchars field is apparently used like this:
+ *
+ * -# : Switch can be abbreviated to # chars; switch hidden in -help.
+ * 0 : Switch can't be abbreviated; switch shown in -help.
+ * # : Switch can be abbreviated to # chars; switch shown in -help.
+ */
+ int minchars;
};
-extern struct swit anoyes[]; /* standard yes/no switches */
+extern struct swit anoyes[]; /* standard yes/no switches */
-#define ATTACHFORMATS 3 /* Number of send attach formats. */
+#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 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 FBITS "\020\01READONLY\02SEQMOD\03ALLOW_NEW\04OTHERS"
+#define FBITS "\020\01READONLY\02SEQMOD\03ALLOW_NEW\04OTHERS"
/*
* type for holding the sequence set of a message
* can have. The first 5 sequence flags are for
* internal nmh message flags.
*/
-#define NUMATTRS ((sizeof(seqset_t) * Nbby) - 5)
+#define NUMATTRS ((sizeof(seqset_t) * Nbby) - 5)
/*
* first free slot for user defined sequences
* and attributes
*/
-#define FFATTRSLOT 5
+#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 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"
+#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 */
+ 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 */
};
/*
*/
#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])
+ ((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 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_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 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)
+ ((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)
+#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)
#define in_sequence(mp,seqnum,msgnum) \
*/
#define clear_folder_flags(mp) ((mp)->msgflags = 0)
-#define is_readonly(mp) ((mp)->msgflags & READONLY)
-#define set_readonly(mp) ((mp)->msgflags |= READONLY)
+#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 other_files(mp) ((mp)->msgflags & OTHERS)
+#define set_other_files(mp) ((mp)->msgflags |= OTHERS)
-#define NULLMP ((struct msgs *) 0)
+#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 */
+#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_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 */
-extern int msg_count; /* m_getfld() indicators */
-extern int msg_style; /* .. */
-extern char *msg_delim; /* .. */
+extern int msg_count; /* m_getfld() indicators */
+extern int msg_style; /* .. */
+extern char *msg_delim; /* .. */
-#define NOUSE 0 /* draft being re-used */
+#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 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 OUTPUTLINELEN 72 /* default line length for headers */
/*
* miscellaneous macros
*/
-#define pidXwait(pid,cp) pidstatus (pidwait (pid, NOTOK), stdout, cp)
+
+#define pidXwait(pid,cp) pidstatus (pidwait (pid, NOTOK), stdout, cp)
#ifndef max
# define max(a,b) ((a) > (b) ? (a) : (b))
/*
* GLOBAL VARIABLES
*/
-#define CTXMOD 0x01 /* context information modified */
-#define DBITS "\020\01CTXMOD"
+#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 */
+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
extern void (*done) (int) NORETURN;
#include <h/prototypes.h>
-
-
/*
* mhcachesbr.h -- definitions for manipulating MIME content cache
*/
*/
static struct swit caches[] = {
#define CACHE_NEVER 0
- { "never", 0 },
+ { "never", 0 },
#define CACHE_PRIVATE 1
- { "private", 0 },
+ { "private", 0 },
#define CACHE_PUBLIC 2
- { "public", 0 },
+ { "public", 0 },
#define CACHE_ASK 3
- { "ask", 0 },
- { NULL, 0 }
+ { "ask", 0 },
+ { NULL, 0 }
};
-
/*
* mhparse.h -- definitions for parsing/building of MIME content
* -- (mhparse.c/mhbuildsbr.c)
*/
-#define NPARTS 50
-#define NTYPES 20
-#define NPARMS 10
+#define NPARTS 50
+#define NTYPES 20
+#define NPARMS 10
/*
* Abstract type for header fields
* 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 */
+ 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 */
};
/*
* 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;
+ 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;
};
/*
* 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? */
+ 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) */
+ /* 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
+#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 */
+#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
+#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
+#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 */
+ int tx_charset; /* flag for character set */
};
/*
*/
/* 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
+#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 */
+ 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 */
+ char *mp_start; /* boundary string separating parts */
+ char *mp_stop; /* terminating boundary string */
+ struct part *mp_parts; /* pointer to first subpart structure */
};
/*
*/
/* Flags for subtypes of MESSAGE */
-#define MESSAGE_UNKNOWN 0x00
-#define MESSAGE_RFC822 0x01
-#define MESSAGE_PARTIAL 0x02
-#define MESSAGE_EXTERNAL 0x03
+#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;
+ 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;
+ 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;
};
/*
*/
/* Flags for subtype of APPLICATION */
-#define APPLICATION_UNKNOWN 0x00
-#define APPLICATION_OCTETS 0x01
-#define APPLICATION_POSTSCRIPT 0x02
+#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;
+ char *kv_key;
+ int kv_value;
};
extern struct k2v SubText[];
extern struct k2v Charset[];
* the functions to handle them.
*/
struct str2init {
- char *si_key;
- int si_val;
- InitFunc si_init;
+ char *si_key;
+ int si_val;
+ InitFunc si_init;
};
extern struct str2init str2cts[];
extern struct str2init str2ces[];
int open7Bit (CT, char **);
void close_encoding (CT);
-extern int checksw; /* Add Content-MD5 field */
+extern int checksw; /* Add Content-MD5 field */
-
/*
* 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 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) != ']')
+#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)
+#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)
-
/*
* mts.h -- definitions for the mail system
*/
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 ())
+#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);
extern char *mmdlm1;
extern char *mmdlm2;
-#define isdlm1(s) (strcmp (s, mmdlm1) == 0)
-#define isdlm2(s) (strcmp (s, mmdlm2) == 0)
+#define isdlm1(s) (strcmp (s, mmdlm1) == 0)
+#define isdlm2(s) (strcmp (s, mmdlm2) == 0)
/*
* Read mts.conf file
-
/*
* nmh.h -- system configuration header file
*/
#endif
#include <signal.h>
-
+
#define bcmp(b1,b2,length) memcmp(b1, b2, length)
#define bcopy(b1,b2,length) memcpy (b2, b1, length)
#define bcpy(b1,b2,length) memcmp (b1, b2, length)
#ifdef STAT_MACROS_BROKEN
# ifdef S_ISBLK
# undef S_ISBLK
-# endif
+# endif
# ifdef S_ISCHR
# undef S_ISCHR
-# endif
+# endif
# ifdef S_ISDIR
# undef S_ISDIR
-# endif
+# endif
# ifdef S_ISFIFO
# undef S_ISFIFO
-# endif
+# endif
# ifdef S_ISLNK
# undef S_ISLNK
-# endif
+# endif
# ifdef S_ISMPB
# undef S_ISMPB
-# endif
+# endif
# ifdef S_ISMPC
# undef S_ISMPC
-# endif
+# endif
# ifdef S_ISNWK
# undef S_ISNWK
-# endif
+# endif
# ifdef S_ISREG
# undef S_ISREG
-# endif
+# endif
# ifdef S_ISSOCK
# undef S_ISSOCK
-# endif
+# endif
#endif /* STAT_MACROS_BROKEN. */
-
-
/*
* picksbr.h -- definitions for picksbr.c
*/
-
/*
* prototypes.h -- various prototypes
*/
int sendsbr (char **, int, char *, struct stat *, int, char *, int);
int what_now (char *, int, int, char *, char *,
int, struct msgs *, char *, int, char *);
-
-
/*
* rcvmail.h -- rcvmail hook definitions
*/
# include <stdio.h>
# include <sys/types.h>
-# define RCV_MOK 0
-# define RCV_MBX 1
+# define RCV_MOK 0
+# define RCV_MBX 1
-
/*
* 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 */
+#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 \
+#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 \
+# define FORMAT \
"%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
%02(mday{date})/%02(mon{date})%<{date} %|*%>\
%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
%(decode{subject})%<{body}<<%{body}>>%>\n"
#endif
-#define WIDTH 78
+#define WIDTH 78
/*
* prototypes
-
/*
* signals.h -- header file for nmh signal interface
*/
-
/*
* 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
+/*
+ * 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;
+ 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_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_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_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_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 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)
+#define dtwszone(tw) dtimezone (tw->tw_zone, tw->tw_flags)
extern char *tw_dotw[];
extern char *tw_ldotw[];
void set_dotw (struct tws *);
struct tws *dparsetime (char *);
-
-
/*
* utils.h -- utility prototypes
*/
$(SEDMAN)
# man pages to install in $(mandir)/$(manext1)
-MAN1SRC = ali. anno. burst. comp. \
- dist. flist. flists. folder. folders. \
- forw. inc. install-mh. mark. mh-chart. \
- nmh. mhbuild. mhl. mhlist. mhmail. \
- mhparam. mhpath. mhshow. \
- mhstore. msgchk. \
- new. fnext. fprev. unseen. \
- next. packf. pick. prev. \
- prompter. rcvdist. rcvpack. \
- rcvstore. rcvtty. refile. \
- repl. rmf. rmm. scan. \
- send. sendfiles. show. slocal. \
- sortm. whatnow. whom.
-
-MAN5SRC = mh-alias. mh-draft. mh-format. \
- mh-mail. mh-profile. mh-sequence. \
+MAN1SRC = ali. anno. burst. comp. dist. flist. flists. folder. folders. \
+ forw. inc. install-mh. mark. mh-chart. nmh. mhbuild. mhl. mhlist. \
+ mhmail. mhparam. mhpath. mhshow. mhstore. msgchk. new. fnext. \
+ fprev. unseen. next. packf. pick. prev. prompter. rcvdist. rcvpack. \
+ rcvstore. rcvtty. refile. repl. rmf. rmm. scan. send. sendfiles. \
+ show. slocal. sortm. whatnow. whom.
+
+MAN5SRC = mh-alias. mh-draft. mh-format. mh-mail. mh-profile. mh-sequence. \
mh-tailor. mts.conf.
-MAN8SRC = ap. conflict. dp. fmtdump. \
- post.
+MAN8SRC = ap. conflict. dp. fmtdump. post.
MAN1 = $(MAN1SRC:.=.$(manext1))
MAN5 = $(MAN5SRC:.=.$(manext5))
Makefile: Makefile.in ../config.status
cd .. && ./config.status $(subdir)/$@
-
+
distdir = ../`cat ../distname`/$(subdir)
nmhdist: $(DIST)
@echo "Copying distribution files in $(subdir)"
.RB [ \-normalize " | " \-nonormalize ]
.RB [ \-user " | " \-nouser ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.RI [ aliases " ...]"
.ad
.SH DESCRIPTION
.RB [ \-width
.IR columns ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.I addrs
\&...
.ad
.SH SYNOPSIS
.HP 5
.na
-.B comp
+.B comp
.RI [ +folder ]
.RI [ msgs ]
.RB [ \-form
.RB [ \-mail
.IR name ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.RI [ aliasfiles
\&...]
.ad
.RI [ msgs ]
.RB [ \-form
.IR formfile ]
-.RB [ \-annotate " | " \-noannotate ]
-.RB [ \-inplace " | " \-noinplace ]
+.RB [ \-annotate " | " \-noannotate ]
+.RB [ \-inplace " | " \-noinplace ]
.RB [ \-draftfolder
.IR +folder ]
.RB [ \-draftmessage
.RB [ \-width
.IR columns ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.I dates
\&...
.ad
.RB [ \-format
.IR string ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.ad
.SH DESCRIPTION
.B Fmtdump
without creating a non-existant folder.
.\"
.\" note - this doesn't work at present
-.\" If `\-noprint' is specified,
+.\" 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.
are given, they will become the current folder and/or message.
.SH BUGS
-There is no way to restore the default behavior
+There is no way to restore the default behavior
(to ask the user whether to create a non-existant folder)
after
.B \-create
.B forw
.RI [ +folder ]
.RI [ msgs ]
-.RB [ \-annotate " | " \-noannotate ]
+.RB [ \-annotate " | " \-noannotate ]
.RB [ \-form
.IR formfile ]
.RB [ \-format " | " \-noformat ]
.IR number ]
.RB [ \-volume
.IR number ]
-[other\ switches\ for\
+[other\ switches\ for\
.BR forw ]
.RB [ \-version ]
.RB [ \-help ]
The
.B \-file
.I msgfile
-switch specifies the message to be forwarded as an
+switch specifies the message to be forwarded as an
exact filename rather than as an
.B nmh
-folder and message number. It is
+folder and message number. It is
intended to be used by the
.B msh
interface to
-.BR nmh .
+.BR nmh .
This switch implies
.BR \-noannotate .
The forwarded message is simply
.I name
\&...]
.RB [ \-add " | " \-delete ]
-.RB [ \-list ]
+.RB [ \-list ]
.RB [ \-public " | " \-nopublic ]
.RB [ \-zero " | " \-nozero ]
.RB [ \-version ]
.RB [ \-normalize " | " \-nonormalize ]
.RB [ \-user " | " \-nouser ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.RI [ aliases " ...]"
.HP 5
.RB [ \-width
.IR columns ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.I addrs
\&...
.RB [ \-help ]
.HP 5
-.B comp
+.B comp
.RI [ +folder ]
.RI [ msgs ]
.RB [ \-form
.RB [ \-mail
.IR name ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.RI [ aliasfiles
\&...]
.RI [ msgs ]
.RB [ \-form
.IR formfile ]
-.RB [ \-annotate " | " \-noannotate ]
-.RB [ \-inplace " | " \-noinplace ]
+.RB [ \-annotate " | " \-noannotate ]
+.RB [ \-inplace " | " \-noinplace ]
.RB [ \-draftfolder
.IR +folder ]
.RB [ \-draftmessage
.RB [ \-width
.IR columns ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.I dates
\&...
.RB [ \-format
.IR string ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.HP 5
.B folder
.B forw
.RI [ +folder ]
.RI [ msgs ]
-.RB [ \-annotate " | " \-noannotate ]
+.RB [ \-annotate " | " \-noannotate ]
.RB [ \-form
.IR formfile ]
.RB [ \-format " | " \-noformat ]
.IR number ]
.RB [ \-volume
.IR number ]
-[other\ switches\ for\
+[other\ switches\ for\
.BR forw ]
.RB [ \-version ]
.RB [ \-help ]
.I name
\&...]
.RB [ \-add " | " \-delete ]
-.RB [ \-list ]
+.RB [ \-list ]
.RB [ \-public " | " \-nopublic ]
.RB [ \-zero " | " \-nozero ]
.RB [ \-version ]
.RB [ \-subject
.IR subject ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.HP 5
.B mhpath
.RB [ \-help ]
.HP 5
-.B next
+.B next
.RI [ +folder ]
.RB [\-showproc
.IR program ]
\&...]
.RB [ \-public " | " \-nopublic ]
.RB [ \-zero " | " \-nozero ]
-.RB [ \-list " | " \-nolist ]
+.RB [ \-list " | " \-nolist ]
.RB [ \-version ]
.RB [ \-help ]
.HP 5
-.B %libdir%/post
+.B %libdir%/post
.RB [ \-alias
.IR aliasfile ]
.RB [ \-filter
.RB [ \-help ]
.HP 5
-.B prev
+.B prev
.RI [ +folder ]
.RB [\-showproc
.IR program ]
.RB [ \-help ]
.HP 5
-.B refile
+.B refile
.RI [ msgs ]
.RB [ \-draft ]
.RB [ \-link " | " \-nolink ]
.B repl
.RI [ +folder ]
.RI [ msgs ]
-.RB [ \-annotate " | " \-noannotate ]
+.RB [ \-annotate " | " \-noannotate ]
.RB [ \-group " | " \-nogroup ]
.RB [ \-cc
all/to/cc/me]
.RB [ \-help ]
.HP 5
-.B rmf
+.B rmf
.RI [ +folder ]
.RB [ \-interactive " | " \-nointeractive ]
.RB [ \-version ]
.RB [ \-width
.IR columns ]
.RB [ file
-\&...]
+\&...]
.RB [ \-version ]
.RB [ \-help ]
whitespace is discarded:
.RI `%( function " " argument )'.
.PP
-In addition to literal numbers or strings,
+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
.PP
A
.I control
-escape is one of: `%<', `%?', `%|', or `%>'.
+escape is one of: `%<', `%?', `%|', or `%>'.
These are combined into the conditional execution construct:
.PP
.RS 5
.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
+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.
+A `%<' or `%?' control escape causes its condition to be evaluated.
This condition is a
.I component
or
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
+if the function return or component value is
a non-empty string, and false for an empty string.
.PP
When escapes are nested (via expr arguments), evaluation is done from inner-most to outer-most.
As noted above, for the
expr
-argument type,
+argument type,
functions and components are written without a
leading `%'.
Control escape arguments must use a leading `%', preceded by a space.
.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 .
+writes its result to the internal register named
+.IR num ;
+then the control escape evaluates
+.IR num .
If
.IR num
is non-zero, the
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
+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
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)
+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
.fi
.RE
.PP
-These functions require an address component as an argument.
+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
.PP
This clears
.I str
-and formats the \*(lqReply-To:\*(rq header
+and formats the \*(lqReply-To:\*(rq header
if present. If not present, the else-if clause is executed.
.PP
.RS 5
.fi
.RE
.PP
-This formats the
+This formats the
\*(lqFrom:\*(rq, \*(lqSender:\*(rq and \*(lqReturn-Path:\*(rq
headers, stopping as soon as one of them is present. Next:
.PP
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.
+start to occur.
The nmh format strings can be modified to behave more sensibly with larger
message numbers:
.PP
.B inc
to compose an
.I MHE
-auditfile in addition to its other tasks.
+auditfile in addition to its other tasks.
.I MHE
-is Brian Reid's
+is Brian Reid's
.B emacs
front-end for
.BR nmh .
None
.SH BUGS
-There should be some way to pass `bell' and `clear' information to the
+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
.RB [ \-subject
.IR subject ]
.RB [ \-version ]
-.RB [ \-help ]
+.RB [ \-help ]
.ad
.SH DESCRIPTION
.B mhmail
.SH SYNOPSIS
.HP 5
.na
-.B next
+.B next
.RI [ +folder ]
.RB [\-showproc
.IR program ]
^ali(1)~^\- list mail aliases
^anno(1)~^\- annotate messages
^burst(1)~^\- explode digests into messages
-^comp(1)~^\- compose a message
+^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)
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.
+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
\&...]
.RB [ \-public " | " \-nopublic ]
.RB [ \-zero " | " \-nozero ]
-.RB [ \-list " | " \-nolist ]
+.RB [ \-list " | " \-nolist ]
.RB [ \-version ]
.RB [ \-help ]
.PP
.SH SYNOPSIS
.HP 5
.na
-.B %libdir%/post
+.B %libdir%/post
.RB [ \-alias
.IR aliasfile ]
.RB [ \-filter
account, or when remote email robots give improper precedence to the envelope
\*(lqFrom:\*(rq. Note that your MTA may still reveal your real identity (e.g.
.BR sendmail 's
-\*(lqX\-Authentication\-Warning:\*(rq header).
+\*(lqX\-Authentication\-Warning:\*(rq header).
.PP
If nmh is using the SMTP MTA, the
.B \-server
.SH SYNOPSIS
.HP 5
.na
-.B prev
+.B prev
.RI [ +folder ]
.RB [\-showproc
.IR program ]
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
+.PP
If the
.B \-mmdf
switch is given, then the messages are separated by
.SH SYNOPSIS
.HP 5
.na
-.B refile
+.B refile
.RI [ msgs ]
.RB [ \-draft ]
.RB [ \-link " | " \-nolink ]
.B repl
.RI [ +folder ]
.RI [ msgs ]
-.RB [ \-annotate " | " \-noannotate ]
+.RB [ \-annotate " | " \-noannotate ]
.RB [ \-group " | " \-nogroup ]
.RB [ \-cc
all/to/cc/me]
In\-Reply\-To: <Message\-Id>
References: <Message\-Id>
Comments: In\-Reply\-To <From> or <apparently from> or <Sender>
-.ti +3
+.ti +3
message dated <date>
--------
.fi
The
.B \-file
.I msgfile
-switch specifies the message to be replied to as an
+switch specifies the message to be replied to as an
exact filename rather than as an
.B nmh
-folder and message number. It is
+folder and message number. It is
intended to be used by the
.B msh
interface to
-.BR nmh .
+.BR nmh .
The same caveats apply to this option as to the
.B \-build
switch.
.SH SYNOPSIS
.HP 5
.na
-.B rmf
+.B rmf
.RI [ +folder ]
.RB [ \-interactive " | " \-nointeractive ]
.RB [ \-version ]
.RB [ \-width
.IR columns ]
.RB [ file
-\&...]
+\&...]
.RB [ \-version ]
.RB [ \-help ]
.RB [ \-attach
-attachformat 0:
Content-Type: text/plain; name="VERSION"; x-unix-mode="0644";
charset="us-ascii"
-Content-Description: ASCII text
+Content-Description: ASCII text
-attachformat 1:
Content-Type: text/plain; name="VERSION"; charset="us-ascii"
.fi
.SH "SEE ALSO"
-mhbuild(1), mhlist(1), mhshow(1), mhstore(1).
+mhbuild(1), mhlist(1), mhshow(1), mhstore(1).
.I "Proposed Standard for Message Encapsulation"
(RFC\-934)
RANLIB = @RANLIB@
LIBTOOL = @LIBTOOL@
GNU_LIBTOOL = @GNU_LIBTOOL@
-LINT = @LINT@
-LINTFLAGS = @LINTFLAGS@
+LINT = @LINT@
+LINTFLAGS = @LINTFLAGS@
LIBOBJS = @LIBOBJS@
SIGNAL_H = @SIGNAL_H@
# source for library functions
-SRCS = addrsbr.c ambigsw.c atooi.c brkstring.c \
- check_charset.c client.c closefds.c concat.c context_del.c \
- context_find.c context_foil.c context_read.c \
- context_replace.c context_save.c copy.c \
- copyip.c cpydata.c cpydgst.c crawl_folders.c \
- discard.c done.c dtime.c dtimep.c \
- error.c ext_hook.c fdcompare.c folder_addmsg.c folder_delmsgs.c \
- folder_free.c folder_pack.c folder_read.c \
- folder_realloc.c gans.c getans.c getanswer.c \
- getarguments.c getcpy.c getfolder.c getpass.c \
- fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c \
- fmt_scan.c lock_file.c m_atoi.c m_backup.c \
- m_convert.c m_draft.c m_getfld.c m_gmprot.c \
- m_maildir.c m_name.c m_scratch.c m_tmpfil.c \
- makedir.c mts.c norm_charmap.c \
- path.c peekc.c pidwait.c pidstatus.c \
- print_help.c print_sw.c print_version.c push.c \
- putenv.c refile.c remdir.c r1bindex.c \
- readconfig.c ruserpass.c seq_add.c seq_bits.c \
- seq_del.c seq_getnum.c seq_list.c seq_nameok.c \
- seq_print.c seq_read.c seq_save.c seq_setcur.c \
- seq_setprev.c seq_setunseen.c showfile.c signals.c \
- smatch.c snprintb.c ssequal.c strcasecmp.c \
- strindex.c trimcpy.c uprf.c vfgets.c fmt_def.c \
+SRCS = addrsbr.c ambigsw.c atooi.c brkstring.c \
+ check_charset.c client.c closefds.c concat.c context_del.c \
+ context_find.c context_foil.c context_read.c \
+ context_replace.c context_save.c copy.c \
+ copyip.c cpydata.c cpydgst.c crawl_folders.c \
+ discard.c done.c dtime.c dtimep.c \
+ error.c ext_hook.c fdcompare.c folder_addmsg.c folder_delmsgs.c \
+ folder_free.c folder_pack.c folder_read.c \
+ folder_realloc.c gans.c getans.c getanswer.c \
+ getarguments.c getcpy.c getfolder.c getpass.c \
+ fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c \
+ fmt_scan.c lock_file.c m_atoi.c m_backup.c \
+ m_convert.c m_draft.c m_getfld.c m_gmprot.c \
+ m_maildir.c m_name.c m_scratch.c m_tmpfil.c \
+ makedir.c mts.c norm_charmap.c \
+ path.c peekc.c pidwait.c pidstatus.c \
+ print_help.c print_sw.c print_version.c push.c \
+ putenv.c refile.c remdir.c r1bindex.c \
+ readconfig.c ruserpass.c seq_add.c seq_bits.c \
+ seq_del.c seq_getnum.c seq_list.c seq_nameok.c \
+ seq_print.c seq_read.c seq_save.c seq_setcur.c \
+ seq_setprev.c seq_setunseen.c showfile.c signals.c \
+ smatch.c snprintb.c ssequal.c strcasecmp.c \
+ strindex.c trimcpy.c uprf.c vfgets.c fmt_def.c \
m_msgdef.c mf.c utils.c m_mktemp.c
# source for compatibility functions
COMPAT = memmove.c snprintf.c strdup.c strerror.c
-OBJS = $(SRCS:.c=.o) $(LIBOBJS)
+OBJS = $(SRCS:.c=.o) $(LIBOBJS)
# auxiliary files
AUX = Makefile.in sigmsg.awk dtimep.lex
Makefile: Makefile.in ../config.status
cd .. && ./config.status $(subdir)/$@
-
+
distdir = ../`cat ../distname`/$(subdir)
nmhdist: $(DIST)
@echo "Copying distribution files in $(subdir)"
-
/*
* addrsbr.c -- parse addresses 822-style
*
#include <h/addrsbr.h>
#include <h/mf.h>
-/* 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.
-
- 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%<uucp>@<local> -> string
-
- 2. for non-MMDF systems:
-
- string@host.<uucp> -> host!string
-
- 3. for any system, an address interpreted relative to the local host:
-
- string@<uucp> -> 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
+/*
+ * 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.
+ *
+ * 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%<uucp>@<local> -> string
+ *
+ * 2. for non-MMDF systems:
+ *
+ * string@host.<uucp> -> host!string
+ *
+ * 3. for any system, an address interpreted relative to the local host:
+ *
+ * string@<uucp> -> 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
*/
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 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;
-#ifndef DUMB
- char *dp;
+ char *pp;
+ struct mailname *mp;
+#ifndef DUMB
+ char *dp;
#endif /* not DUMB */
- 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 ();
- 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;
+ 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 ();
+ 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;
}
- else {
- mp->m_nohost = 1;
- mp->m_mbox = getcpy (mbox);
+
+ 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);
#ifdef DUMB
- if (route == NULL && dftype == LOCALHOST) {
- mp->m_host = NULL;
- mp->m_type = dftype;
- }
- else
+ if (route == NULL && dftype == LOCALHOST) {
+ mp->m_host = NULL;
+ mp->m_type = dftype;
+ } else
#endif /* DUMB */
- {
- mp->m_host = route ? NULL : getcpy (dfhost);
- mp->m_type = route ? NETHOST : dftype;
- }
+ {
+ mp->m_host = route ? NULL : getcpy (dfhost);
+ mp->m_type = route ? NETHOST : dftype;
+ }
+ }
+ goto got_host;
}
- goto got_host;
- }
- if (wanthost == AD_NHST)
- mp->m_type = !mh_strcasecmp (LocalName (), mp->m_host)
- ? LOCALHOST : NETHOST;
+ if (wanthost == AD_NHST)
+ mp->m_type = !mh_strcasecmp (LocalName (), mp->m_host)
+ ? LOCALHOST : NETHOST;
#ifdef DUMB
- else
- mp->m_type = mh_strcasecmp (LocalName(), mp->m_host) ? NETHOST : LOCALHOST;
+ else
+ mp->m_type = mh_strcasecmp (LocalName(), mp->m_host) ? NETHOST : LOCALHOST;
#else /* not DUMB */
- else
- if (pp = OfficialName (mp->m_host)) {
- got_real_host: ;
- free (mp->m_host);
- mp->m_host = getcpy (pp);
- mp->m_type = mh_strcasecmp (LocalName(), mp->m_host) ? NETHOST : LOCALHOST;
- }
- else {
- if (dp = strchr(mp->m_host, '.')) {
- *dp = NULL;
- if (pp = OfficialName (mp->m_host))
- goto got_real_host;
- *dp = '.';
- }
- mp->m_type = BADHOST;
- }
+ else
+ if (pp = OfficialName (mp->m_host)) {
+ got_real_host: ;
+ free (mp->m_host);
+ mp->m_host = getcpy (pp);
+ mp->m_type = mh_strcasecmp (LocalName(), mp->m_host) ? NETHOST : LOCALHOST;
+ } else {
+ if (dp = strchr(mp->m_host, '.')) {
+ *dp = NULL;
+ if (pp = OfficialName (mp->m_host))
+ goto got_real_host;
+ *dp = '.';
+ }
+ mp->m_type = BADHOST;
+ }
#endif /* not DUMB */
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;
+ 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);
+ 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);
}
char *
auxformat (struct mailname *mp, int extras)
{
- static char addr[BUFSIZ];
- static char buffer[BUFSIZ];
+ static char addr[BUFSIZ];
+ static char buffer[BUFSIZ];
#ifdef DUMB
if (mp->m_nohost)
- strncpy (addr, mp->m_mbox ? mp->m_mbox : "", sizeof(addr));
+ strncpy (addr, mp->m_mbox ? mp->m_mbox : "", sizeof(addr));
else
#endif /* DUMB */
-#ifndef BANG
+#ifndef BANG
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);
+ snprintf (addr, sizeof(addr), mp->m_host ? "%s%s@%s" : "%s%s",
+ empty(mp->m_path), empty(mp->m_mbox), mp->m_host);
else
#endif /* not BANG */
- 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);
+ 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
- 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));
+ strncpy (buffer, addr, sizeof(buffer));
- return buffer;
+ return buffer;
}
char *
adrsprintf (char *username, char *domain)
{
- int snprintf_return;
- static char addr[BUFSIZ];
-
- if (username == NULL)
- username = getusername();
-
- if (username_extension_masquerading) {
- /* mts.conf contains "masquerade:[...]username_extension[...]", so tack
- on the value of the $USERNAME_EXTENSION environment variable, if set,
- to username. */
- char* extension = getenv("USERNAME_EXTENSION");
- static char username_with_extension[BUFSIZ];
-
- if (extension != NULL && *extension != '\0') {
- snprintf_return = snprintf(username_with_extension,
- sizeof(username_with_extension),
- "%s%s", username, extension);
-
- if (snprintf_return < 0 ||
- snprintf_return >= sizeof(username_with_extension))
- adios(NULL, "snprintf() error writing username (%d chars) and"
- " $USERNAME_EXTENSION (%d chars) to array of BUFSIZ (%d)"
- " chars",
- strlen(username), strlen(extension), BUFSIZ);
-
- username = username_with_extension;
+ int snprintf_return;
+ static char addr[BUFSIZ];
+
+ if (username == NULL)
+ username = getusername();
+
+ if (username_extension_masquerading) {
+ /* mts.conf contains "masquerade:[...]username_extension[...]",
+ * so tack on the value of the $USERNAME_EXTENSION environment
+ * variable, if set, to username.
+ */
+ char* extension = getenv("USERNAME_EXTENSION");
+ static char username_with_extension[BUFSIZ];
+
+ if (extension != NULL && *extension != '\0') {
+ snprintf_return = snprintf(username_with_extension,
+ sizeof(username_with_extension),
+ "%s%s", username, extension);
+
+ if (snprintf_return < 0 ||
+ snprintf_return >= sizeof(username_with_extension))
+ adios(NULL, "snprintf() error writing username (%d chars) and"
+ " $USERNAME_EXTENSION (%d chars) to array of BUFSIZ (%d)"
+ " chars",
+ strlen(username), strlen(extension), BUFSIZ);
+
+ username = username_with_extension;
+ }
}
- }
#ifdef REALLYDUMB
- return username;
+ return username;
#endif
- if (domain == NULL)
- domain = LocalName();
+ if (domain == NULL)
+ domain = LocalName();
-#ifndef BANG
- snprintf_return = snprintf (addr, sizeof(addr), "%s@%s", username, domain);
+#ifndef BANG
+ snprintf_return = snprintf (addr, sizeof(addr), "%s@%s", username, domain);
#else /* BANG */
- snprintf_return = snprintf (addr, sizeof(addr), "%s!%s", domain, username);
+ snprintf_return = snprintf (addr, sizeof(addr), "%s!%s", domain, username);
#endif /* BANG */
- if (snprintf_return < 0 || snprintf_return >= sizeof(addr))
- adios(NULL, "snprintf() error writing username (%d chars), domain (%d"
- " chars), and 1 separator char to array of BUFSIZ (%d) chars",
- strlen(username), strlen(domain), BUFSIZ);
-
- return addr;
+ if (snprintf_return < 0 || snprintf_return >= sizeof(addr))
+ adios(NULL, "snprintf() error writing username (%d chars), domain (%d"
+ " chars), and 1 separator char to array of BUFSIZ (%d) chars",
+ strlen(username), strlen(domain), BUFSIZ);
+
+ return addr;
}
-#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"
+#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={NULL};
-
- /*
- * 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 ("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';
+ 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={NULL};
+
+ /*
+ * 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 ("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 ((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 (oops)
- advise (NULL, "please fix the %s: entry in your %s file",
- "alternate-mailboxes", mh_profile);
}
- }
- if (np == NULL) /* XXX */
- return 0;
-
- switch (np->m_type) {
- case NETHOST:
- len = strlen (cp = LocalName ());
- 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:
+ if (np == NULL) /* XXX */
+ return 0;
+
+ switch (np->m_type) {
+ case NETHOST:
+ len = strlen (cp = LocalName ());
+ 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 (!mh_strcasecmp (np->m_mbox, mq.m_mbox))
+ return 1;
+ break;
+
+ default:
+ 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;
+ /*
+ * 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 1;
- }
- return 0;
+ return 0;
}
char *
OfficialName (char *name)
{
- unsigned char *p;
- char *q, site[BUFSIZ];
- struct addrinfo hints, *res;
+ unsigned char *p;
+ char *q, site[BUFSIZ];
+ struct addrinfo hints, *res;
- static char buffer[BUFSIZ];
+ static char buffer[BUFSIZ];
- for (p = name, q = site; *p && (q - site < sizeof(site) - 1); p++, q++)
- *q = isupper (*p) ? tolower (*p) : *p;
- *q = '\0';
- q = site;
+ for (p = name, q = site; *p && (q - site < sizeof(site) - 1); p++, q++)
+ *q = isupper (*p) ? tolower (*p) : *p;
+ *q = '\0';
+ q = site;
- if (!mh_strcasecmp (LocalName(), site))
- return LocalName();
+ if (!mh_strcasecmp (LocalName(), site))
+ return LocalName();
- memset(&hints, 0, sizeof(hints));
- hints.ai_flags = AI_CANONNAME;
- hints.ai_family = PF_UNSPEC;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_flags = AI_CANONNAME;
+ hints.ai_family = PF_UNSPEC;
- if (getaddrinfo(q, NULL, &hints, &res) == 0) {
- strncpy (buffer, res->ai_canonname, sizeof(buffer));
- buffer[sizeof(buffer) - 1] = '\0';
- freeaddrinfo(res);
- return buffer;
- }
+ if (getaddrinfo(q, NULL, &hints, &res) == 0) {
+ strncpy (buffer, res->ai_canonname, sizeof(buffer));
+ buffer[sizeof(buffer) - 1] = '\0';
+ freeaddrinfo(res);
+ return buffer;
+ }
- strncpy (buffer, site, sizeof(buffer));
- return buffer;
+ strncpy (buffer, site, sizeof(buffer));
+ return buffer;
}
-
/*
* ambigsw.c -- report an ambiguous switch
*
void
ambigsw (char *arg, struct swit *swp)
{
- advise (NULL, "-%s ambiguous. It matches", arg);
- print_sw (arg, swp, "-", stderr);
+ advise (NULL, "-%s ambiguous. It matches", arg);
+ print_sw (arg, swp, "-", stderr);
}
-
/*
* atooi.c -- octal version of atoi()
*
int
atooi(char *cp)
{
- register int i, base;
+ register int i, base;
- i = 0;
- base = 8;
- while (*cp >= '0' && *cp <= '7') {
- i *= base;
- i += *cp++ - '0';
- }
+ i = 0;
+ base = 8;
+ while (*cp >= '0' && *cp <= '7') {
+ i *= base;
+ i += *cp++ - '0';
+ }
- return i;
+ return i;
}
-
/*
* brkstring.c -- (destructively) split a string into
* -- an array of substrings
/* 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 char **broken = NULL; /* array of substring start addresses */
+static int len = 0; /* current size of "broken" */
/*
* static prototypes
char **
brkstring (char *str, char *brksep, char *brkterm)
{
- int i;
- char c, *s;
+ 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)));
- }
+ /* 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;
+ /*
+ * scan string, replacing separators with zeroes
+ * and enter start addresses in "broken".
+ */
+ s = str;
- for (i = 0;; i++) {
+ for (i = 0;; i++) {
/* enlarge pointer array, if necessary */
if (i >= len) {
- len += NUMBROKEN;
- broken = mh_xrealloc (broken, (size_t) (len * sizeof(*broken)));
+ len += NUMBROKEN;
+ broken = mh_xrealloc (broken, (size_t) (len * sizeof(*broken)));
}
while (brkany (c = *s, brksep))
- *s++ = '\0';
+ *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;
+ *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 */
- }
+ ; /* empty body */
+ }
- return broken; /* NOT REACHED */
+ return broken; /* NOT REACHED */
}
static int
brkany (char c, char *str)
{
- char *s;
+ char *s;
- if (str) {
+ if (str) {
for (s = str; *s; s++)
- if (c == *s)
+ if (c == *s)
return 1;
- }
- return 0;
+ }
+ return 0;
}
-
/*
* check_charset.c -- routines for character sets
*
char *
get_charset ()
{
- char *charset = getenv ("MM_CHARSET");
+ char *charset = getenv ("MM_CHARSET");
#if defined(HAVE_NL_LANGINFO) && defined(CODESET)
- if (!charset)
- charset = norm_charmap(nl_langinfo (CODESET));
+ if (!charset)
+ charset = norm_charmap(nl_langinfo (CODESET));
#endif
- return charset;
+ return charset;
}
*/
int
-check_charset (char *str, int len)
+check_charset (char *str, int len)
{
- static char *mm_charset = NULL;
- static char *alt_charset = NULL;
- static int mm_len;
- static int alt_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);
+ /* 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);
+ /* 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;
+ /* 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 0;
}
char *
write_charset_8bit (void)
{
- static char *mm_charset = NULL;
+ 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";
+ /*
+ * 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;
+ return mm_charset;
}
-
/*
* client.c -- connect to a server
*
# include <arpa/inet.h>
#endif
-#define TRUE 1
-#define FALSE 0
+#define TRUE 1
+#define FALSE 0
-#define MAXARGS 1000
+#define MAXARGS 1000
/*
* static prototypes
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);
- }
- if (ap == arguments) {
- *ap++ = client_getcpy ("localhost");
- *ap = NULL;
- }
-
- memset(&hints, 0, sizeof(hints));
+ 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);
+ }
+ if (ap == arguments) {
+ *ap++ = client_getcpy ("localhost");
+ *ap = NULL;
+ }
+
+ memset(&hints, 0, sizeof(hints));
#ifdef AI_ADDRCONFIG
- hints.ai_flags = AI_ADDRCONFIG;
+ hints.ai_flags = AI_ADDRCONFIG;
#endif
- hints.ai_family = PF_UNSPEC;
- hints.ai_socktype = SOCK_STREAM;
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
- for (ap = arguments; *ap; ap++) {
+ for (ap = arguments; *ap; ap++) {
- if (debug) {
- fprintf(stderr, "Trying to connect to \"%s\" ...\n", *ap);
- }
+ if (debug) {
+ fprintf(stderr, "Trying to connect to \"%s\" ...\n", *ap);
+ }
- rc = getaddrinfo(*ap, service, &hints, &res);
+ rc = getaddrinfo(*ap, service, &hints, &res);
- if (rc) {
- if (debug) {
- fprintf(stderr, "Lookup of \"%s\" failed: %s\n", *ap,
- gai_strerror(rc));
- }
- continue;
- }
+ 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];
+ 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);
+ rc = getnameinfo(ai->ai_addr, ai->ai_addrlen, address,
+ sizeof(address), NULL, 0, NI_NUMERICHOST);
- fprintf(stderr, "Connecting to %s...\n",
- rc ? "unknown" : address);
- }
+ fprintf(stderr, "Connecting to %s...\n",
+ rc ? "unknown" : address);
+ }
- sd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+ 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 (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(ap);
- return sd;
- }
+ if (connect(sd, ai->ai_addr, ai->ai_addrlen) == 0) {
+ freeaddrinfo(res);
+ client_freelist(ap);
+ return sd;
+ }
- if (debug) {
- fprintf(stderr, "Connection failed: %s\n", strerror(errno));
- }
+ if (debug) {
+ fprintf(stderr, "Connection failed: %s\n", strerror(errno));
+ }
- close(sd);
- }
+ close(sd);
+ }
- freeaddrinfo(res);
- }
+ freeaddrinfo(res);
+ }
- client_freelist(ap);
- strncpy (response, "no servers available", len_response);
- return NOTOK;
+ client_freelist(ap);
+ strncpy (response, "no servers available", len_response);
+ return NOTOK;
}
static void
client_freelist(char **list)
{
- while (*list++ != NULL)
- free(*list);
+ while (*list++ != NULL)
+ free(*list);
}
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;
+ 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;
- broken[bi] = sp;
- while ((c = *++sp) && !client_brkany (c, brksep) && !client_brkany (c, brkterm))
- continue;
- }
- broken[MAXARGS] = 0;
-
- return broken;
+ return broken;
}
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;
+ register char *sp;
+
+ if (strg)
+ for (sp = strg; *sp; sp++)
+ if (chr == *sp)
+ return 1;
+ return 0;
}
static char **
client_copyip (char **p, char **q, int len_q)
{
- while (*p && --len_q > 0)
- *q++ = *p++;
+ while (*p && --len_q > 0)
+ *q++ = *p++;
- *q = NULL;
+ *q = NULL;
- return q;
+ return q;