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;
options=(-datefield -textfield -notextfield -limit -nolimit
-verbose -noverbose -version -help)
;;
- whom )
- options=(-alias -check -nocheck -draft -draftfolder
- -draftmessage -nodraftfolder -version -help)
- ;;
* )
options=(-help -version -seq)
;;
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
complete show c%+%D:$nmh_mail_dir%
complete sortm c%+%D:$nmh_mail_dir%
complete whatnow c%+%D:$nmh_mail_dir%
-complete whom c%+%D:$nmh_mail_dir%
public nopublic search sequence subject to zero nozero not or and \
lbrace rbrace)" -- pick
-compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' \
- -k "(alias check draft draftfolder draftmessage help nocheck \
- nodraftfolder)" -- whom
-
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' -k '(help)' -- mhpath
-
extern char *version_num;
extern char *version_str;
extern char *whatnowproc;
-extern char *whomproc;
extern void (*done) (int) NORETURN;
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.
+ show. slocal. sortm. whatnow.
MAN5SRC = mh-alias. mh-draft. mh-format. mh-mail. mh-profile. mh-sequence. \
mh-tailor. mts.conf.
Aliasfile: aliases
.\" ali: \-alias aliases
.\" send: \-alias aliases
-.\" whom: \-alias aliases
.fi
.RE
.PP
.fi
.SH "SEE ALSO"
-ali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8)
+ali(1), send(1), group(5), passwd(5), conflict(8), post(8)
.SH CONTEXT
None
.RB [ \-version ]
.RB [ \-help ]
-.HP 5
-.B whom
-.RB [ \-alias
-.IR aliasfile ]
-.RB [ \-check " | " \-nocheck ]
-.RB [ \-draft ]
-.RB [ \-draftfolder
-.IR +folder ]
-.RB [ \-draftmessage
-.IR msg ]
-.RB [ \-nodraftfolder ]
-.RI [ file ]
-.RB [ \-version ]
-.RB [ \-help ]
-
.ad
.SH "SEE ALSO"
.I other-alias
.RS 5
Indicates aliases files for
-.BR ali ,
-.BR whom ,
+.BR ali
and
.BR send .
This may be used instead of the
(used by the
.B sendfiles
shell script) to
-post a message to the mail transport system. It is also called by
-.B whom
-(called with the switches
-.B \-whom
-and
-.BR \-library )
-to do address verification.
+post a message to the mail transport system.
.RE
.PP
.BR rmmproc :
.B repl
to query about the disposition of a composed draft message.
.RE
-.PP
-.BR whomproc :
-%bindir%/whom
-.RS 5
-This is the program used by
-.B whatnow
-to determine to whom a message would be sent.
-.RE
.SS "Environment Variables"
The operation of
configuration, and
if this environment variable is set, then if the commands
.BR refile\ ,
-.BR send ,
-.BR show ,
+.BR send
or
-.B whom
+.BR show
are not given any `msgs'
arguments, then they will default to using the file indicated by
.BR mh\-draft (5).
^slocal(1)~^\- asynchronously filter and deliver new mail
^sortm(1)~^\- sort messages
^whatnow(1)~^\- prompting front\-end for send
-^whom(1)~^\- report to whom a message would go
.sp
^mh\-alias(5)~^\- alias file for nmh message system
^mh\-draft(5)~^\- draft folder facility
.B push
send the message in the background
.TP \w'refilezzzzfolderz'u
-.B whom
-list the addresses that the message will go to
-.TP \w'refilezzzzfolderz'u
-.B whom \-check
-list the addresses and verify that they are
-acceptable to the transport service
-.TP \w'refilezzzzfolderz'u
.B quit
preserve the draft and exit
.TP \w'refilezzzzfolderz'u
option).
.PP
For the
-.B whom
-response, any valid switch to
-.BR whom (1)
-is valid.
-.PP
-For the
.B refile
response, any valid switch to the
.I fileproc
^fileproc:~^Program to refile the message
^lproc:~^Program to list the contents of a message
^sendproc:~^Program to use to send the message
-^whomproc:~^Program to determine who a message would go to
.fi
.SH "SEE ALSO"
-send(1), whom(1)
+send(1)
.SH DEFAULTS
.nf
{ "showmimeproc", &showmimeproc },
{ "showproc", &showproc },
{ "whatnowproc", &whatnowproc },
- { "whomproc", &whomproc },
{ NULL, NULL }
};
CMDS = ali anno burst comp dist flist folder forw install-mh mark mhbuild \
mhlist mhmail mhparam mhpath mhshow mhstore msgchk \
new packf pick prompter refile repl rmf rmm scan send show \
- sortm whatnow whom
+ sortm whatnow
# commands that are links to other commands
LCMDS = flists folders next prev
prompter.c rcvdist.c rcvpack.c rcvstore.c rcvtty.c \
refile.c repl.c replsbr.c rmf.c rmm.c scan.c scansbr.c send.c \
sendsbr.c show.c slocal.c sortm.c spost.c termsbr.c viamail.c \
- whatnow.c whatnowproc.c whatnowsbr.c whom.c
+ whatnow.c whatnowproc.c whatnowsbr.c
# auxiliary files
AUX = Makefile.in
whatnow: whatnow.o whatnowsbr.o sendsbr.o annosbr.o distsbr.o $(LOCALLIBS)
$(LINK) whatnow.o whatnowsbr.o sendsbr.o annosbr.o distsbr.o $(LINKLIBS)
-whom: whom.o distsbr.o $(LOCALLIBS)
- $(LINK) whom.o distsbr.o $(LINKLIBS)
-
# ========== DEPENDENCIES FOR INSTALLING ==========
# install everything
{ "showproc", &showproc },
{ "version", &version_num },
{ "whatnowproc", &whatnowproc },
- { "whomproc", &whomproc },
{ "etcdir", &mhetcdir },
{ "libdir", &mhlibdir },
{ "backup-prefix", &backup_prefix },
{ "debug", -5 },
#define DISTSW 18
{ "dist", -4 }, /* interface from dist */
-#define CHKSW 19
- { "check", -5 }, /* interface from whom */
-#define NCHKSW 20
- { "nocheck", -7 }, /* interface from whom */
-#define WHOMSW 21
- { "whom", -4 }, /* interface from whom */
#define PUSHSW 22 /* fork to sendmail then exit */
{ "push", -4 },
#define NPUSHSW 23 /* exec sendmail */
static int rmflg = 1; /* remove temporary file when done */
static int watch = 0; /* watch the delivery process */
static int backflg = 0; /* rename input file as *.bak when done */
-static int whomflg = 0; /* if just checking addresses */
static int pushflg = 0; /* if going to fork to sendmail */
static int aliasflg = -1; /* if going to process aliases */
static int outputlinelen=72;
msgstate = resent;
continue;
- case WHOMSW:
- whomflg++;
- continue;
-
case FILTSW:
if (!(filter = *argp++) || *filter == '-')
adios (NULL, "missing argument to %s", argp[-2]);
case BODY:
finish_headers (out);
fprintf (out, "\n%s", buf);
- if(whomflg == 0)
- while (state == BODY) {
- state = m_getfld (state, name, buf, sizeof(buf), in);
- fputs (buf, out);
- }
+ while (state == BODY) {
+ state = m_getfld (state, name, buf, sizeof(buf), in);
+ fputs (buf, out);
+ }
break;
case FILEEOF:
}
fclose (in);
- if (backflg && !whomflg) {
+ if (backflg) {
strncpy (buf, m_backup (msg), sizeof(buf));
if (rename (msg, buf) == NOTOK)
advise (buf, "unable to rename %s to", msg);
*argp++ = "-m"; /* send to me too */
*argp++ = "-t"; /* read msg for recipients */
*argp++ = "-i"; /* don't stop on "." */
- if (whomflg)
- *argp++ = "-bv";
if (watch || verbose)
*argp++ = "-v";
*argp = NULL;
return;
for (i = 0; i < fccind; i++)
- if (whomflg)
- printf ("Fcc: %s\n", fccfold[i]);
- else
- fcc (path, fccfold[i]);
+ fcc (path, fccfold[i]);
}
{ "send [<switches>]", 0 },
#define PUSHSW 6
{ "push [<switches>]", 0 },
-#define WHOMSW 7
- { "whom [<switches>]", 0 },
#define QUITSW 8
{ "quit [-delete]", 0 },
#define DELETESW 9
static void sendit (char *, char **, char *, int);
static int buildfile (char **, char *);
static int check_draft (char *);
-static int whomfile (char **, char *);
static int removefile (char *);
static void writelscmd(char *, int, char **);
static void writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp);
showfile (++argp, drft);
break;
- case WHOMSW:
- /* Check to whom the draft would be sent */
- whomfile (++argp, drft);
- break;
-
case QUITSW:
/* Quit, and possibly delete the draft */
if (*++argp && (*argp[0] == 'd' ||
done (0);
}
-/*
- * WHOM
- */
-
-static int
-whomfile (char **arg, char *file)
-{
- pid_t pid;
- int vecp;
- char *vec[MAXARGS];
-
- context_save (); /* save the context file */
- fflush (stdout);
-
- switch (pid = vfork ()) {
- case NOTOK:
- advise ("fork", "unable to");
- return 1;
-
- case OK:
- vecp = 0;
- vec[vecp++] = r1bindex (whomproc, '/');
- vec[vecp++] = file;
- if (arg)
- while (*arg)
- vec[vecp++] = *arg++;
- vec[vecp] = NULL;
-
- execvp (whomproc, vec);
- fprintf (stderr, "unable to exec ");
- perror (whomproc);
- _exit (-1); /* NOTREACHED */
-
- default:
- return (pidwait (pid, NOTOK) & 0377 ? 1 : 0);
- }
-}
-
/*
* Remove the draft file
+++ /dev/null
-/*
- * whom.c -- report to whom a message would be sent
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-#include <h/mh.h>
-#include <h/signals.h>
-#include <signal.h>
-
-static struct swit switches[] = {
-#define ALIASW 0
- { "alias aliasfile", 0 },
-#define CHKSW 1
- { "check", 0 },
-#define NOCHKSW 2
- { "nocheck", 0 },
-#define DRAFTSW 3
- { "draft", 0 },
-#define DFOLDSW 4
- { "draftfolder +folder", 6 },
-#define DMSGSW 5
- { "draftmessage msg", 6 },
-#define NDFLDSW 6
- { "nodraftfolder", 0 },
-#define VERSIONSW 7
- { "version", 0 },
-#define HELPSW 8
- { "help", 0 },
-#define CLIESW 9
- { "client host", -6 },
-#define SERVSW 10
- { "server host", -6 },
-#define SNOOPSW 11
- { "snoop", -5 },
-#define PORTSW 15
- { "port server port name/number", 4 },
- { NULL, 0 }
-};
-
-
-int
-main (int argc, char **argv)
-{
- pid_t child_id;
- int i, status, isdf = 0;
- int distsw = 0, vecp = 0;
- char *cp, *dfolder = NULL, *dmsg = NULL;
- char *msg = NULL, **ap, **argp, backup[BUFSIZ];
- char buf[BUFSIZ], **arguments, *vec[MAXARGS];
-
-#ifdef LOCALE
- setlocale(LC_ALL, "");
-#endif
- invo_name = r1bindex (argv[0], '/');
-
- /* read user profile/context */
- context_read();
-
- arguments = getarguments (invo_name, argc, argv, 1);
- argp = arguments;
-
- vec[vecp++] = invo_name;
- vec[vecp++] = "-whom";
- vec[vecp++] = "-library";
- vec[vecp++] = getcpy (m_maildir (""));
-
- while ((cp = *argp++)) {
- if (*cp == '-') {
- switch (smatch (++cp, switches)) {
- case AMBIGSW:
- ambigsw (cp, switches);
- done (1);
- case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
-
- case HELPSW:
- snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
- print_help (buf, switches, 1);
- done (1);
- case VERSIONSW:
- print_version(invo_name);
- done (1);
-
- case CHKSW:
- case NOCHKSW:
- case SNOOPSW:
- vec[vecp++] = --cp;
- continue;
-
- case DRAFTSW:
- msg = draft;
- continue;
-
- case DFOLDSW:
- if (dfolder)
- adios (NULL, "only one draft folder at a time!");
- if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
- dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
- *cp != '@' ? TFOLDER : TSUBCWF);
- continue;
- case DMSGSW:
- if (dmsg)
- adios (NULL, "only one draft message at a time!");
- if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
- continue;
- case NDFLDSW:
- dfolder = NULL;
- isdf = NOTOK;
- continue;
-
- case ALIASW:
- case CLIESW:
- case SERVSW:
- case PORTSW:
- vec[vecp++] = --cp;
- if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
- vec[vecp++] = cp;
- continue;
- }
- }
- if (msg)
- adios (NULL, "only one draft at a time!");
- else
- vec[vecp++] = msg = cp;
- }
-
- /* allow Aliasfile: profile entry */
- if ((cp = context_find ("Aliasfile"))) {
- char *dp = NULL;
-
- for (ap = brkstring(dp = getcpy(cp), " ", "\n"); ap && *ap; ap++) {
- vec[vecp++] = "-alias";
- vec[vecp++] = *ap;
- }
- }
-
- if (msg == NULL) {
-#ifdef WHATNOW
- if (dfolder || (cp = getenv ("mhdraft")) == NULL || *cp == '\0')
-#endif /* WHATNOW */
- cp = getcpy (m_draft (dfolder, dmsg, 1, &isdf));
- msg = vec[vecp++] = cp;
- }
- if ((cp = getenv ("mhdist"))
- && *cp
- && (distsw = atoi (cp))
- && (cp = getenv ("mhaltmsg"))
- && *cp) {
- if (distout (msg, cp, backup) == NOTOK)
- done (1);
- vec[vecp++] = "-dist";
- distsw++;
- }
- vec[vecp] = NULL;
-
- closefds (3);
-
- if (distsw) {
- for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
- sleep (5);
- }
-
- switch (distsw ? child_id : OK) {
- case NOTOK:
- advise (NULL, "unable to fork, so checking directly...");
- case OK:
- execvp (postproc, vec);
- fprintf (stderr, "unable to exec ");
- perror (postproc);
- _exit (-1);
-
- default:
- SIGNAL (SIGHUP, SIG_IGN);
- SIGNAL (SIGINT, SIG_IGN);
- SIGNAL (SIGQUIT, SIG_IGN);
- SIGNAL (SIGTERM, SIG_IGN);
-
- status = pidwait(child_id, OK);
-
- unlink (msg);
- if (rename (backup, msg) == NOTOK)
- adios (msg, "unable to rename %s to", backup);
- done (status);
- }
-
- return 0; /* dead code to satisfy the compiler */
-}