X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/be2db0893c180332a66245514a5d72985597f181..62b9266aa31b2baced3252987b256b4e43ec9573:/uip/msgchk.c diff --git a/uip/msgchk.c b/uip/msgchk.c index 56f2fa80..5ab5b760 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -6,6 +6,9 @@ */ #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" @@ -16,7 +19,7 @@ #include "h/utils.h" #include -#include "h/popsbr.h" +#include "popsbr.h" #ifndef CYRUS_SASL # define SASLminc(a) (a) @@ -45,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) \ @@ -86,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; @@ -173,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: @@ -229,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; @@ -244,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;