From a8a894a102eb7f31662d49355312d6e64e081664 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Tue, 10 Apr 2012 23:24:07 +0200 Subject: [PATCH] Removed -(no)push and -(no)forward flags from send, spost and whatnow. We don't send directly (with SMTP) anymore. We only execute sendmail, which, on modern systems, takes few time. Thus we do it directly instead of having more complexity for the rare wish to run sendmail in the background and also be unable to deal with possible errors directly. --- man/inc.man1 | 2 +- man/send.man1 | 24 -------- man/spost.man8 | 5 +- man/whatnow.man1 | 15 +---- uip/send.c | 181 +++--------------------------------------------------- uip/spost.c | 33 +--------- uip/whatnow.c | 32 ++++------ 7 files changed, 27 insertions(+), 265 deletions(-) diff --git a/man/inc.man1 b/man/inc.man1 index 26ec56e..334bcd7 100644 --- a/man/inc.man1 +++ b/man/inc.man1 @@ -178,7 +178,7 @@ in the background and going on to other things. .fi .SH "SEE ALSO" -mhmail(1), scan(1), mh\-mail(5), post(8) +scan(1), mh\-mail(5) .SH DEFAULTS .nf diff --git a/man/send.man1 b/man/send.man1 index 09e3f40..a61fc37 100644 --- a/man/send.man1 +++ b/man/send.man1 @@ -10,8 +10,6 @@ send \- send a message .B send .RB [ \-alias .IR aliasfile ] -.RB [ \-forward " | " \-noforward ] -.RB [ \-push " | " \-nopush ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-watch " | " \-nowatch ] .RB [ msg @@ -70,26 +68,6 @@ Content-Disposition: attachment; filename="VERSION" .fi .PP If -.B \-push -is specified, -.B send -will detach itself from the user's -terminal and perform its actions in the background. If -.BR push 'd -and the draft can't be sent, then an error message will be sent (using -.BR mhmail ) -back to the user. If -.B \-forward -is given, then a copy -of the draft will be attached to this failure notice. Using -.B \-push -differs from putting -.B send -in the background because the output is -trapped and analyzed by -.BR nmh . -.PP -If .B \-verbose is specified, .B send @@ -211,8 +189,6 @@ comp(1), dist(1), forw(1), repl(1), mh\-alias(5), spost(8) .SH DEFAULTS .nf .RB ` msg "' defaults to the current message in the draft folder" -.RB ` \-forward ' -.RB ` \-nopush ' .RB ` \-noverbose ' .RB ` \-nowatch ' .fi diff --git a/man/spost.man8 b/man/spost.man8 index 00f1d7b..1e0429d 100644 --- a/man/spost.man8 +++ b/man/spost.man8 @@ -13,7 +13,6 @@ spost \- feed a message to sendmail .IR aliasfile .RB " | " \-noalias ] .RB [ \-dist ] -.RB [ \-push " | " \-nopush ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-watch " | " \-nowatch ] .I file @@ -122,8 +121,7 @@ does consult the user's profile. .SH "SEE ALSO" -mhmail(1), send(1), mh\-mail(5), mh\-alias(5), mh\-tailor(5), -refile(1), +send(1), mh\-mail(5), mh\-alias(5), mh\-tailor(5), refile(1), .I "Standard for the Format of ARPA Internet Text Messages" (RFC\-822) @@ -131,7 +129,6 @@ refile(1), .nf .RB ` \-noverbose ' .RB ` \-nowatch ' -.RB ` \-nopush ' .fi .SH CONTEXT diff --git a/man/whatnow.man1 b/man/whatnow.man1 index 0406e45..ce6c9c2 100644 --- a/man/whatnow.man1 +++ b/man/whatnow.man1 @@ -64,9 +64,6 @@ send the message .B send \-watch send the message and monitor the delivery process .TP \w'refilezzzzfolderz'u -.B push -send the message in the background -.TP \w'refilezzzzfolderz'u .B quit preserve the draft and exit .TP \w'refilezzzzfolderz'u @@ -101,17 +98,9 @@ response, any valid switch to the editor is valid. .PP For the .B send -and -.B push -responses, any valid switch to +response, any valid switch to .BR send (1) -is valid (as -.B push -merely invokes -.B send -with the -.B \-push -option). +is valid. .PP For the .B refile diff --git a/uip/send.c b/uip/send.c index a2e9932..ed4aca0 100644 --- a/uip/send.c +++ b/uip/send.c @@ -22,8 +22,6 @@ #include int debugsw = 0; /* global */ -int forwsw = 1; -int pushsw = 0; int verbsw = 0; char *altmsg = NULL; char *annotext = NULL; @@ -46,8 +44,6 @@ static FILE *composition_file; /* composition file pointer */ */ static int sendsbr(char **, int, char *, struct stat *, int); static void armed_done(int) NORETURN; -static void alert(char *, int); -static int tmp_fd(void); static void anno(struct stat *); static int sendaux(char **, int, char *, struct stat *); static int attach(char *); @@ -61,25 +57,17 @@ static struct swit switches[] = { { "alias aliasfile", 0 }, #define DEBUGSW 1 { "debug", -5 }, -#define FORWSW 2 - { "forward", 0 }, -#define NFORWSW 3 - { "noforward", 0 }, -#define PUSHSW 4 - { "push", 0 }, -#define NPUSHSW 5 - { "nopush", 0 }, -#define VERBSW 6 +#define VERBSW 2 { "verbose", 0 }, -#define NVERBSW 7 +#define NVERBSW 3 { "noverbose", 0 }, -#define WATCSW 8 +#define WATCSW 4 { "watch", 0 }, -#define NWATCSW 9 +#define NWATCSW 5 { "nowatch", 0 }, -#define VERSIONSW 10 +#define VERSIONSW 6 { "version", 0 }, -#define HELPSW 11 +#define HELPSW 7 { "help", 0 }, { NULL, 0 } }; @@ -134,20 +122,6 @@ main(int argc, char **argv) print_version(invo_name); done(1); - case PUSHSW: - pushsw++; - continue; - case NPUSHSW: - pushsw = 0; - continue; - - case FORWSW: - forwsw++; - continue; - case NFORWSW: - forwsw = 0; - continue; - case VERBSW: verbsw++; vec[vecp++] = --cp; @@ -267,36 +241,6 @@ main(int argc, char **argv) st.st_dev = 0; st.st_ino = 0; } - if (pushsw) { - /* push a fork into the background */ - pid_t pid; - - switch (pid = fork()) { - case -1: - /* fork error */ - advise(NULL, "unable to fork, so can't push..."); - break; - - default: - /* parent, just exit */ - done(0); - - case 0: - /* child, block a few signals and continue */ - SIGNAL(SIGHUP, SIG_IGN); - SIGNAL(SIGINT, SIG_IGN); - SIGNAL(SIGQUIT, SIG_IGN); - SIGNAL(SIGTERM, SIG_IGN); -#ifdef SIGTSTP - SIGNAL(SIGTSTP, SIG_IGN); - SIGNAL(SIGTTIN, SIG_IGN); - SIGNAL(SIGTTOU, SIG_IGN); -#endif - freopen("/dev/null", "r", stdin); - freopen("/dev/null", "w", stdout); - break; - } - } status = 0; vec[0] = "spost"; for (n=3; nm_text); diff --git a/uip/whatnow.c b/uip/whatnow.c index 0576ff8..efdf02d 100644 --- a/uip/whatnow.c +++ b/uip/whatnow.c @@ -70,23 +70,21 @@ static struct swit aleqs[] = { { "list", 0 }, #define SENDSW 4 { "send []", 0 }, -#define PUSHSW 5 - { "push []", 0 }, -#define QUITSW 6 +#define QUITSW 5 { "quit", 0 }, -#define DELETESW 7 +#define DELETESW 6 { "delete", 0 }, -#define CDCMDSW 8 +#define CDCMDSW 7 { "cd [directory]", 0 }, -#define PWDCMDSW 9 +#define PWDCMDSW 8 { "pwd", 0 }, -#define LSCMDSW 10 +#define LSCMDSW 9 { "ls", 0 }, -#define ATTACHCMDSW 11 +#define ATTACHCMDSW 10 { "attach", 0 }, -#define DETACHCMDSW 12 +#define DETACHCMDSW 11 { "detach [-n]", 0 }, -#define ALISTCMDSW 13 +#define ALISTCMDSW 12 { "alist", 0 }, { NULL, 0 } }; @@ -98,7 +96,7 @@ static char *myprompt = "\nWhat now? "; */ static int editfile(char **, char **, char *, int, struct msgs *, char *, char *, int); -static int sendfile(char **, char *, int); +static int sendfile(char **, char *); static int refile(char **, char *); static int removefile(char *); static void writelscmd(char *, int, char **); @@ -253,15 +251,9 @@ main(int argc, char **argv) removefile(drft); done(1); - case PUSHSW: - /* Send draft in background */ - if (sendfile(++argp, drft, 1)) - done(1); - break; - case SENDSW: /* Send draft */ - sendfile(++argp, drft, 0); + sendfile(++argp, drft); break; case REFILEOPT: @@ -752,7 +744,7 @@ copyf(char *ifile, char *ofile) */ static int -sendfile(char **arg, char *file, int pushsw) +sendfile(char **arg, char *file) { pid_t child_id; int vecp; @@ -768,8 +760,6 @@ sendfile(char **arg, char *file, int pushsw) case OK: vecp = 0; vec[vecp++] = invo_name; - if (pushsw) - vec[vecp++] = "-push"; if (arg) while (*arg) vec[vecp++] = *arg++; -- 1.7.10.4