#ifdef OAUTH_SUPPORT
#include <h/oauth.h>
#endif
+#include "h/done.h"
#include "sbr/m_maildir.h"
#include "sbr/m_mktemp.h"
#include "sbr/message_id.h"
execvp(buildprogram, buildvec);
fprintf(stderr, "unable to exec ");
perror(buildmimeproc);
- _exit(-1);
+ _exit(1);
break;
default:
break;
}
- done=armed_done;
+ set_done(armed_done);
switch (setjmp (env)) {
case OK:
/*
if (pushsw && unique) {
char *cp = m_mktemp2(drft, invo_name, NULL, NULL);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s",
- get_temp_dir());
+ die("unable to create temporary file");
}
if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK)
adios (file, "unable to rename %s to", drft);
#ifdef OAUTH_SUPPORT
const char *errmsg;
if (setup_oauth_params(vec, nvecsp, auth_svc, &errmsg) != OK) {
- adios(NULL, "%s", errmsg);
+ die("%s", errmsg);
}
#else
- adios(NULL, "send built without OAUTH_SUPPORT, "
+ die("send built without OAUTH_SUPPORT, "
"so auth_svc %s is not supported", auth_svc);
#endif /* OAUTH_SUPPORT */
}
break;
}
- done=exit;
+ set_done(exit);
if (distfile)
(void) m_unlink (distfile);
case LENERR:
case FMTERR:
- adios (NULL, "message format error in component #%d", compnum);
+ die("message format error in component #%d", compnum);
default:
- adios (NULL, "getfld () returned %d", state);
+ die("getfld () returned %d", state);
}
break;
}
m_getfld_state_destroy (&gstate);
if (cp == NULL)
- adios (NULL, "headers missing from draft");
+ die("headers missing from draft");
nparts = 1;
pos = start;
char *cp = m_mktemp2(drft, invo_name, NULL, &out);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s",
- get_temp_dir());
+ die("unable to create temporary file");
}
strncpy(tmpdrf, cp, sizeof(tmpdrf));
if (!fgets (buffer, sizeof buffer, in)) {
if (partno == nparts)
break;
- adios (NULL, "premature eof");
+ die("premature eof");
}
if ((pos += (len = strlen (buffer))) > CPERMSG) {
execvp (program, vec);
fprintf (stderr, "unable to exec ");
perror (postproc);
- _exit (-1);
+ _exit(1);
default:
/*
execvp (program, arglist);
fprintf (stderr, "unable to exec ");
perror (mailproc);
- _exit (-1);
+ _exit(1);
default: /* no waiting... */
break;
if (strcmp(*vp, "xoauth2") == 0) {
#ifdef OAUTH_SUPPORT
if (setup_oauth_params(vec, vecp, auth_svc, &message) != OK) {
- adios(NULL, "%s", message);
+ die("%s", message);
}
break;
#else
NMH_UNUSED(auth_svc);
- adios(NULL, "send built without OAUTH_SUPPORT, "
+ die("send built without OAUTH_SUPPORT, "
"so -saslmech xoauth2 is not supported");
#endif /* OAUTH_SUPPORT */
}
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
if (! mh_oauth_get_service_info(auth_svc, &svc, errbuf,
sizeof(errbuf)))
- adios(NULL, "Unable to retrieve oauth profile entries: %s",
+ die("Unable to retrieve oauth profile entries: %s",
errbuf);
vec[(*vecp)++] = mh_xstrdup("-authservice");