]> git.marmaro.de Git - mmh/commitdiff
Removed the whom program, which relayed on post(8) functionality.
authormarkus schnalke <meillo@marmaro.de>
Sun, 16 Oct 2011 09:48:09 +0000 (11:48 +0200)
committermarkus schnalke <meillo@marmaro.de>
Sun, 16 Oct 2011 09:48:09 +0000 (11:48 +0200)
We can later add one again, which only expands aliases but does not
require the MTA to support -bv.

17 files changed:
config/config.c
docs/COMPLETION-BASH
docs/COMPLETION-TCSH
docs/COMPLETION-ZSH
h/mh.h
man/Makefile.in
man/mh-alias.man
man/mh-chart.man
man/mh-profile.man
man/nmh.man
man/whatnow.man
sbr/readconfig.c
uip/Makefile.in
uip/mhparam.c
uip/spost.c
uip/whatnowsbr.c
uip/whom.c [deleted file]

index f5471a9cbdf24d588fe58bc5d5d36cd3f9090889..97a24ffd56e904eba64dd83061a64d264ae04f4c 100644 (file)
@@ -292,11 +292,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.
  */
index bdc584ff382e0269d76218a46586afd18e68c5ce..1e84c1eeaf252980dfc0bce5977b95326b684733 100644 (file)
@@ -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
index 02af265fedc66a2dacc7eff003d11a471c544ce8..644bcaf37f243333e5f974925e0da0a959be2692 100644 (file)
@@ -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%
index d2ba02ca45bca55ec3cabe35b6270f6941b967b4..fe8e422352c8483496189bc4eacb6b0adde5b1de 100644 (file)
@@ -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 d41ab9581df907979ffa9813cbdd3e9b9c5c3643..58d1e1de69da74929497f3d312b1c7a913eb4cd7 100644 (file)
--- 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;
 
index 2a5a77ae9d6729af0db518af57c697333a2391ad..b23fb6bf37c2b378bc40fb3d7e6cc427d3e64822 100644 (file)
@@ -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.
index ad47699a83eecd5a43e022e83a76636b8fe2100d..9057dde51506c3330d7ba366eb1da17c991a1d71 100644 (file)
@@ -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
index 1efacfd493281fc3e7cb6cbae3a0f159ae7b07de..c498b749ebef952ae0d7d494b8965d94464248c7 100644 (file)
@@ -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"
index afe54445a0399083b6868a1409b3bb02f79cdeec..13e381cdc71c55576449d20e6eab35f2d2052185 100644 (file)
@@ -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).
index 6152ccb63a46e6e6e7e02d07118ac7679aee18fd..b3d3a290030bc3390447f74d7be1ef7008613180 100644 (file)
@@ -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
index 4fca2cd2cd6f13844b6a6cdb649d9ca2ba4576f6..087511fe74a96f999675dd9f0db39e296e72c407 100644 (file)
@@ -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
index 46644ebbdb835f9da055faabaa09ce139dfceaa3..1dfd99d89379674696939de6fb67b73533717700 100644 (file)
@@ -38,7 +38,6 @@ static struct procstr procs[] = {
        { "showmimeproc",  &showmimeproc },
        { "showproc",      &showproc },
        { "whatnowproc",   &whatnowproc },
-       { "whomproc",      &whomproc },
        { NULL, NULL }
 };
 
index d600813b84cc47e64bf68b5e36aa0d68ae0e79c9..d92d27a47b888dcd136abcb9d1f751d390103fcf 100644 (file)
@@ -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
index 328ea6b531620f401d31613c4d625e7b8f41c1b7..b18ddb4a072b382af5eb83940e63e65f5a97c901 100644 (file)
@@ -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 },
index 4d23fe5f5fc5348e47941b842da798966a73e83f..db16f38281caf858e837073d7ffb30275e12b7d5 100644 (file)
@@ -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]);
 }
 
 
index afc56fd2f3048054811ecbde495b1ff2453ed301..c0f331a2e96b4f5efe4fa1f11e6f439d215636d1 100644 (file)
@@ -83,8 +83,6 @@ static struct swit aleqs[] = {
        { "send [<switches>]", 0 },
 #define PUSHSW  6
        { "push [<switches>]", 0 },
-#define WHOMSW  7
-       { "whom [<switches>]", 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 (file)
index b68e3ae..0000000
+++ /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 <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 */
-}