]> diplodocus.org Git - nmh/blobdiff - uip/send.c
inc/test-eom-align: rm(1) unwanted +inbox emails, not rmm(1).
[nmh] / uip / send.c
index de94af2dc9b046f0aa35d9e10c0ec1ca56370d15..7f665ba4848a23d1b3e0eda918b31f02eecba58f 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * send.c -- send a composed message
+/* send.c -- send a composed message
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -9,11 +7,13 @@
 
 #include <h/mh.h>
 #include <fcntl.h>
 
 #include <h/mh.h>
 #include <fcntl.h>
+#include "h/done.h"
 #include <h/utils.h>
 #include <h/utils.h>
-
 #ifdef OAUTH_SUPPORT
 # include <h/oauth.h>
 #endif
 #ifdef OAUTH_SUPPORT
 # include <h/oauth.h>
 #endif
+#include "sbr/m_maildir.h"
+#include "sbr/m_mktemp.h"
 
 #ifndef CYRUS_SASL
 # define SASLminc(a) (a)
 
 #ifndef CYRUS_SASL
 # define SASLminc(a) (a)
@@ -66,9 +66,6 @@
     X("saslmech mechanism", SASLminc(6), SASLMECHSW) \
     X("authservice", SASLminc(0), AUTHSERVICESW) \
     X("user username", SASLminc(-4), USERSW) \
     X("saslmech mechanism", SASLminc(6), SASLMECHSW) \
     X("authservice", SASLminc(0), AUTHSERVICESW) \
     X("user username", SASLminc(-4), USERSW) \
-    X("attach", -6, ATTACHSW) \
-    X("noattach", -8, NOATTACHSW) \
-    X("attachformat", 7, ATTACHFORMATSW) \
     X("port server-port-name/number", 4, PORTSW) \
     X("tls", TLSminc(-3), TLSSW) \
     X("initialtls", TLSminc(-10), INITTLSSW) \
     X("port server-port-name/number", 4, PORTSW) \
     X("tls", TLSminc(-3), TLSSW) \
     X("initialtls", TLSminc(-10), INITTLSSW) \
@@ -116,7 +113,7 @@ extern char *distfile;
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int msgp = 0, distsw = 0, vecp;
+    int msgp = 0, vecp;
     int isdf = 0, mime = 0;
     int msgnum, status;
     char *cp, *dfolder = NULL, *maildir = NULL;
     int isdf = 0, mime = 0;
     int msgnum, status;
     char *cp, *dfolder = NULL, *maildir = NULL;
@@ -300,17 +297,6 @@ main (int argc, char **argv)
                        adios (NULL, "missing argument to %s", argp[-2]);
                    vec[vecp++] = cp;
                    continue;
                        adios (NULL, "missing argument to %s", argp[-2]);
                    vec[vecp++] = cp;
                    continue;
-               
-               case ATTACHSW:
-                   inform("The -attach switch is deprecated");
-                   continue;
-               case NOATTACHSW:
-                   inform("The -noattach switch is deprecated");
-                   continue;
-
-               case ATTACHFORMATSW:
-                   inform("The -attachformat switch is deprecated");
-                   continue;
            }
        } else {
            msgs[msgp++] = cp;
            }
        } else {
            msgs[msgp++] = cp;
@@ -397,7 +383,7 @@ go_to_it:
 
     if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0)
        if ((cp = context_find ("signature")) && *cp)
 
     if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0)
        if ((cp = context_find ("signature")) && *cp)
-           m_putenv ("SIGNATURE", cp);
+           setenv("SIGNATURE", cp, 1);
 
     for (msgnum = 0; msgnum < msgp; msgnum++)
        if (stat (msgs[msgnum], &st) == NOTOK)
 
     for (msgnum = 0; msgnum < msgp; msgnum++)
        if (stat (msgs[msgnum], &st) == NOTOK)
@@ -412,12 +398,11 @@ go_to_it:
 
     if ((cp = getenv ("mhdist"))
            && *cp
 
     if ((cp = getenv ("mhdist"))
            && *cp
-           && (distsw = atoi (cp))
+           && atoi(cp)
            && altmsg) {
        vec[vecp++] = "-dist";
        if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
            && altmsg) {
        vec[vecp++] = "-dist";
        if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
-           adios(NULL, "unable to create temporary file in %s",
-                 get_temp_dir());
+           adios(NULL, "unable to create temporary file");
        }
        distfile = mh_xstrdup(cp);
        (void) m_unlink(distfile);
        }
        distfile = mh_xstrdup(cp);
        (void) m_unlink(distfile);