From: markus schnalke Date: Sun, 16 Oct 2011 09:48:09 +0000 (+0200) Subject: Removed the whom program, which relayed on post(8) functionality. X-Git-Tag: mmh-thesis-end~491 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=18017df38ebb626f6eed6f339641fd1298c326e7;p=mmh Removed the whom program, which relayed on post(8) functionality. We can later add one again, which only expands aliases but does not require the MTA to support -bv. --- diff --git a/config/config.c b/config/config.c index f5471a9..97a24ff 100644 --- a/config/config.c +++ b/config/config.c @@ -293,11 +293,6 @@ char *showproc = nmhlibdir (/mhl); 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; diff --git a/docs/COMPLETION-BASH b/docs/COMPLETION-BASH index bdc584f..1e84c1e 100644 --- a/docs/COMPLETION-BASH +++ b/docs/COMPLETION-BASH @@ -118,10 +118,6 @@ _nmh() 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) ;; @@ -161,4 +157,4 @@ _nmh() 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 diff --git a/docs/COMPLETION-TCSH b/docs/COMPLETION-TCSH index 02af265..644bcaf 100644 --- a/docs/COMPLETION-TCSH +++ b/docs/COMPLETION-TCSH @@ -44,4 +44,3 @@ complete send c%+%D:$nmh_mail_dir% complete show c%+%D:$nmh_mail_dir% complete sortm c%+%D:$nmh_mail_dir% complete whatnow c%+%D:$nmh_mail_dir% -complete whom c%+%D:$nmh_mail_dir% diff --git a/docs/COMPLETION-ZSH b/docs/COMPLETION-ZSH index d2ba02c..fe8e422 100644 --- a/docs/COMPLETION-ZSH +++ b/docs/COMPLETION-ZSH @@ -172,9 +172,4 @@ compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \ 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 - diff --git a/h/mh.h b/h/mh.h index d41ab95..58d1e1d 100644 --- a/h/mh.h +++ b/h/mh.h @@ -348,7 +348,6 @@ extern char *usequence; extern char *version_num; extern char *version_str; extern char *whatnowproc; -extern char *whomproc; extern void (*done) (int) NORETURN; diff --git a/man/Makefile.in b/man/Makefile.in index 2a5a77a..b23fb6b 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -48,7 +48,7 @@ MAN1SRC = ali. anno. burst. comp. dist. flist. flists. folder. folders. \ 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. diff --git a/man/mh-alias.man b/man/mh-alias.man index ad47699..9057dde 100644 --- a/man/mh-alias.man +++ b/man/mh-alias.man @@ -229,7 +229,6 @@ and add the line: Aliasfile: aliases .\" ali: \-alias aliases .\" send: \-alias aliases -.\" whom: \-alias aliases .fi .RE .PP @@ -262,7 +261,7 @@ file as appropriate. .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 diff --git a/man/mh-chart.man b/man/mh-chart.man index 1efacfd..c498b74 100644 --- a/man/mh-chart.man +++ b/man/mh-chart.man @@ -730,21 +730,6 @@ or .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" diff --git a/man/mh-profile.man b/man/mh-profile.man index afe5444..13e381c 100644 --- a/man/mh-profile.man +++ b/man/mh-profile.man @@ -293,8 +293,7 @@ aliases .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 @@ -522,13 +521,7 @@ and (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 : @@ -582,14 +575,6 @@ and .B repl to query about the disposition of a composed draft message. .RE -.PP -.BR whomproc : -%bindir%/whom -.RS 5 -This is the program used by -.B whatnow -to determine to whom a message would be sent. -.RE .SS "Environment Variables" The operation of @@ -623,10 +608,9 @@ option was set during 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). diff --git a/man/nmh.man b/man/nmh.man index 6152ccb..b3d3a29 100644 --- a/man/nmh.man +++ b/man/nmh.man @@ -232,7 +232,6 @@ commands: ^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 diff --git a/man/whatnow.man b/man/whatnow.man index 4fca2cd..087511f 100644 --- a/man/whatnow.man +++ b/man/whatnow.man @@ -82,13 +82,6 @@ send the message and monitor the delivery process .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 @@ -139,12 +132,6 @@ with the 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 @@ -221,11 +208,10 @@ information. ^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 diff --git a/sbr/readconfig.c b/sbr/readconfig.c index 46644eb..1dfd99d 100644 --- a/sbr/readconfig.c +++ b/sbr/readconfig.c @@ -38,7 +38,6 @@ static struct procstr procs[] = { { "showmimeproc", &showmimeproc }, { "showproc", &showproc }, { "whatnowproc", &whatnowproc }, - { "whomproc", &whomproc }, { NULL, NULL } }; diff --git a/uip/Makefile.in b/uip/Makefile.in index d600813..d92d27a 100644 --- a/uip/Makefile.in +++ b/uip/Makefile.in @@ -53,7 +53,7 @@ SETGID_MAIL = @SETGID_MAIL@ 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 @@ -76,7 +76,7 @@ SRCS = ali.c aliasbr.c anno.c annosbr.c ap.c burst.c comp.c \ 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 @@ -225,9 +225,6 @@ viamail: viamail.o mhmisc.o mhoutsbr.o sendsbr.o annosbr.o distsbr.o $(LOCALLIBS 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 diff --git a/uip/mhparam.c b/uip/mhparam.c index 328ea6b..b18ddb4 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -60,7 +60,6 @@ static struct proc procs [] = { { "showproc", &showproc }, { "version", &version_num }, { "whatnowproc", &whatnowproc }, - { "whomproc", &whomproc }, { "etcdir", &mhetcdir }, { "libdir", &mhlibdir }, { "backup-prefix", &backup_prefix }, diff --git a/uip/spost.c b/uip/spost.c index 4d23fe5..db16f38 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -60,12 +60,6 @@ struct swit switches[] = { { "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 */ @@ -147,7 +141,6 @@ static int debug = 0; /* debugging post */ static int rmflg = 1; /* remove temporary file when done */ static int watch = 0; /* watch the delivery process */ static int backflg = 0; /* rename input file as *.bak when done */ -static int whomflg = 0; /* if just checking addresses */ static int pushflg = 0; /* if going to fork to sendmail */ static int aliasflg = -1; /* if going to process aliases */ static int outputlinelen=72; @@ -244,10 +237,6 @@ main (int argc, char **argv) msgstate = resent; continue; - case WHOMSW: - whomflg++; - continue; - case FILTSW: if (!(filter = *argp++) || *filter == '-') adios (NULL, "missing argument to %s", argp[-2]); @@ -383,11 +372,10 @@ main (int argc, char **argv) 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: @@ -406,7 +394,7 @@ main (int argc, char **argv) } 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); @@ -434,8 +422,6 @@ main (int argc, char **argv) *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; @@ -841,10 +827,7 @@ file (char *path) return; for (i = 0; i < fccind; i++) - if (whomflg) - printf ("Fcc: %s\n", fccfold[i]); - else - fcc (path, fccfold[i]); + fcc (path, fccfold[i]); } diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index afc56fd..c0f331a 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -83,8 +83,6 @@ static struct swit aleqs[] = { { "send []", 0 }, #define PUSHSW 6 { "push []", 0 }, -#define WHOMSW 7 - { "whom []", 0 }, #define QUITSW 8 { "quit [-delete]", 0 }, #define DELETESW 9 @@ -115,7 +113,6 @@ static int sendfile (char **, char *, int); static void sendit (char *, char **, char *, int); static int buildfile (char **, char *); static int check_draft (char *); -static int whomfile (char **, char *); static int removefile (char *); static void writelscmd(char *, int, char **); static void writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp); @@ -275,11 +272,6 @@ WhatNow (int argc, char **argv) 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' || @@ -1326,44 +1318,6 @@ sendit (char *sp, char **arg, char *file, int pushed) 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 diff --git a/uip/whom.c b/uip/whom.c deleted file mode 100644 index b68e3ae..0000000 --- a/uip/whom.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - * whom.c -- report to whom a message would be sent - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ - -#include -#include -#include - -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 */ -}