]> diplodocus.org Git - nmh/commitdiff
Final cleanup of POP STLS support
authorKen Hornstein <kenh@pobox.com>
Tue, 23 Apr 2019 00:30:24 +0000 (20:30 -0400)
committerKen Hornstein <kenh@pobox.com>
Tue, 23 Apr 2019 00:30:24 +0000 (20:30 -0400)
Perform final cleanup for support for the STLS command in POP.  Add
necessary switches to msgchk and add information to man pages.

man/inc.man
man/msgchk.man
uip/msgchk.c

index 56764a3..eb1b391 100644 (file)
@@ -38,6 +38,7 @@ inc \- incorporate new mail to an nmh folder
 .IR mechanism ]
 .RB [ \-authservice
 .IR service ]
 .IR mechanism ]
 .RB [ \-authservice
 .IR service ]
+.RB [ \-tls ]
 .RB [ \-initialtls ]
 .RB [ \-notls ]
 .RB [ \-certverify " | " \-nocertverify ]
 .RB [ \-initialtls ]
 .RB [ \-notls ]
 .RB [ \-certverify " | " \-nocertverify ]
@@ -286,11 +287,20 @@ for more details.
 If
 .B nmh
 has been compiled with TLS support, the
 If
 .B nmh
 has been compiled with TLS support, the
+.B \-tls
+and
+.B \-initialtls
+switches will require the negotiation of TLS when connecting
+to the remote POP server. The
+.B \-tls
+switch will direct
+.B inc
+to negotiate TLS as part of the normal POP protocol using
+the STLS command.  The
 .B \-initialtls
 .B \-initialtls
-switch will require the negotiation of TLS when connecting
-to the remote POP server.
+switch will direct
 .B inc
 .B inc
-will negotiate TLS immediately after the connection has taken place,
+to negotiate TLS immediately after the connection has taken place,
 before any POP commands are sent or received.  Data encrypted by TLS is
 labeled `(tls-encrypted)' and `(tls-decrypted)' when viewing the POP
 transaction with the
 before any POP commands are sent or received.  Data encrypted by TLS is
 labeled `(tls-encrypted)' and `(tls-decrypted)' when viewing the POP
 transaction with the
index 84a40ca..7669f7a 100644 (file)
@@ -22,6 +22,7 @@ all/mail/nomail ]
 .RB [ \-sasl " | " \-nosasl ]
 .RB [ \-saslmech
 .IR mechanism ]
 .RB [ \-sasl " | " \-nosasl ]
 .RB [ \-saslmech
 .IR mechanism ]
+.RB [ \-tls ]
 .RB [ \-initialtls ]
 .RB [ \-notls ]
 .RB [ \-certverify " | " \-nocertverify ]
 .RB [ \-initialtls ]
 .RB [ \-notls ]
 .RB [ \-certverify " | " \-nocertverify ]
@@ -155,9 +156,14 @@ for more details.
 If
 .B nmh
 has been compiled with TLS support, the
 If
 .B nmh
 has been compiled with TLS support, the
+.B \-tls
+and
 .B \-initialtls
 .B \-initialtls
-switch will require the negotiation of TLS when connecting
+switches will require the negotiation of TLS when connecting
 to the remote POP server.  The
 to the remote POP server.  The
+.B \-tls
+switch will negotiate TLS as part of the normal POP protocol using
+the STLS command.  The
 .B \-initialtls
 switch will negotiate TLS immediately after the connection has taken place,
 before any POP commands are sent or received.  Data encrypted by TLS is
 .B \-initialtls
 switch will negotiate TLS immediately after the connection has taken place,
 before any POP commands are sent or received.  Data encrypted by TLS is
index ca3e382..82541ec 100644 (file)
@@ -48,6 +48,7 @@
     X("nosasl", SASLminc(6), NOSASLSW) \
     X("saslmech", SASLminc(5), SASLMECHSW) \
     X("authservice", SASLminc(0), AUTHSERVICESW) \
     X("nosasl", SASLminc(6), NOSASLSW) \
     X("saslmech", SASLminc(5), SASLMECHSW) \
     X("authservice", SASLminc(0), AUTHSERVICESW) \
+    X("tls", TLSminc(-3), TLSSW) \
     X("initialtls", TLSminc(-10), INITTLSSW) \
     X("notls", TLSminc(-5), NOTLSSW) \
     X("certverify", TLSminc(-10), CERTVERSW) \
     X("initialtls", TLSminc(-10), INITTLSSW) \
     X("notls", TLSminc(-5), NOTLSSW) \
     X("certverify", TLSminc(-10), CERTVERSW) \
@@ -89,7 +90,7 @@ main (int argc, char **argv)
     int notifysw = NT_ALL;
     int status = 0;
     bool sasl = false;
     int notifysw = NT_ALL;
     int status = 0;
     bool sasl = false;
-    bool tls = false;
+    int tls = 0;
     bool noverify = false;
     bool snoop = false;
     int vecp = 0;
     bool noverify = false;
     bool snoop = false;
     int vecp = 0;
@@ -176,12 +177,16 @@ main (int argc, char **argv)
                        die("missing argument to %s", argp[-2]);
                    continue;
 
                        die("missing argument to %s", argp[-2]);
                    continue;
 
+               case TLSSW:
+                   tls = 1;
+                   continue;
+
                case INITTLSSW:
                case INITTLSSW:
-                   tls = true;
+                   tls = 2;
                    continue;
 
                case NOTLSSW:
                    continue;
 
                case NOTLSSW:
-                   tls = false;
+                   tls = 0;
                    continue;
 
                case CERTVERSW:
                    continue;
 
                case CERTVERSW:
@@ -232,8 +237,10 @@ main (int argc, char **argv)
     if (host) {
        int tlsflag = 0;
 
     if (host) {
        int tlsflag = 0;
 
-       if (tls)
-           tlsflag |= P_INITTLS;
+       if (tls == 1)
+           tlsflag = P_STARTTLS;
+       else if (tls == 2)
+           tlsflag = P_INITTLS;
 
        if (noverify)
            tlsflag |= P_NOVERIFY;
 
        if (noverify)
            tlsflag |= P_NOVERIFY;