Whoops, user & port were in the wrong order so msgchk didn't work for POP
[mmh] / uip / whatnowsbr.c
index da2debd..6541b42 100644 (file)
@@ -2,8 +2,6 @@
 /*
  * whatnowsbr.c -- the WhatNow shell
  *
- * $Id$
- *
  * 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.
@@ -411,6 +409,11 @@ WhatNow (int argc, char **argv)
                break;
            }
 
+           if (*(argp+1) == (char *)0) {
+               advise((char *)0, "attach command requires file argument(s).");
+               break;
+           }
+
            /*
             *  Build a command line that causes the user's shell to list the file name
             *  arguments.  This handles and wildcard expansion, tilde expansion, etc.
@@ -980,6 +983,12 @@ check_draft (char *msgnam)
 # define SASLminc(a)  0
 #endif /* CYRUS_SASL */
 
+#ifndef TLS_SUPPORT
+# define TLSminc(a)  (a)
+#else /* TLS_SUPPORT */
+# define TLSminc(a)   0
+#endif /* TLS_SUPPORT */
+
 static struct swit  sendswitches[] = {
 #define        ALIASW            0
     { "alias aliasfile", 0 },
@@ -1058,13 +1067,15 @@ static struct swit  sendswitches[] = {
 #define SASLMECHSW       37
     { "saslmech", SASLminc(-5) },
 #define USERSW           38
-    { "user", SASLminc(4) },
+    { "user", SASLminc(-4) },
 #define SNDATTACHSW       39
     { "attach file", 6 },
 #define SNDATTACHFORMAT   40
     { "attachformat", 7 },
 #define PORTSW           41
     { "port server-port-name/number", 4 },
+#define TLSSW            42
+    { "tls", TLSminc(-3) },
     { NULL, 0 }
 };
 
@@ -1219,6 +1230,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
                case SOMLSW:
                case SNOOPSW:
                case SASLSW:
+               case TLSSW:
                    vec[vecp++] = --cp;
                    continue;