X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/ff2b7b715934b346b6121a2a434db116d3203663..418ee17e8bd250785855ca3f3f1ff0e19331d498:/uip/msgchk.c diff --git a/uip/msgchk.c b/uip/msgchk.c index 10feb3cb..5ab5b760 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -6,6 +6,12 @@ */ #include "h/mh.h" +#include "sbr/dtime.h" +#include "sbr/getarguments.h" +#include "sbr/smatch.h" +#include "sbr/ambigsw.h" +#include "sbr/print_version.h" +#include "sbr/print_help.h" #include "sbr/error.h" #include "h/mts.h" #include "h/tws.h" @@ -13,7 +19,7 @@ #include "h/utils.h" #include -#include "h/popsbr.h" +#include "popsbr.h" #ifndef CYRUS_SASL # define SASLminc(a) (a) @@ -42,6 +48,7 @@ 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) \ @@ -83,7 +90,7 @@ main (int argc, char **argv) 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; @@ -170,12 +177,16 @@ main (int argc, char **argv) die("missing argument to %s", argp[-2]); continue; + case TLSSW: + tls = 1; + continue; + case INITTLSSW: - tls = true; + tls = 2; continue; case NOTLSSW: - tls = false; + tls = 0; continue; case CERTVERSW: @@ -226,8 +237,10 @@ main (int argc, char **argv) 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; @@ -241,7 +254,7 @@ main (int argc, char **argv) snoop, sasl, saslmech, tlsflag, auth_svc); } } else { - if (user == NULL) user = getusername (); + if (user == NULL) user = getusername (1); if (vecp == 0) { char *home;