]> diplodocus.org Git - nmh/blobdiff - uip/post.c
inc/test-eom-align: rm(1) unwanted +inbox emails, not rmm(1).
[nmh] / uip / post.c
index 6dc18d101783a98d2e7259a7e56881b0b6e712d3..c6a0917595261f7346a803cf5b0d7ec7363d6860 100644 (file)
 #include <h/aliasbr.h>
 #include <h/dropsbr.h>
 #include <h/mime.h>
+#include "h/done.h"
 #include <h/utils.h>
 #include <h/tws.h>
 #include <h/mts.h>
-#include "../sbr/m_mktemp.h"
-#include "../sbr/message_id.h"
+#include "sbr/m_mktemp.h"
+#include "sbr/message_id.h"
 
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
@@ -1221,9 +1222,10 @@ get_header (char *header, struct headers *table)
 {
     struct headers *h;
 
+    header = FENDNULL(header);
     for (h = table; h->value; h++)
-       if (!strcasecmp (FENDNULL(header), FENDNULL(h->value)))
-           return (h - table);
+       if (!strcasecmp(FENDNULL(h->value), header))
+           return h - table;
 
     return NOTOK;
 }
@@ -1299,7 +1301,7 @@ putadr (char *name, char *aka, struct mailname *mp, FILE *out,
 
     linepos += len;
 
-    return (flags & HTRY);
+    return flags & HTRY;
 }
 
 
@@ -1426,7 +1428,7 @@ annoaux (struct mailname *mp)
     snprintf (buffer, sizeof(buffer), "%s\n", adrformat (mp));
     i = strlen (buffer);
 
-    return (write (pfd, buffer, i) == i ? OK : NOTOK);
+    return write(pfd, buffer, i) == i ? OK : NOTOK;
 }
 
 
@@ -1512,8 +1514,7 @@ make_bcc_file (int dashstuff)
      * of MIME encapsulation.
      */
     if (filter != NULL) {
-       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
-           sleep (5);
+       child_id = fork();
        switch (child_id) {
            case NOTOK: 
                adios ("fork", "unable to");
@@ -1537,7 +1538,7 @@ make_bcc_file (int dashstuff)
                execvp (program, vec);
                fprintf (stderr, "unable to exec ");
                perror (mhlproc);
-               _exit (-1);
+               _exit(1);
 
            default: 
                pidXwait (child_id, mhlproc);
@@ -1669,7 +1670,7 @@ static void
 post (char *file, int bccque, int talk, int eai, char *envelope,
       int oauth_flag, char *auth_svc)
 {
-    int        retval, i;
+    int retval;
     pid_t child_id;
 
     if (verbose) {
@@ -1686,8 +1687,7 @@ post (char *file, int bccque, int talk, int eai, char *envelope,
        char **argp, *program;
        int argc;
 
-       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
-           sleep (5);
+       child_id = fork();
        switch (child_id) {
            case NOTOK: 
                adios ("fork", "unable to");
@@ -1806,7 +1806,7 @@ verify_all_addresses (int talk, int eai, char *envelope, int oauth_flag,
        puts(" -- Address Verification Successful --");
 
     if (!whomsw || checksw)
-       sm_end (DONE);
+       sm_end (whomsw ? OK : DONE);
 
     fflush (stdout);
     sigoff ();
@@ -1982,7 +1982,7 @@ static void
 fcc (char *file, char *folder)
 {
     pid_t child_id;
-    int i, status, argp;
+    int status, argp;
     char fold[BUFSIZ];
     char **arglist, *program;
 
@@ -1990,9 +1990,7 @@ fcc (char *file, char *folder)
        printf ("  %sFcc %s: ", msgstate == RESENT ? "Resent-" : "", folder);
     fflush (stdout);
 
-    for (i = 0; (child_id = fork ()) == NOTOK && i < 5; i++)
-       sleep (5);
-
+    child_id = fork();
     switch (child_id) {
        case NOTOK: 
            if (!verbose)
@@ -2015,7 +2013,7 @@ fcc (char *file, char *folder)
            arglist[argp++] = fold;
            arglist[argp] = NULL;
            execvp (program, arglist);
-           _exit (-1);
+           _exit(1);
 
        default: 
            if ((status = pidwait (child_id, OK))) {