X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f81bb3b8dae1b305ad394657b8420acc7ba45462..edee2ed36533ed9dfc7be7c0d64f0f965d55b9c4:/uip/sendsbr.c diff --git a/uip/sendsbr.c b/uip/sendsbr.c index c61ea052..c4d25029 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -129,9 +129,15 @@ sendsbr (char **vec, int vecp, char *program, char *draft, struct stat *st, */ if (auth_svc) { +#ifdef OAUTH_SUPPORT const char *errmsg; - if (!setup_oauth_params(vec, nvecsp, auth_svc, &errmsg)) - adios(NULL, "%s", errmsg); + if (setup_oauth_params(vec, nvecsp, auth_svc, &errmsg) != OK) { + adios(NULL, errmsg); + } +#else + adios(NULL, "send built without OAUTH_SUPPORT, " + "so auth_svc %s is not supported", auth_svc); +#endif /* OAUTH_SUPPORT */ } /* @@ -764,7 +770,8 @@ handle_sendfrom(char **vec, int *vecp, char *draft, const char *auth_svc) { } break; #else - adios(NULL, "sendfrom built without OAUTH_SUPPORT, " + NMH_UNUSED(auth_svc); + adios(NULL, "send built without OAUTH_SUPPORT, " "so -saslmech xoauth2 is not supported"); #endif /* OAUTH_SUPPORT */ } @@ -814,7 +821,9 @@ 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"); vec[(*vecp)++] = getcpy(mh_oauth_cred_fn(auth_svc)); vec[(*vecp)++] = getcpy("-oauthclientid");