From: David Levine Date: Tue, 6 Sep 2016 21:49:59 +0000 (-0400) Subject: Protected call of mh_oauth_do_xoauth() with #ifdef OAUTH_SUPPORT to X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/5e4d1f2f9dc08f2b6bc3d6a463e8a1dd3ec29974?ds=inline;hp=-c Protected call of mh_oauth_do_xoauth() with #ifdef OAUTH_SUPPORT to allow post(1) to link when configured without it. --- 5e4d1f2f9dc08f2b6bc3d6a463e8a1dd3ec29974 diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 75e59f6f..d407877c 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -1160,11 +1160,16 @@ sm_auth_xoauth2(const char *user, const char *oauth_svc, int snoop) const char *xoauth_client_res; int status; +#ifdef OAUTH_SUPPORT xoauth_client_res = mh_oauth_do_xoauth(user, oauth_svc, snoop ? stderr : NULL); if (xoauth_client_res == NULL) - return sm_ierror("Internal error: oauth_do_xoauth() returned NULL"); + return sm_ierror("Internal error: mh_oauth_do_xoauth() returned NULL"); +#else + adios(NULL, "sendfrom built without OAUTH_SUPPORT, " + "so oauth_svc %s is not supported", oauth_svc); +#endif /* OAUTH_SUPPORT */ status = smtalk(SM_AUTH, "AUTH XOAUTH2 %s", xoauth_client_res); if (status == 235) { diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 3b729970..ddce3a45 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -135,7 +135,7 @@ sendsbr (char **vec, int vecp, char *program, char *draft, struct stat *st, adios(NULL, errmsg); } #else - adios(NULL, "sendfrom built without OAUTH_SUPPORT, " + adios(NULL, "send built without OAUTH_SUPPORT, " "so auth_svc %s is not supported", auth_svc); #endif /* OAUTH_SUPPORT */ } @@ -770,7 +770,7 @@ handle_sendfrom(char **vec, int *vecp, char *draft, const char *auth_svc) { } break; #else - adios(NULL, "sendfrom built without OAUTH_SUPPORT, " + adios(NULL, "send built without OAUTH_SUPPORT, " "so -saslmech xoauth2 is not supported"); #endif /* OAUTH_SUPPORT */ } @@ -820,7 +820,7 @@ setup_oauth_params(char *vec[], int *vecp, const char *auth_svc, sizeof(errbuf))) adios(NULL, "Unable to retrieve oauth profile entries: %s", errbuf); - + vec[(*vecp)++] = getcpy("-authservice"); vec[(*vecp)++] = getcpy(auth_svc); vec[(*vecp)++] = getcpy("-oauthcredfile");