]> diplodocus.org Git - nmh/blobdiff - uip/post.c
Added warning about when post(1) can't refile(1) a draft.
[nmh] / uip / post.c
index 7cc111e4c60bb9349f9420b9b106d5b6db000e75..1323e19d9e95c149728870f50b09a7cb6eccce86 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * post.c -- enter messages into the mail transport system
+/* post.c -- enter messages into the mail transport system
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -120,7 +119,7 @@ DEFINE_SWITCH_ARRAY(POST, switches);
  * from 'send'.  We use a service name of 'post' internally.
  */
 
-static struct oauth_profile {
+static struct {
     const char *profname;
     int switchnum;
     const char *value;
@@ -170,7 +169,7 @@ struct headers {
 #define        MVIS  0x0008    /* we've seen sighted addrs  */
 #define        MINV  0x0010    /* we've seen blind addrs    */
 #define MSND  0x0020   /* we've seen a Sender:      */
-#define MRSN  0x0040   /* We've seen a Resent-Sendr:*/
+#define MRSN  0x0040   /* We've seen a Resent-Sender: */
 #define MEFM  0x0080   /* We've seen Envelope-From: */
 #define MMIM  0x0100    /* We've seen Mime-Version:  */
 
@@ -319,7 +318,7 @@ main (int argc, char **argv)
     int noverify = 0;
     int eai = 0; /* use Email Address Internationalization (EAI) (SMTPUTF8) */
     char *cp, *msg = NULL, **argp, **arguments, *envelope;
-    char buf[BUFSIZ], name[NAMESZ], *auth_svc = NULL;
+    char buf[NMH_BUFSIZ], name[NAMESZ], *auth_svc = NULL;
     FILE *in, *out;
     m_getfld_state_t gstate = 0;
 
@@ -2006,8 +2005,11 @@ fcc (char *file, char *folder)
 static void
 die (char *what, char *fmt, ...)
 {
+    int err;
     va_list ap;
 
+    err = errno;
+
     (void) m_unlink (tmpfil);
     if (msgflags & MINV)
        (void) m_unlink (bccfil);
@@ -2016,6 +2018,7 @@ die (char *what, char *fmt, ...)
        sm_end (NOTOK);
 
     va_start(ap, fmt);
+    errno = err;
     advertise (what, NULL, fmt, ap);
     va_end(ap);
     done (1);