p = mh_xstrdup(command);
split = brkstring(p, " \t", NULL);
if (split[0] == NULL) {
- adios(NULL, "Invalid blank command found");
+ die("Invalid blank command found");
}
argvarray[0] = mh_xstrdup(r1bindex(split[0], '/'));
for (i = 1; split[i] != NULL; i++) {
if (i > MAXARGS) {
- adios(NULL, "Command exceeded argument limit");
+ die("Command exceeded argument limit");
}
argvarray[i] = mh_xstrdup(split[i]);
}
if ((mypath = getenv("HOME")) == NULL) {
if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0')
- adios(NULL, "cannot determine your home directory");
+ die("cannot determine your home directory");
mypath = pw->pw_dir;
}
/* defpath is an absolute path; make sure that always MH is, too. */
setenv("MH", defpath, 1);
if (stat(defpath, &st) != -1 && (st.st_mode & S_IFREG) == 0)
- adios(NULL, "`%s' specified by your MH environment variable is not a normal file", cp);
+ die("`%s' specified by your MH environment variable is not a normal file", cp);
if ((ib = fopen(defpath, "r")) == NULL)
- adios(NULL, "unable to read the `%s' profile specified by your MH environment variable", defpath);
+ die("unable to read the `%s' profile specified by your MH environment variable", defpath);
}
else {
defpath = concat(mypath, "/", mh_profile, NULL);
if ((ib = fopen(defpath, "r")) == NULL)
- adios(NULL, "Doesn't look like nmh is installed. Run install-mh to do so.");
+ die("Doesn't look like nmh is installed. Run install-mh to do so.");
cp = mh_profile;
}
*/
if ((cp = context_find ("path")) == NULL)
- adios(NULL, "Your %s file does not contain a path entry.", defpath);
+ die("Your %s file does not contain a path entry.", defpath);
if (*cp == '\0')
- adios(NULL, "Your `%s' profile file does not contain a valid path entry.", defpath);
+ die("Your `%s' profile file does not contain a valid path entry.", defpath);
if (*cp != '/')
(void)snprintf (nd = buf, sizeof(buf), "%s/%s", mypath, cp);
cp = concat ("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL);
if (!read_yes_or_no_if_tty(cp))
- adios (NULL, "unable to access MH-directory \"%s\"", nd);
+ die("unable to access MH-directory \"%s\"", nd);
free (cp);
if (!makedir (nd))
- adios (NULL, "unable to create %s", nd);
+ die("unable to create %s", nd);
}
else if ((st.st_mode & S_IFDIR) == 0)
- adios (NULL, "`%s' is not a directory", nd);
+ die("`%s' is not a directory", nd);
/*
* Open and read user's context file. The name of the context file comes from the
inform("\"%s\": format compile error - %s",
&usr_fstring[errpos-errctx], str);
- adios (NULL, "%*s", errctx+1, "^");
+ die("%*s", errctx+1, "^");
}
/*
if (str) charstring_push_back_chars (scanlp, str, strlen (str), 0);
break;
case FT_STRFW:
- adios (NULL, "internal error (FT_STRFW)");
+ die("internal error (FT_STRFW)");
case FT_NUM: {
int num = value;
indent = strlen (sp);
wid -= indent;
if (wid <= 0) {
- adios(NULL, "putaddr -- num register (%d) must be greater "
+ die("putaddr -- num register (%d) must be greater "
"than label width (%d)", value, indent);
}
while ((c = *sp++) && charstring_chars (scanlp) < max) {
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
if (is_selected (mp, msgnum) &&
!(vec[vecp++] = strdup (m_name (msgnum))))
- adios (NULL, "strdup failed");
+ die("strdup failed");
}
vec[vecp] = NULL;
/* Sanity check */
if (mp->numsel != 0)
- adios (NULL, "oops, mp->numsel should be 0");
+ die("oops, mp->numsel should be 0");
/* Mark that the sequence information has changed */
mp->msgflags |= SEQMOD;
*/
if (mp->hghoff < mp->lowoff) {
- adios(NULL, "Internal failure: high message limit < low message "
+ die("Internal failure: high message limit < low message "
"limit; possible overflow?");
}
/* sanity checks */
if (lo < 1)
- adios (NULL, "BUG: called folder_realloc with lo (%d) < 1", lo);
+ die("BUG: called folder_realloc with lo (%d) < 1", lo);
if (hi < 1)
- adios (NULL, "BUG: called folder_realloc with hi (%d) < 1", hi);
+ die("BUG: called folder_realloc with hi (%d) < 1", hi);
if (mp->nummsg > 0 && lo > mp->lowmsg)
- adios (NULL, "BUG: called folder_realloc with lo (%d) > mp->lowmsg (%d)",
+ die("BUG: called folder_realloc with lo (%d) > mp->lowmsg (%d)",
lo, mp->lowmsg);
if (mp->nummsg > 0 && hi < mp->hghmsg)
- adios (NULL, "BUG: called folder_realloc with hi (%d) < mp->hghmsg (%d)",
+ die("BUG: called folder_realloc with hi (%d) < mp->hghmsg (%d)",
hi, mp->hghmsg);
/* Check if we really need to reallocate anything */
#endif /* HAVE_FLOCK */
default:
- adios(NULL, "Internal locking error: unsupported lock type used!");
+ die("Internal locking error: unsupported lock type used!");
}
return -1;
#ifdef HAVE_LOCKF
return LOCKF_LOCKING;
#else /* ! HAVE_LOCKF */
- adios(NULL, "lockf not supported on this system");
+ die("lockf not supported on this system");
#endif /* HAVE_LOCKF */
}
if (strcasecmp(lockname, "flock") == 0) {
#ifdef HAVE_FLOCK
return FLOCK_LOCKING;
#else /* ! HAVE_FLOCK */
- adios(NULL, "flock not supported on this system");
+ die("flock not supported on this system");
#endif /* HAVE_FLOCK */
}
if (strcasecmp(lockname, "dot") == 0) {
return DOT_LOCKING;
}
- adios(NULL, "Unknown lock type: \"%s\"", lockname);
+ die("Unknown lock type: \"%s\"", lockname);
/* NOTREACHED */
return 0;
}
adios (buffer, "unable to change directory to");
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/*
* Make sure we have enough message status space for all
*/
if (mp->hghmsg >= mp->hghoff) {
if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
} else if (mp->lowoff > 1) {
if (!(mp = folder_realloc (mp, 1, mp->hghoff)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
}
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
seq_setprev (mp);
if (mp->numsel > 1)
- adios (NULL, "only one message draft at a time!");
+ die("only one message draft at a time!");
snprintf (buffer, sizeof(buffer), "%s/%s", mp->foldpath, m_name (mp->lowsel));
cp = buffer;
void m_getfld_track_filepos2(m_getfld_state_t *gstate)
{
if (!*gstate)
- adios(NULL, "m_getfld_track_filepos2 without gstate");
+ die("m_getfld_track_filepos2 without gstate");
m_getfld_track_filepos(gstate, (*gstate)->iob);
}
Ungetc(m_getfld_state_t s)
{
if (s->readpos == s->msg_buf)
- adios(NULL, "Ungetc() at start of message buffer.");
+ die("Ungetc() at start of message buffer.");
s->readpos--;
s->bytes_read--;
}
default:
- adios (NULL, "m_getfld() called with bogus state of %d", s->state);
+ die("m_getfld() called with bogus state of %d", s->state);
}
*cp = 0;
int m_getfld2(m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz)
{
if (!*gstate)
- adios(NULL, "m_getfld2 without gstate");
+ die("m_getfld2 without gstate");
return m_getfld(gstate, name, buf, bufsz, (*gstate)->iob);
}
s->edelimlen = c - 1;
s->delimend = s->msg_delim + s->edelimlen;
if (s->edelimlen <= 1)
- adios (NULL, "maildrop delimiter must be at least 2 bytes");
+ die("maildrop delimiter must be at least 2 bytes");
/*
* build a Boyer-Moore end-position map for the matcher in m_getfld.
void m_unknown2(m_getfld_state_t *gstate)
{
if (!*gstate)
- adios(NULL, "m_unknown2 without gstate");
+ die("m_unknown2 without gstate");
m_unknown(gstate, (*gstate)->iob);
}
mts_method = "sendmail/pipe";
sm_mts = MTS_SENDMAIL_PIPE;
} else {
- adios (NULL, "unsupported mts selection \"%s\"", value);
+ die("unsupported mts selection \"%s\"", value);
}
}
char *client_res;
if (!mh_oauth_new (&ctx, svc))
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
if (log != NULL) mh_oauth_log_to(stderr, ctx);
fp = lkfopendata(fn, "r+", &failed_to_lock);
if (fp == NULL) {
if (errno == ENOENT) {
- adios(NULL, "no credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
+ die("no credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
}
adios(fn, "failed to open");
}
}
if ((cred = mh_oauth_cred_load(fp, ctx, user)) == NULL) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
if (!mh_oauth_access_token_valid(time(NULL), cred)) {
if (!mh_oauth_refresh(cred)) {
if (mh_oauth_get_err_code(ctx) == MH_OAUTH_NO_REFRESH) {
- adios(NULL, "no valid credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
+ die("no valid credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
}
if (mh_oauth_get_err_code(ctx) == MH_OAUTH_BAD_GRANT) {
- adios(NULL, "credentials rejected -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
+ die("credentials rejected -- run mhlogin -saslmech xoauth2 -authservice %s", svc);
}
inform("error refreshing OAuth2 token");
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
fseek(fp, 0, SEEK_SET);
if (!mh_oauth_cred_save(fp, cred, user)) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
}
continue;
case BODY:
- adios (NULL, "no blank lines are permitted in %s", file);
+ die("no blank lines are permitted in %s", file);
case FILEEOF:
break;
default:
- adios (NULL, "%s is poorly formatted", file);
+ die("%s is poorly formatted", file);
}
break;
}
user to correct it. */
inform("group or other permissions, %#o, "
"forbidden: %s", stb.st_mode, credentials_file);
- adios(NULL, "Remove password or correct file "
+ die("Remove password or correct file "
"permissions.");
}
if (token(tokval) && *apass == 0)
*cp++ = c;
if (cp - tokval > MAX_TOKVAL_SIZE-1) {
- adios(NULL, "credential tokens restricted to length %d",
+ die("credential tokens restricted to length %d",
MAX_TOKVAL_SIZE - 1);
}
}
case BODY:
lkfclosedata (fp, seqfile);
- adios (NULL, "no blank lines are permitted in %s", seqfile);
+ die("no blank lines are permitted in %s", seqfile);
break;
case FILEEOF:
default:
lkfclosedata (fp, seqfile);
- adios (NULL, "%s is poorly formatted", seqfile);
+ die("%s is poorly formatted", seqfile);
}
break; /* break from for loop */
}
size = 1; /* Some mallocs don't like 0. */
p = malloc(size);
if (!p)
- adios(NULL, "malloc failed, size wanted: %zu", size);
+ die("malloc failed, size wanted: %zu", size);
return p;
}
new = realloc(ptr, size);
if (!new)
- adios(NULL, "realloc failed, size wanted: %zu", size);
+ die("realloc failed, size wanted: %zu", size);
return new;
}
p = calloc(nelem, elsize);
if (!p)
- adios(NULL, "calloc failed, size wanted: %zu * %zu", nelem, elsize);
+ die("calloc failed, size wanted: %zu * %zu", nelem, elsize);
return p;
}
done_callback (1);
}
if (!makedir (folder))
- adios (NULL, "unable to create folder %s", folder);
+ die("unable to create folder %s", folder);
}
}
/* Sanity check */
if (n < 0)
- adios (NULL, "oops, num_digits called with negative value");
+ die("oops, num_digits called with negative value");
if (n == 0)
return 1;
if ((dp = cp + strlen (cp) - 2) < cp || *dp != QUOTE) {
wrong_guess:
if (cp > ++dp)
- adios (NULL, "vfgets() botch -- you lose big");
+ die("vfgets() botch -- you lose big");
if (*dp == '\n') {
*bp = pp;
return 0;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] aliases ...",
case ALIASW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((i = alias (cp)) != AK_OK)
- adios (NULL, "aliasing error in %s - %s", cp, akerror (i));
+ die("aliasing error in %s - %s", cp, akerror (i));
continue;
case NALIASW:
noalias = true;
} else {
/* Should never happen, but try to protect against code changes
that could allow it. */
- adios (NULL, "too many arguments");
+ die("too many arguments");
}
}
for (ap = brkstring(dp = mh_xstrdup(cp), " ", "\n"); ap && *ap; ap++)
if ((i = alias (*ap)) != AK_OK)
- adios (NULL, "aliasing error in %s - %s", *ap, akerror (i));
+ die("aliasing error in %s - %s", *ap, akerror (i));
free(dp);
}
alias (AliasFile);
*/
if (inverted) {
if (vecp == 0)
- adios (NULL, "usage: %s -user addresses ... (you forgot the addresses)",
+ die("usage: %s -user addresses ... (you forgot the addresses)",
invo_name);
for (i = 0; i < vecp; i++)
struct mailname *mp, *np;
if ((pp = getname (s)) == NULL)
- adios (NULL, "no address in \"%s\"", s);
+ die("no address in \"%s\"", s);
if ((mp = getm (pp, NULL, 0, NULL, 0)) == NULL)
- adios (NULL, "bad address \"%s\"", s);
+ die("bad address \"%s\"", s);
while (getname (""))
continue;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case COMPSW:
if (comp)
- adios (NULL, "only one component at a time!");
+ die("only one component at a time!");
if (!(comp = *argp++) || *comp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case DATESW:
case TEXTSW:
if (text)
- adios (NULL, "only one body at a time!");
+ die("only one body at a time!");
if (!(text = *argp++) || *text == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case DELETESW: /* delete annotations */
case NUMBERSW: /* number listing or delete by number */
if (number != 0)
- adios (NULL, "only one number at a time!");
+ die("only one number at a time!");
if (argp - arguments == argc - 1 || **argp == '-')
number = 1;
number = -1;
else if (!(number = atoi(*argp)))
- adios (NULL, "missing argument to %s", argp[-1]);
+ die("missing argument to %s", argp[-1]);
argp++;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
if (draft != NULL) {
if (msgs.size != 0)
- adios(NULL, "can only have message numbers or -draft.");
+ die("can only have message numbers or -draft.");
draft = mh_xstrdup(m_draft(folder, NULL, 1, &isdf));
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if ((cp = *ap + strlen (*ap) - 1) > *ap && *cp == ':')
*cp = 0;
if (!**ap)
- adios (NULL, "null component name");
+ die("null component name");
if (**ap == '-')
- adios (NULL, "invalid component name %s", *ap);
+ die("invalid component name %s", *ap);
if (strlen (*ap) >= NAMESZ)
- adios (NULL, "too large component name %s", *ap);
+ die("too large component name %s", *ap);
for (cp = *ap; *cp; cp++)
if (!isalnum ((unsigned char) *cp) && *cp != '-')
- adios (NULL, "invalid component name %s", *ap);
+ die("invalid component name %s", *ap);
}
mode = fstat (fd, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot ();
if ((cp = m_mktemp2(file, "annotate", NULL, &tmp)) == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
strncpy (tmpfil, cp, sizeof(tmpfil));
chmod (tmpfil, mode);
if (delete >= -1 || append) {
if ((fp = fdopen(fd, "r")) == NULL)
- adios(NULL, "unable to fdopen file.");
+ die("unable to fdopen file.");
field = mh_xmalloc(field_size = 256);
}
*/
if ((n = fputs(field, tmp)) == EOF || (c == '\n' && fputc('\n', tmp) == EOF))
- adios(NULL, "unable to write temporary file.");
+ die("unable to write temporary file.");
} while (*field != '\0' && *field != '-');
*/
if (fp && lseek(fd, (off_t)ftell(fp), SEEK_SET) == (off_t)-1)
- adios(NULL, "can't seek.");
+ die("can't seek.");
cpydata (fd, fileno (tmp), file, tmpfil);
fclose (tmp);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] addrs ...",
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi (cp);
continue;
}
}
if (addrp == NADDRS)
- adios (NULL, "more than %d addresses", NADDRS);
+ die("more than %d addresses", NADDRS);
addrs[addrp++] = cp;
}
addrs[addrp] = NULL;
if (addrp == 0)
- adios (NULL, "usage: %s [switches] addrs ...", invo_name);
+ die("usage: %s [switches] addrs ...", invo_name);
/* get new format string */
nfs = new_fs (form, format, FORMAT);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
msgnum);
} /* this pair of braces was missing before 1999-07-15 */
else
- adios (NULL, "burst() botch -- you lose big");
+ die("burst() botch -- you lose big");
}
}
}
*/
if ((mp->hghmsg + numburst > mp->hghoff) &&
!(mp = folder_realloc (mp, mp->lowoff, mp->hghmsg + numburst)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
*mpp = mp;
j = mp->hghmsg; /* old value */
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
strncpy (f2, tempfile, sizeof(f2));
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nwhat = 0;
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USESW:
case FILESW: /* compatibility */
if (file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(file = *argp++) || *file == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
isdf = NOTOK;
continue;
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (file)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(file = *argp++) || *file == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
cc = addlist(cc, cp);
continue;
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = addlist(from, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dp = NULL;
if (*cp == '@')
cp = dp = path(cp + 1, TSUBCWF);
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi(cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
case SUBJECTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
subject = cp;
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (msg)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
msg = cp;
}
}
msg = NULL;
}
if (form && (folder || msg))
- adios (NULL, "can't mix forms and folders/msgs");
+ die("can't mix forms and folders/msgs");
cp = NULL;
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
seq_save (mp);
if (mp->numsel > 1)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
if ((in = open (form = mh_xstrdup(m_name (mp->lowsel)), O_RDONLY)) == NOTOK)
adios (form, "unable to open message");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nwhat = 0;
continue;
case NWHATSW:
case FILESW:
if (file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = path (cp, TFILE);
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case INPLSW:
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = addlist(from, cp);
continue;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
cc = addlist(cc, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fcc = addlist(fcc, cp);
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi(cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
case ATFILESW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (msg)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
msg = cp;
}
}
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msg || folder))
- adios (NULL, "can't mix files and folders/msgs");
+ die("can't mix files and folders/msgs");
try_it_again:
strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft));
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
seq_setprev (mp); /* set the previous-sequence */
if (mp->numsel > 1)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
}
msgnam = file ? file : mh_xstrdup(m_name (mp->lowsel));
return NOTOK;
default:
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
}
}
process: ;
cp = m_mktemp2(NULL, "dist", &hdrfd, NULL);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy(tmpfil, cp, sizeof(tmpfil));
if ((out = dup (hdrfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
- adios (NULL, "no file descriptors -- you lose big");
+ die("no file descriptors -- you lose big");
(void) m_unlink (tmpfil);
gstate = m_getfld_state_init(ifp);
cp = m_mktemp2(NULL, "dist", &txtfd, NULL);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
fchmod(txtfd, 0600);
strncpy (tmpfil, cp, sizeof(tmpfil));
if ((out = dup (txtfd)) == NOTOK
|| (ofp = fdopen (out, "w")) == NULL)
- adios (NULL, "no file descriptors -- you lose big");
+ die("no file descriptors -- you lose big");
(void) m_unlink (tmpfil);
fprintf (ofp, "\n%s", buffer);
while (state == BODY) {
case LENERR:
case FMTERR:
- adios (NULL, "format error in message %s", msgnam);
+ die("format error in message %s", msgnam);
default:
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
}
}
process: ;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] dates ...",
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi (cp);
continue;
}
}
if (datep == NDATES)
- adios (NULL, "more than %d dates", NDATES);
+ die("more than %d dates", NDATES);
dates[datep++] = cp;
}
dates[datep] = NULL;
if (datep == 0)
- adios (NULL, "usage: %s [switches] dates ...", invo_name);
+ die("usage: %s [switches] dates ...", invo_name);
/* get new format string */
nfs = new_fs (form, format, FORMAT);
ambigsw(cp, switches);
done(1);
case UNKWNSW:
- adios(NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder1 [+folder2 ...]][switches]",
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
svector_push_back (sequencesToDo, cp);
break;
for (; ap && *ap; ap++)
svector_push_back (sequencesToDo, *ap);
} else {
- adios (NULL, "no sequence specified or %s profile entry found", usequence);
+ die("no sequence specified or %s profile entry found", usequence);
}
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
}
}
if (form)
- adios (NULL, "only one form at a time!");
+ die("only one form at a time!");
form = cp;
}
*/
if (*++cp == '-') {
if (*++cp == '\0')
- adios(NULL, "missing component name after --");
+ die("missing component name after --");
app_msgarg(&compargs, cp);
/* Grab next argument for component text */
if (!(cp = *argp++))
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
app_msgarg(&compargs, cp);
continue;
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
print_version(invo_name);
done (0);
case OTHERSW:
- adios(NULL, "internal argument error!");
+ die("internal argument error!");
continue;
case OUTSIZESW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (strcmp(cp, "max") == 0)
outputsize = INT_MAX;
else if (strcmp(cp, "width") == 0)
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
colwidth = atoi(cp);
continue;
case MSGNUMSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgnum = atoi(cp);
continue;
case MSGCURSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgcur = atoi(cp);
continue;
case MSGSIZESW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgsize = atoi(cp);
continue;
case UNSEENSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgunseen = atoi(cp);
continue;
if (mode == MESSAGE && !files && (*cp == '+' || *cp == '@')) {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
*/
if (!dump && compargs.size == 0 && msgs.size == 0) {
- adios(NULL, "usage: [switches] [+folder] msgs | strings...");
+ die("usage: [switches] [+folder] msgs | strings...");
}
/*
*/
if (mode == RAW && form == NULL && format == NULL) {
- adios (NULL, "You must specify a format with -form or -format when "
+ die("You must specify a format with -form or -format when "
"using -raw");
}
adios(maildir, "unable to change directory to");
if (!(mp = folder_read(folder, 1)))
- adios(NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
if (mp->nummsg == 0)
- adios(NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
for (i = 0; i < msgs->size; i++)
if (!m_convert(mp, msgs->msgs[i]))
void
nonexistent_folder (int status) {
NMH_UNUSED (status);
- adios (NULL, "folder %s does not exist", folder);
+ die("folder %s does not exist", folder);
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (argfolder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
argfolder = pluspath (cp);
} else {
if (msg)
- adios (NULL, "only one (current) message at a time!");
+ die("only one (current) message at a time!");
msg = cp;
}
}
ap = brkstring (dp, " ", "\n");
argfolder = getcpy(*ap++);
} else {
- adios (NULL, "no other folder");
+ die("no other folder");
}
for (cp = mh_xstrdup(getfolder(1)); *ap; ap++)
cp = add (*ap, add (" ", cp));
/* Popping a folder off of the folder stack */
if (popsw) {
if (argfolder)
- adios (NULL, "sorry, no folders allowed with -pop");
+ die("sorry, no folders allowed with -pop");
if ((cp = context_find (stack))) {
dp = mh_xstrdup(cp);
ap = brkstring (dp, " ", "\n");
argfolder = getcpy(*ap++);
} else {
- adios (NULL, "folder stack empty");
+ die("folder stack empty");
}
if (*ap) {
/* if there's anything left in the stack */
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nwhat = 0;
continue;
case BILDSW:
case FILESW:
if (file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = path (cp, TFILE);
continue;
case FILTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
mime = 0;
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case FRMTSW:
case DGSTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
digest = mh_xstrdup(cp);
mime = 0;
continue;
case ISSUESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((issue = atoi (cp)) < 1)
- adios (NULL, "bad argument %s %s", argp[-2], cp);
+ die("bad argument %s %s", argp[-2], cp);
continue;
case VOLUMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((volume = atoi (cp)) < 1)
- adios (NULL, "bad argument %s %s", argp[-2], cp);
+ die("bad argument %s %s", argp[-2], cp);
continue;
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = addlist(from, cp);
continue;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
cc = addlist(cc, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fcc = addlist(fcc, cp);
continue;
case SUBJECTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
subject = mh_xstrdup(cp);
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi(cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
app_msgarg(&msgs, cp);
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msgs.size || folder))
- adios (NULL, "can't mix files and folders/msgs");
+ die("can't mix files and folders/msgs");
try_it_again:
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
}
if (! fwdmsg)
- adios (NULL, "Unable to find input message");
+ die("Unable to find input message");
}
if (filter && access (filter, R_OK) == NOTOK)
goto finished;
default:
- adios(NULL, "m_getfld2() returned %d", state);
+ die("m_getfld2() returned %d", state);
}
}
cp = m_mktemp2(NULL, invo_name, NULL, &tmp);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (tmpfil, cp, sizeof(tmpfil));
(void) m_unlink (tmpfil);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] +folder command "
case HOSTSW:
if (!(host = *argp++) || *host == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USERSW:
if (!(user = *argp++) || *user == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SNOOPSW:
continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case AUTHSERVICESW:
if (!(oauth_svc = *argp++) || *oauth_svc == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case TLSSW:
tls = true;
}
} else if (*cp == '+') {
if (*(cp + 1) == '\0')
- adios(NULL, "Invalid null folder name");
+ die("Invalid null folder name");
add_msg(0, "SELECT \"%s\"", cp + 1);
} else {
add_msg(0, "%s", cp);
}
if (! host)
- adios(NULL, "A hostname must be given with -host");
+ die("A hostname must be given with -host");
nsc = netsec_init();
if (oauth_svc) {
if (netsec_set_oauth_service(nsc, oauth_svc) != OK) {
- adios(NULL, "OAuth2 not supported");
+ die("OAuth2 not supported");
}
}
gettimeofday(&tv_start, NULL);
if ((fd = client(host, port, buf, sizeof(buf), snoop)) == NOTOK)
- adios(NULL, "Connect failed: %s", buf);
+ die("Connect failed: %s", buf);
if (timestamp) {
ts_report("Connect time", &tv_start);
if (initialtls || tls) {
if (netsec_set_tls(nsc, 1, 0, &errstr) != OK)
- adios(NULL, "%s", errstr);
+ die("%s", errstr);
if (initialtls && netsec_negotiate_tls(nsc, &errstr) != OK)
- adios(NULL, "%s", errstr);
+ die("%s", errstr);
}
if (sasl) {
if (netsec_set_sasl_params(nsc, "imap", saslmech, imap_sasl_callback,
nsc, &errstr) != OK)
- adios(NULL, "%s", errstr);
+ die("%s", errstr);
}
if ((cp = netsec_readline(nsc, &len, &errstr)) == NULL) {
- adios(NULL, "%s", errstr);
+ die("%s", errstr);
}
if (has_prefix(cp, "* BYE")) {
goto finish;
}
if (netsec_negotiate_tls(nsc, &errstr) != OK) {
- adios(NULL, "%s", errstr);
+ die("%s", errstr);
}
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name);
case AUDSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
audfile = mh_xstrdup(m_maildir(cp));
continue;
case NAUDSW:
case FILESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = path (cp, TFILE);
/*
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi (cp);
continue;
case HOSTSW:
if (!(host = *argp++) || *host == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USERSW:
if (!(user = *argp++) || *user == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SNOOPSW:
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case INITTLSSW:
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
#else
- adios (NULL, "not built with OAuth support");
+ die("not built with OAuth support");
#endif
continue;
case PROXYSW:
if (!(proxy = *argp++) || *proxy == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
}
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
- adios (NULL, "usage: %s [+folder] [switches]", invo_name);
+ die("usage: %s [+folder] [switches]", invo_name);
}
}
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
- adios (NULL, "must specify -authservice with -saslmech xoauth2");
+ die("must specify -authservice with -saslmech xoauth2");
}
} else {
if (user == NULL) {
- adios (NULL, "must specify -user with -saslmech xoauth2");
+ die("must specify -user with -saslmech xoauth2");
}
}
*/
if (pop_init (host, port, user, proxy, snoop, sasl, saslmech,
tlsflag, auth_svc) == NOTOK)
- adios (NULL, "%s", response);
+ die("%s", response);
/* Check if there are any messages */
if (pop_stat (&nmsgs, &nbytes) == NOTOK)
- adios (NULL, "%s", response);
+ die("%s", response);
if (nmsgs == 0) {
pop_quit();
- adios (NULL, "no mail to incorporate");
+ die("no mail to incorporate");
}
} else if (inc_type == INC_FILE) {
newmail = concat (MAILDIR, "/", MAILFIL, NULL);
}
if (stat (newmail, &s1) == NOTOK || s1.st_size == 0)
- adios (NULL, "no mail to incorporate");
+ die("no mail to incorporate");
if (s1.st_mode & S_IFDIR) {
DIR *md;
struct dirent *de;
i = 0;
cp = concat (newmail, "/new", NULL);
if ((md = opendir(cp)) == NULL)
- adios (NULL, "unable to open %s", cp);
+ die("unable to open %s", cp);
while ((de = readdir (md)) != NULL) {
if (de->d_name[0] == '.')
continue;
if (i >= num_maildir_entries) {
if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL)
- adios(NULL, "not enough memory for %d messages", 2*i+16);
+ die("not enough memory for %d messages", 2*i+16);
num_maildir_entries = 2*i+16;
}
Maildir[i].filename = concat (cp, "/", de->d_name, NULL);
closedir (md);
cp = concat (newmail, "/cur", NULL);
if ((md = opendir(cp)) == NULL)
- adios (NULL, "unable to open %s", cp);
+ die("unable to open %s", cp);
while ((de = readdir (md)) != NULL) {
if (de->d_name[0] == '.')
continue;
if (i >= num_maildir_entries) {
if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL)
- adios(NULL, "not enough memory for %d messages", 2*i+16);
+ die("not enough memory for %d messages", 2*i+16);
num_maildir_entries = 2*i+16;
}
Maildir[i].filename = concat (cp, "/", de->d_name, NULL);
free (cp);
closedir (md);
if (i == 0)
- adios (NULL, "no mail to incorporate");
+ die("no mail to incorporate");
num_maildir_entries = i;
qsort (Maildir, num_maildir_entries, sizeof(*Maildir), maildir_srt);
}
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
if (inc_type == INC_FILE && Maildir == NULL) {
/* Mail from a spool file. */
in = lkfopenspool (newmail, "r");
DROPGROUPPRIVS();
if (in == NULL)
- adios (NULL, "unable to lock and fopen %s", newmail);
+ die("unable to lock and fopen %s", newmail);
fstat (fileno(in), &s1);
} else {
trnflag = 0;
pc.written = 0;
pc.mailout = pf;
if (pop_retr(i, pop_action, &pc) == NOTOK)
- adios (NULL, "%s", response);
+ die("%s", response);
if (fflush (pf))
adios (cp, "write error on");
free (cp);
if (trnflag && pop_dele (i) == NOTOK)
- adios (NULL, "%s", response);
+ die("%s", response);
scan_finished();
}
if (pop_quit () == NOTOK)
- adios (NULL, "%s", response);
+ die("%s", response);
} else if (inc_type == INC_FILE && Maildir == NULL) {
/* Mail from a spool file. */
} else {
fclose (in); in = NULL;
}
- adios (NULL, "failed");
+ die("failed");
}
if (aud)
ambigsw (dp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", dp);
+ die("-%s unknown\n", dp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
continue;
}
} else {
- adios (NULL, "%s is invalid argument", dp);
+ die("%s is invalid argument", dp);
}
}
if ((mypath = getenv("HOME")) == NULL) {
if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0')
- adios(NULL, "cannot determine your home directory");
+ die("cannot determine your home directory");
mypath = pw->pw_dir;
}
if (check)
done(0);
if (autof)
- adios (NULL, "invocation error");
- adios (NULL, "You already have an nmh profile, use an editor to modify it");
+ die("invocation error");
+ die("You already have an nmh profile, use an editor to modify it");
}
if (check)
done(1);
cp = concat ("\"", pathname, "\" doesn't exist; Create it? ", NULL);
if (autof || read_switch (cp, anoyes))
if (makedir (pathname) == 0)
- adios (NULL, "unable to create %s", pathname);
+ die("unable to create %s", pathname);
} else {
puts("[Using existing directory]");
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
svector_push_back (seqs, cp);
seqp++;
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* print some general debugging info */
if (debugsw)
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
done (1);
if (publicsw == 1 && is_readonly(mp))
- adios (NULL, "folder %s is read-only, so -public not allowed", folder);
+ die("folder %s is read-only, so -public not allowed", folder);
/*
* Make sure at least one sequence has been
* specified if we are adding or deleting.
*/
if (seqp == 0 && (addsw || deletesw))
- adios (NULL, "-%s requires at least one -sequence argument",
+ die("-%s requires at least one -sequence argument",
addsw ? "add" : "delete");
/* Adding messages to sequences */
while ((cp = *argp++)) {
if (cp[0] == '-' && cp[1] == '\0') {
if (compfile)
- adios (NULL, "cannot specify both standard input and a file");
+ die("cannot specify both standard input and a file");
compfile = cp;
listsw = 0; /* turn off -list if using standard in/out */
verbosw = 0; /* turn off -verbose listings */
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
icachesw = &wcachesw;
do_cache: ;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
+ die("%s unknown", cp);
default:
break;
}
int encoding;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (encoding = smatch (cp, encodingswitches)) {
case AMBIGSW:
ambigsw (cp, encodingswitches);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown encoding algorithm", cp);
+ die("%s unknown encoding algorithm", cp);
case BASE64SW:
header_encoding = CE_BASE64;
break;
header_encoding = CE_8BIT;
break;
default:
- adios (NULL, "Internal error: algorithm %s", cp);
+ die("Internal error: algorithm %s", cp);
}
continue;
}
case MAXUNENCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((maxunencoded = atoi(cp)) < 1)
- adios (NULL, "Invalid argument for %s: %s", argp[-2], cp);
+ die("Invalid argument for %s: %s", argp[-2], cp);
if (maxunencoded > 998)
- adios (NULL, "limit of -maxunencoded is 998");
+ die("limit of -maxunencoded is 998");
continue;
case VERBSW:
}
}
if (compfile)
- adios (NULL, "only one composition file allowed");
+ die("only one composition file allowed");
compfile = cp;
}
/* Check if we have a file to process */
if (!compfile)
- adios (NULL, "need to specify a %s composition file", invo_name);
+ die("need to specify a %s composition file", invo_name);
/*
* Process the composition file from standard input.
*/
if (compfile[0] == '-' && compfile[1] == '\0') {
if ((cp = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
strncpy (infile, cp, sizeof(infile));
/* copy standard input to temporary file */
while ((n = fread(buffer, 1, sizeof(buffer), stdin)) > 0) {
if (fwrite(buffer, 1, n, fp) != n) {
- adios (NULL, "error copying to temporary file");
+ die("error copying to temporary file");
}
}
fclose (fp);
if (!ct) {
if (! (fp = fopen(infile, "r"))) {
- adios(NULL, "Unable to open %s for reading", infile);
+ die("Unable to open %s for reading", infile);
}
while ((n = fread(buffer, 1, sizeof(buffer), fp)) > 0) {
if (fwrite(buffer, 1, n, stdout) != n) {
- adios(NULL, "error copying %s to stdout", infile);
+ die("error copying %s to stdout", infile);
}
}
} else {
/* output MIME message to this temporary file */
if ((cp = m_mktemp2(compfile, invo_name, NULL, &fp_out)) == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
strncpy(outfile, cp, sizeof(outfile));
free (ct);
return NULL;
}
- adios (NULL, "draft shouldn't contain %s: field", name);
+ die("draft shouldn't contain %s: field", name);
}
/* ignore any Content-Type fields in the header */
if (convert) {
if (convert->filename &&
strcasecmp (convert->filename, filename)) {
- adios (NULL, "Multiple %s headers with different files"
+ die("Multiple %s headers with different files"
" not allowed", type);
} else {
convert->filename = mh_xstrdup(filename);
if (convert) {
if (convert->argstring &&
strcasecmp (convert->argstring, argstring)) {
- adios (NULL, "Multiple %s headers with different "
+ die("Multiple %s headers with different "
"argstrings not allowed", type);
} else {
convert->argstring = mh_xstrdup(argstring);
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;
}
for (hp = ct->c_first_hf; hp != NULL; hp = hp->next) {
if (encode_rfc2047(hp->name, &hp->value, header_encoding, NULL)) {
- adios(NULL, "Unable to encode header \"%s\"", hp->name);
+ die("Unable to encode header \"%s\"", hp->name);
}
}
}
/* Extract the type part (as a CT) from filename. */
cts = mh_xcalloc(2, sizeof *cts);
if (! (cts[0] = parse_mime (convert_head->filename))) {
- adios (NULL, "failed to parse %s", convert_head->filename);
+ die("failed to parse %s", convert_head->filename);
}
expand_pseudoheaders (cts[0], m, infile, convert_head);
compose_content (ct, verbose);
if ((cp = strchr(prefix, 'a')) == NULL)
- adios (NULL, "internal error(4)");
+ die("internal error(4)");
/*
* If using EAI, force 8-bit charset.
(*cp)++;
} else {
if (*++cp == 0)
- adios (NULL, "giving up trying to find a unique delimiter string");
+ die("giving up trying to find a unique delimiter string");
(*cp)++;
}
}
again_descr:
ct->c_descr = add (buffer + i + 1, ct->c_descr);
if (!fgetstr (buffer, sizeof(buffer) - 1, in))
- adios (NULL, "end-of-file after %s: field in plaintext", DESCR_FIELD);
+ die("end-of-file after %s: field in plaintext", DESCR_FIELD);
switch (buffer[0]) {
case ' ':
case '\t':
goto again_descr;
case '#':
- adios (NULL, "#-directive after %s: field in plaintext", DESCR_FIELD);
+ die("#-directive after %s: field in plaintext", DESCR_FIELD);
/* NOTREACHED */
default:
again_dispo:
ct->c_dispo = add (buffer + i + 1, ct->c_dispo);
if (!fgetstr (buffer, sizeof(buffer) - 1, in))
- adios (NULL, "end-of-file after %s: field in plaintext", DISPO_FIELD);
+ die("end-of-file after %s: field in plaintext", DISPO_FIELD);
switch (buffer[0]) {
case ' ':
case '\t':
goto again_dispo;
case '#':
- adios (NULL, "#-directive after %s: field in plaintext", DISPO_FIELD);
+ die("#-directive after %s: field in plaintext", DISPO_FIELD);
/* NOTREACHED */
default:
}
/* FALLTHRU */
case CT_MULTIPART:
- adios (NULL, "it doesn't make sense to define an in-line %s content",
+ die("it doesn't make sense to define an in-line %s content",
ct->c_type == CT_MESSAGE ? "message" : "multipart");
/* NOTREACHED */
*/
if (s2i->si_key) {
if (!ci->ci_subtype)
- adios (NULL, "missing subtype in \"#%s\"", ci->ci_type);
+ die("missing subtype in \"#%s\"", ci->ci_type);
switch (ct->c_type = s2i->si_val) {
case CT_MULTIPART:
- adios (NULL, "use \"#begin ... #end\" instead of \"#%s/%s\"",
+ die("use \"#begin ... #end\" instead of \"#%s/%s\"",
ci->ci_type, ci->ci_subtype);
/* NOTREACHED */
case CT_MESSAGE:
if (!strcasecmp (ci->ci_subtype, "partial"))
- adios (NULL, "sorry, \"#%s/%s\" isn't supported",
+ die("sorry, \"#%s/%s\" isn't supported",
ci->ci_type, ci->ci_subtype);
if (!strcasecmp (ci->ci_subtype, "external-body"))
- adios (NULL, "use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"",
+ die("use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"",
ci->ci_type, ci->ci_subtype);
use_forw:
- adios (NULL,
- "use \"#forw [+folder] [msgs]\" instead of \"#%s/%s\"",
+ die( "use \"#forw [+folder] [msgs]\" instead of \"#%s/%s\"",
ci->ci_type, ci->ci_subtype);
/* NOTREACHED */
CT p;
if (!ci->ci_magic)
- adios (NULL, "need external information for \"#@%s/%s\"",
+ die("need external information for \"#@%s/%s\"",
ci->ci_type, ci->ci_subtype);
p = ct;
for (cp = ci->ci_magic + 1; isspace ((unsigned char) *cp); cp++)
continue;
if (!*cp)
- adios (NULL, "empty pipe command for #%s directive", ci->ci_type);
+ die("empty pipe command for #%s directive", ci->ci_type);
cp = mh_xstrdup(cp);
free (ci->ci_magic);
ci->ci_magic = cp;
}
if (extrnal)
- adios (NULL, "external definition not allowed for \"#%s\"", ci->ci_type);
+ die("external definition not allowed for \"#%s\"", ci->ci_type);
/*
* Message directive
cp = *ap;
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder per #forw directive");
+ die("only one folder per #forw directive");
folder = pluspath (cp);
}
}
folder = mh_xstrdup(getfolder(1));
if (!(mp = folder_read (folder, 0)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
for (ap = arguments; *ap; ap++) {
cp = *ap;
if (*cp != '+' && *cp != '@')
if (user_content (in, buffer, &p, infilename) == DONE) {
if (!m->mp_parts)
- adios (NULL, "empty \"#begin ... #end\" sequence");
+ die("empty \"#begin ... #end\" sequence");
return OK;
}
if (!p)
/*
* Unknown directive
*/
- adios (NULL, "unknown directive \"#%s\"", ci->ci_type);
+ die("unknown directive \"#%s\"", ci->ci_type);
return NOTOK; /* NOT REACHED */
}
char *tfile = NULL;
if (!(cp = ci->ci_magic))
- adios (NULL, "internal error(5)");
+ die("internal error(5)");
if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
adios("mhbuildsbr", "unable to create temporary file in %s",
if (checkllinelen && !linelen &&
(gotlen > MAXLONGLINE + 1)) {
- adios(NULL, "Line in content exceeds maximum line limit (%d)",
+ die("Line in content exceeds maximum line limit (%d)",
MAXLONGLINE);
}
char *s = output_params(len, ci->ci_first_pm, &len, mailbody);
if (!s)
- adios(NULL, "Internal error: failed outputting Content-Type "
+ die("Internal error: failed outputting Content-Type "
"parameters");
vp = add (s, vp);
vp = concat (" ", ct->c_descr, NULL);
if (header_encoding != CE_8BIT) {
if (encode_rfc2047(DESCR_FIELD, &vp, header_encoding, NULL)) {
- adios(NULL, "Unable to encode %s header", DESCR_FIELD);
+ die("Unable to encode %s header", DESCR_FIELD);
}
}
add_header (ct, np, vp);
case CE_QUOTED:
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
- adios (NULL, "internal error, invalid encoding");
+ die("internal error, invalid encoding");
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "quoted-printable", "\n", NULL);
case CE_BASE64:
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
- adios (NULL, "internal error, invalid encoding");
+ die("internal error, invalid encoding");
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "base64", "\n", NULL);
case CE_BINARY:
if (ct->c_type == CT_MESSAGE)
- adios (NULL, "internal error, invalid encoding");
+ die("internal error, invalid encoding");
np = mh_xstrdup(ENCODING_FIELD);
vp = concat (" ", "binary", "\n", NULL);
break;
default:
- adios (NULL, "unknown transfer encoding in content");
+ die("unknown transfer encoding in content");
break;
}
PM pm;
if (! (type = mime_type(filename))) {
- adios(NULL, "Unable to determine MIME type of \"%s\"", filename);
+ die("Unable to determine MIME type of \"%s\"", filename);
}
/*
switch (ct->c_type = s2i->si_val) {
case CT_MULTIPART:
- adios (NULL, "multipart types must be specified by mhbuild directives");
+ die("multipart types must be specified by mhbuild directives");
/* NOTREACHED */
case CT_MESSAGE:
if (strcasecmp(ct->c_ctinfo.ci_subtype, "partial") == 0)
- adios(NULL, "Sorry, %s/%s isn't supported", ct->c_ctinfo.ci_type,
+ die("Sorry, %s/%s isn't supported", ct->c_ctinfo.ci_type,
ct->c_ctinfo.ci_subtype);
if (strcasecmp(ct->c_ctinfo.ci_subtype, "external-body") == 0)
- adios(NULL, "external-body messages must be specified "
+ die("external-body messages must be specified "
"by mhbuild directives");
/* FALLTHRU */
if (contains8bit == 1 &&
strcasecmp (eightbitcharset, "US-ASCII") == 0) {
- adios (NULL, "Text content contains 8 bit characters, but "
+ die("Text content contains 8 bit characters, but "
"character set is US-ASCII");
}
ct->c_subtype = TEXT_PLAIN;
if (get_ctinfo ("text/plain", ct, 0) == NOTOK) {
/* This never should fail, but just in case. */
- adios (NULL, "unable to get content info for reply");
+ die("unable to get content info for reply");
}
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof buf, "%s [+folder] [msgs] [switches]",
case DECODETEXTSW:
if (! (cp = *argp++) || *cp == '-') {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
if (! strcasecmp (cp, "8bit")) {
fx.decodetext = CE_8BIT;
} else if (! strcasecmp (cp, "binary")) {
fx.decodetext = CE_BINARY;
} else {
- adios (NULL, "invalid argument to %s", argp[-2]);
+ die("invalid argument to %s", argp[-2]);
}
continue;
case NDECODETEXTSW:
continue;
case DECODETYPESW:
if (! (cp = *argp++) || *cp == '-') {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
fx.decodetypes = cp;
continue;
continue;
case TEXTCHARSETSW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
fx.textcharset = cp;
continue;
continue;
case FIXTYPESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
if (! strncasecmp (cp, "multipart/", 10) ||
! strncasecmp (cp, "message/", 8))
- adios (NULL, "-fixtype %s not allowed", cp);
+ die("-fixtype %s not allowed", cp);
if (! strchr (cp, '/'))
- adios (NULL, "-fixtype requires type/subtype");
+ die("-fixtype requires type/subtype");
if (fx.fixtypes == NULL) { fx.fixtypes = svector_create (10); }
svector_push_back (fx.fixtypes, cp);
continue;
continue;
case FILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
file = *cp == '-' ? mh_xstrdup (cp) : path (cp, TFILE);
continue;
case OUTFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1])) {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
outfile = *cp == '-' ? mh_xstrdup (cp) : path (cp, TFILE);
continue;
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-') {
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
continue;
case NRPRCSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (*cp == '/') {
}
if (file && msgs.size) {
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
}
if (outfile) {
using_stdin = 1;
if ((cp = m_mktemp2 (NULL, invo_name, &fd, NULL)) == NULL) {
- adios (NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
} else {
free (file);
if (close (fd)) {
(void) m_unlink (file);
- adios (NULL, "failed to write temporary file");
+ die("failed to write temporary file");
}
}
/* read folder and create message structure */
if (! (mp = folder_read (folder, 1))) {
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
}
/* check for empty folder */
if (mp->nummsg == 0) {
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
}
/* parse all the message ranges/sequences and set SELECTED */
/* outfp will be closed by the caller */
if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, outfp)) ==
NULL) {
- adios (NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
outfile = mh_xstrdup (tempfile);
} else {
- adios (NULL, "missing both input and output filenames\n");
+ die("missing both input and output filenames\n");
}
} /* else *outfp was defined by caller */
char *tempfile;
if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, &file)) == NULL) {
- adios (NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
tmp_decoded = mh_xstrdup (tempfile);
/* The following call will load ct->c_cefile.ce_file with the tmp
char *tempfile = m_mktemp2 (NULL, invo_name, &fd, NULL);
if (tempfile == NULL) {
- adios (NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
stripped_content_file = mh_xstrdup (tempfile);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW: {
char buf[128];
case REPLYSW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (! strcasecmp (cp, "accept")) {
action = ACT_ACCEPT;
} else if (! strcasecmp (cp, "decline")) {
} else if (! strcasecmp (cp, "delegate")) {
action = ACT_DELEGATE;
} else {
- adios (NULL, "Unknown action: %s", cp);
+ die("Unknown action: %s", cp);
}
continue;
case FORMSW:
if (! (form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (! (format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case INFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
infile = *cp == '-' ? mh_xstrdup(cp) : path (cp, TFILE);
continue;
case OUTFILESW:
if (! (cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
outfile = *cp == '-' ? mh_xstrdup(cp) : path (cp, TFILE);
continue;
insert = "Tentative: ";
break;
case ACT_DELEGATE:
- adios (NULL, "Delegate replies are not supported");
+ die("Delegate replies are not supported");
break;
case ACT_CANCEL:
insert = "Cancelled:";
node->value = tmp;
} else {
/* Should never get here. */
- adios (NULL, "Unknown action: %d", action);
+ die("Unknown action: %d", action);
}
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
+ die("%s unknown", cp);
default:
break;
}
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npart >= NPARTS)
- adios (NULL, "too many parts (starting with %s), %d max",
+ die("too many parts (starting with %s), %d max",
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (ntype >= NTYPES)
- adios (NULL, "too many types (starting with %s), %d max",
+ die("too many types (starting with %s), %d max",
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npreferred >= NPREFS)
- adios (NULL, "too many preferred types (starting with %s), %d max",
+ die("too many preferred types (starting with %s), %d max",
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
free (path ("./", TFOLDER));
if (file && msgs.size)
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
/*
* check if message is coming from file
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
const char *url;
if (svc == NULL) {
- adios(NULL, "missing -authservice switch");
+ die("missing -authservice switch");
}
if (user == NULL) {
- adios(NULL, "missing -user switch");
+ die("missing -user switch");
}
if (!mh_oauth_new(&ctx, svc)) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
if (snoop) {
fn = mh_oauth_cred_fn(svc);
if ((url = mh_oauth_get_authorize_url(ctx)) == NULL) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
if (browser) {
}
if (cred == NULL) {
inform("error exchanging code for OAuth2 token");
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
cred_file = lkfopendata(fn, "r+", &failed_to_lock);
adios(fn, "oops");
}
if (!mh_oauth_cred_save(cred_file, cred, user)) {
- adios(NULL, "%s", mh_oauth_get_err_string(ctx));
+ die("%s", mh_oauth_get_err_string(ctx));
}
if (lkfclosedata(cred_file, fn) != 0) {
adios (fn, "oops");
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf(help, sizeof(help), "%s [switches]",
case USERSW:
if (!(user = *argp++) || *user == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case AUTHSERVICESW:
if (!(svc = *argp++) || *svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case BROWSERSW:
if (!(browser = *argp++) || *browser == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SNOOPSW:
continue;
}
}
- adios(NULL, "extraneous arguments");
+ die("extraneous arguments");
}
if (saslmech && strcasecmp(saslmech, "xoauth2")) {
/* xoauth is assumed */
- adios(NULL, "only -saslmech xoauth2 is supported");
+ die("only -saslmech xoauth2 is supported");
}
free(arguments);
NMH_UNUSED(svc);
NMH_UNUSED(browser);
NMH_UNUSED(snoop);
- adios(NULL, "not built with OAuth support");
+ die("not built with OAuth support");
return 1;
#endif
}
*/
if (pipe(fdinput) < 0) {
- adios(NULL, "Unable to create input pipe");
+ die("Unable to create input pipe");
}
if (pipe(fdoutput) < 0) {
- adios(NULL, "Unable to create output pipe");
+ die("Unable to create output pipe");
}
/*
*/
_exit(0);
case -1:
- adios(NULL, "Unable to fork for filter writer process");
+ die("Unable to fork for filter writer process");
break;
}
break;
case -1:
- adios(NULL, "Unable to fork format program");
+ die("Unable to fork format program");
}
/*
}
if (cc < 0) {
- adios(NULL, "reading from formatproc");
+ die("reading from formatproc");
}
/*
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
+ die("%s unknown", cp);
default:
break;
}
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npart >= NPARTS)
- adios (NULL, "too many parts (starting with %s), %d max",
+ die("too many parts (starting with %s), %d max",
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (ntype >= NTYPES)
- adios (NULL, "too many types (starting with %s), %d max",
+ die("too many types (starting with %s), %d max",
cp, NTYPES);
types[ntype++] = cp;
continue;
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case FORMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
free(formsw);
formsw = mh_xstrdup(etcpath(cp));
continue;
*/
case PROGSW:
if (!(progsw = *argp++) || *progsw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NPROGSW:
nomore++;
case LENSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
/*
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
int vecp;
if (showsw || storesw || cachesw)
- adios (NULL, "cannot use -build with -show, -store, -cache");
+ die("cannot use -build with -show, -store, -cache");
if (msgs.size < 1)
- adios (NULL, "need to specify a %s composition file", invo_name);
+ die("need to specify a %s composition file", invo_name);
if (msgs.size > 1)
- adios (NULL, "only one %s composition file at a time", invo_name);
+ die("only one %s composition file at a time", invo_name);
vecp = 0;
vec[vecp++] = "mhbuild";
}
if (file && msgs.size)
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
/*
* check if message is coming from file
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
* at a time.
*/
if (showsw + listsw + storesw + cachesw > 1)
- adios (NULL, "can only use one of -show, -list, -store, -cache at same time");
+ die("can only use one of -show, -list, -store, -cache at same time");
/* If no action is specified, assume -show */
if (!listsw && !showsw && !storesw && !cachesw)
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [profile-components] [switches]",
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 out of the loop */
adios ("failed", "fread");
case OK:
- adios (NULL, "unexpected EOF from fread");
+ die("unexpected EOF from fread");
default:
bp += cc, size -= cc;
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
} else {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
}
if ((len = ct->c_end - ct->c_begin) < 0)
- adios (NULL, "internal error(1)");
+ die("internal error(1)");
buffer = mh_xmalloc (len + 1);
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
} else {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
}
if ((len = ct->c_end - ct->c_begin) < 0)
- adios (NULL, "internal error(2)");
+ die("internal error(2)");
if (! ct->c_fp) {
if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) {
if (ce->ce_unlink) {
/* Create temporary file with filename extension. */
if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
} else {
} else if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
}
if ((len = ct->c_end - ct->c_begin) < 0)
- adios (NULL, "internal error(3)");
+ die("internal error(3)");
if (! ct->c_fp) {
if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) {
else {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
if (*file == NULL) {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
else {
char *tempfile;
if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ce->ce_file = mh_xstrdup(tempfile);
if (! pm->pm_charset) {
pm->pm_charset = mh_xstrdup(write_charset_8bit());
if (strcasecmp(pm->pm_charset, "US-ASCII") == 0)
- adios(NULL, "8-bit characters in parameter \"%s\", but "
+ die("8-bit characters in parameter \"%s\", but "
"local character set is US-ASCII", pm->pm_name);
}
if (! pm->pm_lang)
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/*
* We need to make sure there is message status space
*/
if (mp->hghmsg >= mp->hghoff) {
if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
} else if (mp->lowoff > 1) {
if (!(mp = folder_realloc (mp, 1, mp->hghoff)))
- adios (NULL, "unable to allocate folder storage");
+ die("unable to allocate folder storage");
}
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
+ die("%s unknown", cp);
default:
break;
}
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npart >= NPARTS)
- adios (NULL, "too many parts (starting with %s), %d max",
+ die("too many parts (starting with %s), %d max",
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (ntype >= NTYPES)
- adios (NULL, "too many types (starting with %s), %d max",
+ die("too many types (starting with %s), %d max",
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npreferred >= NPREFS)
- adios (NULL, "too many preferred types (starting with %s), %d max",
+ die("too many preferred types (starting with %s), %d max",
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case FORMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
free(formsw);
formsw = mh_xstrdup(etcpath(cp));
continue;
case HEADFORMSW:
if (!(headerform = *argp++) || *headerform == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MARKFORMSW:
if (!(markerform = *argp++) || *markerform == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
/*
*/
case PROGSW:
if (!(progsw = *argp++) || *progsw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NPROGSW:
nomore++;
case LENSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case VERBSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
free (path ("./", TFOLDER));
if (file && msgs.size)
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
/*
* check if message is coming from file
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
}
if ((tempfile = m_mktemp2 (NULL, invo_name, &fd, NULL)) == NULL) {
- adios (NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
dest = mh_xstrdup(tempfile);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
icachesw = &wcachesw;
do_cache:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
switch (*icachesw = smatch (cp, cache_policy)) {
case AMBIGSW:
ambigsw (cp, cache_policy);
done (1);
case UNKWNSW:
- adios (NULL, "%s unknown", cp);
+ die("%s unknown", cp);
default:
break;
}
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npart >= NPARTS)
- adios (NULL, "too many parts (starting with %s), %d max",
+ die("too many parts (starting with %s), %d max",
cp, NPARTS);
parts[npart++] = cp;
continue;
case TYPESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (ntype >= NTYPES)
- adios (NULL, "too many types (starting with %s), %d max",
+ die("too many types (starting with %s), %d max",
cp, NTYPES);
types[ntype++] = cp;
continue;
case PREFERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (npreferred >= NPREFS)
- adios (NULL, "too many preferred types (starting with %s), %d max",
+ die("too many preferred types (starting with %s), %d max",
cp, NPREFS);
mime_preference[npreferred].type = cp;
cp = strchr(cp, '/');
case FILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = *cp == '-' ? cp : path (cp, TFILE);
continue;
case OUTFILESW:
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
outfile = *cp == '-' ? cp : path (cp, TFILE);
continue;
continue;
case CLOBBERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
clobbersw = cp;
continue;
case DEBUGSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
free (path ("./", TFOLDER));
if (file && msgs.size)
- adios (NULL, "cannot specify msg and file at same time!");
+ die("cannot specify msg and file at same time!");
/*
* check if message is coming from file
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
/* Store content in temporary file for now */
if ((tmpfilenam = m_mktemp(invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
ct->c_storage = mh_xstrdup(tmpfilenam);
return NMH_CLOBBER_NEVER;
}
- adios (NULL, "invalid argument, %s, to clobber", value);
+ die("invalid argument, %s, to clobber", value);
}
case DIRECTORYSW:
/* Allow the directory to start with '-'. */
if ((cp = *argp++) == NULL) {
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
*directory = cp;
continue;
case PREFIXSW:
/* Allow the prefix to start with '-'. */
if ((cp = *argp++) == NULL) {
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
*prefix = cp;
continue;
case SUFFIXSW:
/* Allow the suffix to start with '-'. */
if ((cp = *argp++) == NULL) {
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
}
*suffix = cp;
continue;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [users ...]",
case NOTESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
notifysw |= donote (cp, 1);
continue;
case NNOTESW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
notifysw &= ~donote (cp, 0);
continue;
case HOSTSW:
if (!(host = *argp++) || *host == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USERSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (vecp >= MAXVEC-1)
- adios (NULL, "you can only check %d users at a time", MAXVEC-1);
+ die("you can only check %d users at a time", MAXVEC-1);
user = vec[vecp++] = cp;
continue;
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case INITTLSSW:
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
#else
- adios (NULL, "not built with OAuth support");
+ die("not built with OAuth support");
#endif
continue;
case PROXYSW:
if (!(proxy = *argp++) || *proxy == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
}
}
if (vecp >= MAXVEC-1)
- adios (NULL, "you can only check %d users at a time", MAXVEC-1);
+ die("you can only check %d users at a time", MAXVEC-1);
vec[vecp++] = cp;
}
if (!geteuid() || NULL == (home = getenv("HOME"))) {
pw = getpwnam (user);
if (pw == NULL)
- adios (NULL, "unable to get information about user");
+ die("unable to get information about user");
home = pw->pw_dir;
}
status = checkmail (user, home, datesw, notifysw, 1);
ambigsw (cp, ntswitches);
done (1);
case UNKWNSW:
- adios (NULL, "-%snotify %s unknown", ntflag ? "" : "no", cp);
+ die("-%snotify %s unknown", ntflag ? "" : "no", cp);
case NALLSW:
return NT_ALL;
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
- adios (NULL, "must specify -authservice with -saslmech xoauth2");
+ die("must specify -authservice with -saslmech xoauth2");
}
} else {
if (user == NULL) {
- adios (NULL, "must specify -user with -saslmech xoauth2");
+ die("must specify -user with -saslmech xoauth2");
}
}
continue;
case BODY:
- adios (NULL, "no blank lines are permitted in %s", seqfile);
+ die("no blank lines are permitted in %s", seqfile);
break;
case FILEEOF:
break;
default:
- adios (NULL, "%s is poorly formatted", seqfile);
+ die("%s is poorly formatted", seqfile);
}
break; /* break from for loop */
}
} else {
fp = fopen(folders, "r");
if (fp == NULL) {
- adios(NULL, "failed to read %s", folders);
+ die("failed to read %s", folders);
}
while (vfgets(fp, &line) == OK) {
len = strlen(line) - 1;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (help, sizeof(help), "%s [switches] [sequences]",
case FOLDERSSW:
if (!(folders = *argp++) || *folders == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MODESW:
if (!(invo_name = *argp++) || *invo_name == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
invo_name = r1bindex(invo_name, '/');
continue;
}
/* no sequence arguments; use unseen */
unseen = context_find(usequence);
if (unseen == NULL || unseen[0] == '\0') {
- adios(NULL, "must specify sequences or set %s", usequence);
+ die("must specify sequences or set %s", usequence);
}
for (ap = brkstring(unseen, " ", "\n"); *ap; ap++) {
svector_push_back (sequences, *ap);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case FILESW:
if (file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(file = *argp++) || *file == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MBOXSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
listsw = 0; /* HACK */
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
vec[vecp++] = --cp;
pattern:
if (!(cp = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
vec[vecp++] = cp;
continue;
case OTHRSW:
- adios (NULL, "internal error!");
+ die("internal error!");
case ANDSW:
case ORSW:
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (!seq_nameok (cp))
done (1);
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 0)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
listsw = !seqp;
if (publicsw == 1 && is_readonly(mp))
- adios (NULL, "folder %s is read-only, so -public not allowed", folder);
+ die("folder %s is read-only, so -public not allowed", folder);
if (!pcompile (vec, NULL))
done (1);
}
if (nums.size >= mp->numsel)
- adios (NULL, "no messages match specification");
+ die("no messages match specification");
/*
* So, what's happening here?
*/
if (!(mp2 = folder_read (folder, 1)))
- adios (NULL, "unable to reread folder %s", folder);
+ die("unable to reread folder %s", folder);
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert (mp2, msgs.msgs[msgnum]))
return 0;
default:
- adios (NULL, "internal error -- you lose");
+ die("internal error -- you lose");
}
break;
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
case LIBSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
/* create a minimal context */
if (context_foil (cp) == -1)
done (1);
case ALIASW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((state = alias (cp)) != AK_OK)
- adios (NULL, "aliasing error in %s - %s",
+ die("aliasing error in %s - %s",
cp, akerror (state));
continue;
case FILTSW:
if (!(filter = *argp++) || *filter == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
mime = 0;
continue;
case NFILTSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi (cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
case ANNOSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((pfd = atoi (cp)) <= 2)
- adios (NULL, "bad argument %s %s", argp[-2], cp);
+ die("bad argument %s %s", argp[-2], cp);
continue;
case CLIESW:
if (!(clientsw = *argp++) || *clientsw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SERVSW:
if (!(serversw = *argp++) || *serversw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SNOOPSW:
snoop++;
case PARTSW:
if (!(partno = *argp++) || *partno == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SASLSW:
case SASLMECHSW:
if (!(saslmech = *argp++) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case AUTHSERVICESW:
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
oauth_flag++;
continue;
int i;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
for (i = 0; oauthswitches[i].profname != NULL; i++) {
if (oauthswitches[i].switchnum == swnum) {
}
if (oauthswitches[i].profname == NULL)
- adios (NULL, "internal error: cannot map switch %s "
+ die("internal error: cannot map switch %s "
"to profile entry", argp[-2]);
oauth_flag++;
case USERSW:
if (!(user = *argp++) || *user == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PORTSW:
if (!(port = *argp++) || *port == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case TLSSW:
case FILEPROCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fileproc = cp;
continue;
case MHLPROCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
mhlproc = cp;
continue;
case MTSSM:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
sendmail = cp;
continue;
case MTSSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
save_mts_method (cp);
continue;
case CREDENTIALSSW: {
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
add_profile_entry ("credentials", cp);
continue;
}
case MESSAGEIDSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (save_message_id_style (cp) != 0)
- adios (NULL, "unsupported messageid \"%s\"", cp);
+ die("unsupported messageid \"%s\"", cp);
continue;
}
}
if (msg)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
msg = cp;
}
alias (AliasFile);
if (!msg)
- adios (NULL, "usage: %s [switches] file", invo_name);
+ die("usage: %s [switches] file", invo_name);
if (outputlinelen < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
if ((in = fopen (msg, "r")) == NULL)
adios (msg, "unable to open");
} else {
char *cp = m_mktemp2(NULL, invo_name, NULL, &out);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
strncpy(tmpfil, cp, sizeof(tmpfil));
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;
}
char sbuf[128];
if (auth_svc == NULL) {
- adios(NULL, "No authentication service given with -authservice");
+ die("No authentication service given with -authservice");
}
for (i = 0; oauthswitches[i].profname != NULL; i++) {
aliases and put them in Bcc:, but then
they'd have the Blind-Carbon-Copy
indication. */
- adios (NULL,
- "blind lists not compatible with"
+ die( "blind lists not compatible with"
" sendmail/pipe");
}
}
if (badmsg)
- adios (NULL, "re-format message and try again");
+ die("re-format message and try again");
if (!recipients)
- adios (NULL, "no addressees");
+ die("no addressees");
}
return;
if (fccind >= FCCS)
- adios (NULL, "too many %ss", hdr->value);
+ die("too many %ss", hdr->value);
fccfold[fccind++] = mh_xstrdup(cp);
}
char *tfile = NULL, *program;
if ((tfile = m_mktemp2(NULL, "bccs", NULL, &out)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (bccfil, tfile, sizeof(bccfil));
* prefix and check again.
*/
if ((cp = strchr(prefix, 'a')) == NULL)
- adios (NULL, "lost prefix start");
+ die("lost prefix start");
while (find_prefix () == NOTOK) {
if (*cp < 'z')
(*cp)++;
else if (*++cp == 0)
- adios (NULL, "can't find a unique delimiter string");
+ die("can't find a unique delimiter string");
else
(*cp)++;
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buffer, sizeof(buffer), "%s [switches] file",
case ERASESW:
if (!(erasep = *argp++) || *erasep == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case KILLSW:
if (!(killp = *argp++) || *killp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PREPSW:
}
if (!drft)
- adios (NULL, "usage: %s [switches] file", invo_name);
+ die("usage: %s [switches] file", invo_name);
if ((in = fopen (drft, "r")) == NULL)
adios (drft, "unable to open");
if ((tmpfil = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
/*
break;
default:
- adios (NULL, "skeleton is poorly formatted");
+ die("skeleton is poorly formatted");
}
break;
}
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
}
}
}
if (addrs == NULL)
- adios (NULL, "usage: %s [switches] [switches for postproc] address ...",
+ die("usage: %s [switches] [switches for postproc] address ...",
invo_name);
umask (~m_gmprot ());
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (tmpfil, tfile, sizeof(tmpfil));
fseek (fp, 0L, SEEK_SET);
if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (drft, tfile, sizeof(tmpfil));
goto finished;
default:
- adios (NULL, "m_getfld2() returned %d", state);
+ die("m_getfld2() returned %d", state);
}
}
finished: ;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] file", invo_name);
}
}
if (file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
file = cp;
}
if (!file)
- adios (NULL, "%s [switches] file", invo_name);
+ die("%s [switches] file", invo_name);
rewind (stdin);
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]",
case SEQSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument name to %s", argp[-2]);
+ die("missing argument name to %s", argp[-2]);
svector_push_back (seqs, cp);
seqp++;
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
- adios (NULL, "usage: %s [+folder] [switches]", invo_name);
+ die("usage: %s [+folder] [switches]", invo_name);
}
}
if (errno != ENOENT)
adios (maildir, "error on folder");
if (!create)
- adios (NULL, "folder %s doesn't exist", maildir);
+ die("folder %s doesn't exist", maildir);
if (!makedir (maildir))
- adios (NULL, "unable to create folder %s", maildir);
+ die("unable to create folder %s", maildir);
}
if (chdir (maildir) == NOTOK)
/* create a temporary file */
tmpfilenam = m_mktemp (invo_name, &fd, NULL);
if (tmpfilenam == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
chmod (tmpfilenam, m_gmprot());
* read folder and create message structure
*/
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/*
* Link message into folder, and possibly add
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi(cp);
continue;
case NLSW:
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [msgs] [switches] +folder ...",
case SRCSW:
if (folder)
- adios (NULL, "only one source folder at a time!");
+ die("only one source folder at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
folder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DRAFTSW:
if (filep > NFOLDERS)
- adios (NULL, "only %d files allowed!", NFOLDERS);
+ die("only %d files allowed!", NFOLDERS);
isdf = 0;
files[filep++] = mh_xstrdup(m_draft(NULL, NULL, 1, &isdf));
continue;
case FILESW:
if (filep > NFOLDERS)
- adios (NULL, "only %d files allowed!", NFOLDERS);
+ die("only %d files allowed!", NFOLDERS);
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
files[filep++] = path (cp, TFILE);
continue;
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NRPRCSW:
rmmproc = NULL;
}
if (*cp == '+' || *cp == '@') {
if (foldp > NFOLDERS)
- adios (NULL, "only %d folders allowed!", NFOLDERS);
+ die("only %d folders allowed!", NFOLDERS);
folders[foldp++].f_name =
pluspath (cp);
} else
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (foldp == 0)
- adios (NULL, "no folder specified");
+ die("no folder specified");
/*
* We are refiling a file to the folders
*/
if (filep > 0) {
if (folder || msgs.size)
- adios (NULL, "use -file or some messages, not both");
+ die("use -file or some messages, not both");
opnfolds (NULL, folders, foldp);
for (i = 0; i < filep; i++)
if (m_file (0, files[i], 0, folders, foldp, preserve, 0))
/* read source folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (chdir (nmaildir) == NOTOK)
adios (nmaildir, "unable to change directory to");
if (!(mp = folder_read (fp->f_name, 1)))
- adios (NULL, "unable to read folder %s", fp->f_name);
+ die("unable to read folder %s", fp->f_name);
mp->curmsg = 0;
fp->f_mp = mp;
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s: [+folder] [msg] [switches]",
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
docc (cp, 1);
continue;
case NCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
docc (cp, 0);
continue;
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
size_t i;
if (!(type = *argp++)) {
- adios (NULL, "missing type argument to %s", argp[-2]);
+ die("missing type argument to %s", argp[-2]);
}
if (!(cp = *argp++)) {
- adios (NULL, "missing argstring argument to %s",
+ die("missing argstring argument to %s",
argp[-3]);
}
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nwhat = 0;
continue;
case BILDSW:
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dp = NULL;
if (*cp == '@')
cp = dp = path (cp + 1, TSUBCWF);
case FILESW:
if (file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = path (cp, TFILE);
continue;
case FILTSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
mime = 0;
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case FRMTSW:
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi (cp)) < 10)
- adios (NULL, "impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
case FMTPROCSW:
if (!(formatproc = *argp++) || *formatproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fmtproc = 1;
continue;
case NFMTPROCSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (msg)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
msg = cp;
}
}
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (file && (msg || folder))
- adios (NULL, "can't mix files and folders/msgs");
+ die("can't mix files and folders/msgs");
try_it_again:
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
if (!m_convert (mp, msg))
seq_setprev (mp); /* set the previous-sequence */
if (mp->numsel > 1)
- adios (NULL, "only one message at a time!");
+ die("only one message at a time!");
context_replace (pfolder, folder); /* update current folder */
seq_setcur (mp, mp->lowsel); /* update current message */
ambigsw (cp, ccswitches);
done (1);
case UNKWNSW:
- adios (NULL, "-%scc %s unknown", ccflag ? "" : "no", cp);
+ die("-%scc %s unknown", ccflag ? "" : "no", cp);
case CTOSW:
ccto = ccflag;
goto finished;
default:
- adios (NULL, "m_getfld2() returned %d", state);
+ die("m_getfld2() returned %d", state);
}
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [switches]",
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
- adios (NULL, "usage: %s [+folder] [switches]", invo_name);
+ die("usage: %s [+folder] [switches]", invo_name);
}
}
}
fp = m_mailpath(folder);
if (!strcmp(fp, pwd()))
- adios (NULL, "sorry, you can't remove the current working directory");
+ die("sorry, you can't remove the current working directory");
free(fp);
if (interactive == -1)
}
if ((dd = opendir (".")) == NULL)
- adios (NULL, "unable to read folder +%s", folder);
+ die("unable to read folder +%s", folder);
others = 0;
/*
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case RPROCSW:
if (!(rmmproc = *argp++) || *rmmproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NRPRCSW:
rmmproc = NULL;
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
format = NULL;
continue;
case FMTSW:
if (!(format = *argp++) || *format == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
form = NULL;
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
width = atoi (cp);
continue;
case REVSW:
case FILESW:
if (!(cp = *argp++) || (cp[0] == '-' && cp[1]))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (strcmp (file = cp, "-"))
file = path (cp, TFILE);
continue;
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
*/
if (file) {
if (msgs.size)
- adios (NULL, "\"msgs\" not allowed with -file");
+ die("\"msgs\" not allowed with -file");
if (folder)
- adios (NULL, "\"+folder\" not allowed with -file");
+ die("\"+folder\" not allowed with -file");
/* check if "file" is really stdin */
if (strcmp (file, "-") == 0) {
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
break;
default:
- adios (NULL, "scan() botch (%d)", state);
+ die("scan() botch (%d)", state);
case SCNEOF:
inform("message %d: empty", msgnum);
goto finished;
default:
- adios (NULL, "getfld() returned %d", state);
+ die("getfld() returned %d", state);
}
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown\n", cp);
+ die("-%s unknown\n", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [file] [switches]", invo_name);
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
msgs[msgp++] = cp;
continue;
case NDFLDSW:
case SPLITSW:
if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1)
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case UNIQSW:
case USERSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
vec[vecp++] = cp;
user = cp;
continue;
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
#else
- adios (NULL, "not built with OAuth support");
+ die("not built with OAuth support");
#endif
continue;
case SASLMECHSW:
if (!(saslmech = *argp) || *saslmech == '-')
- adios (NULL, "missing argument to %s", argp[-1]);
+ die("missing argument to %s", argp[-1]);
/* FALLTHRU */
case ALIASW:
case MESSAGEIDSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
vec[vecp++] = cp;
continue;
}
/* read folder and create message structure */
if (!(mp = folder_read (dfolder, 1)))
- adios (NULL, "unable to read folder %s", dfolder);
+ die("unable to read folder %s", dfolder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", dfolder);
+ die("no messages in %s", dfolder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgp; msgnum++)
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
adios (distfile, "unable to link %s to", altmsg);
free (distfile);
if ((cp = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
distfile = mh_xstrdup(cp);
#ifdef OAUTH_SUPPORT
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
- adios (NULL, "must specify -authservice with -saslmech xoauth2");
+ die("must specify -authservice with -saslmech xoauth2");
}
} else {
if (user == NULL) {
- adios (NULL, "must specify -user with -saslmech xoauth2");
+ die("must specify -user with -saslmech xoauth2");
}
}
#else
if (pushsw && unique) {
char *cp = m_mktemp2(drft, invo_name, NULL, NULL);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file");
+ 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 */
}
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");
+ 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) {
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");
case DRFTSW:
if (file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
draftsw++;
if (mode == SHOW)
continue;
usage:
- adios (NULL,
- "usage: %s [+folder] [switches] [switches for showproc]",
+ die( "usage: %s [+folder] [switches] [switches for showproc]",
invo_name);
case FILESW:
if (mode != SHOW)
goto usage;
if (draftsw || file)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
file = path (cp, TFILE);
continue;
case FORMSW:
app_msgarg(&vec, --cp);
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
app_msgarg(&vec, mh_xstrdup(etcpath(cp)));
continue;
case WCACHESW:
app_msgarg(&vec, --cp);
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
app_msgarg(&vec, cp);
continue;
case SHOWSW:
if (!(showproc = *argp++) || *showproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nshow = 0;
continue;
case NSHOWSW:
case SHOWMIMESW:
if (!(showmimeproc = *argp++) || *showmimeproc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nshow = 0;
continue;
case CHECKMIMESW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else {
if (mode != SHOW)
if (draftsw || file) {
if (msgs.size)
- adios (NULL, "only one file at a time!");
+ die("only one file at a time!");
if (draftsw)
app_msgarg(&vec, mh_xstrdup(m_draft(folder, NULL, 1, &isdf)));
else
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case ADDRSW:
if (!(addr = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case INFOSW:
if (!(info = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case USERSW:
if (!(user = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case FILESW:
if (!(file = *argp++) || *file == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SENDERSW:
if (!(sender = *argp++))/* allow -xyz arguments */
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MAILBOXSW:
if (!(mbox = *argp++) || *mbox == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case HOMESW:
if (!(home = *argp++) || *home == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case MAILSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if (mdlvr)
- adios (NULL, "only one maildelivery file at a time!");
+ die("only one maildelivery file at a time!");
mdlvr = cp;
continue;
continue;
}
} else {
- adios (NULL, "only switch arguments are supported");
+ die("only switch arguments are supported");
}
}
user = getusername ();
}
if ((pw = getpwnam (user)) == NULL)
- adios (NULL, "no such local user as %s", user);
+ die("no such local user as %s", user);
if (chdir (pw->pw_dir) == -1)
if (chdir ("/") < 0) {
/* Record the delivery time */
if ((now = dlocaltimenow ()) == NULL)
- adios (NULL, "unable to ascertain local time");
+ die("unable to ascertain local time");
snprintf (ddate, sizeof(ddate), "Delivery-Date: %s\n", dtimenow (0));
/*
if (debug)
debug_printf ("retrieving message from file \"%s\"\n", file);
if ((fd = copy_message (tempfd, tmpfil, 1)) == -1)
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
close (tempfd);
} else {
if (debug)
debug_printf ("retrieving message from stdin\n");
if ((fd = copy_message (fileno (stdin), tmpfil, 1)) == -1)
- adios(NULL, "unable to create temporary file in %s",
+ die("unable to create temporary file in %s",
get_temp_dir());
}
(void) m_unlink (tmpfil);
if (!(fp = fdopen (fd, "r+")))
- adios (NULL, "unable to access temporary file");
+ die("unable to access temporary file");
/*
* If no sender given, extract it
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]",
case DATESW:
if (datesw)
- adios (NULL, "only one date field at a time");
+ die("only one date field at a time");
if (!(datesw = *argp++) || *datesw == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case TEXTSW:
if (subjsort)
- adios (NULL, "only one text field at a time");
+ die("only one text field at a time");
if (!(subjsort = *argp++) || *subjsort == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SUBJSW:
case LIMSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
while (*cp == '0')
cp++; /* skip any leading zeros */
if (!*cp) { /* hit end of string */
continue;
}
if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp)))
- adios (NULL, "impossible limit %s", cp);
+ die("impossible limit %s", cp);
datelimit *= 60*60*24;
continue;
case NLIMSW:
}
if (*cp == '+' || *cp == '@') {
if (folder)
- adios (NULL, "only one folder at a time!");
+ die("only one folder at a time!");
folder = pluspath (cp);
} else
app_msgarg(&msgs, cp);
if (allmsgs) {
app_msgarg(&msgs, "all");
} else {
- adios (NULL, "must specify messages to sort with -noall");
+ die("must specify messages to sort with -noall");
}
}
if (!datesw)
/* read folder and create message structure */
if (!(mp = folder_read (folder, 1)))
- adios (NULL, "unable to read folder %s", folder);
+ die("unable to read folder %s", folder);
/* check for empty folder */
if (mp->nummsg == 0)
- adios (NULL, "no messages in %s", folder);
+ die("no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
for (msgnum = 0; msgnum < msgs.size; msgnum++)
seq_setprev (mp); /* set the previous sequence */
if ((nmsgs = read_hdrs (mp, datesw)) <= 0)
- adios (NULL, "no messages to sort");
+ die("no messages to sort");
if (checksw && check_failed) {
- adios (NULL, "errors found, no messages sorted");
+ die("errors found, no messages sorted");
}
/*
return 0;
default:
- adios (NULL, "internal error -- you lose");
+ die("internal error -- you lose");
}
break;
}
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
case TOSW:
if (!(f1 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case SUBJECTSW:
if (!(f2 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case PARAMSW:
if (!(f3 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case DESCRIPTSW:
if (!(f4 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case COMMENTSW:
if (!(f5 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case DELAYSW:
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
/*
* If there is an error, just reset the delay parameter
continue;
case FROMSW:
if (!(f7 = *argp++))
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case VERBSW:
}
if (!f1)
- adios (NULL, "missing -viamail \"mailpath\" switch");
+ die("missing -viamail \"mailpath\" switch");
via_mail (f1, f2, f3, f4, f5, delay, f7);
return 0; /* dead code to satisfy the compiler */
umask (~m_gmprot ());
if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ die("unable to create temporary file in %s", get_temp_dir());
}
strncpy (tmpfil, tfile, sizeof(tmpfil));
ambigsw (cp, whatnowswitches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
nedit = 0;
continue;
case NEDITSW:
case PRMPTSW:
if (!(myprompt = *argp++) || *myprompt == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
}
}
if (drft)
- adios (NULL, "only one draft at a time!");
+ die("only one draft at a time!");
drft = cp;
}
*/
int trailln = strlen(trailcmd) + 4;
if (ln < 0 || ln + trailln > bufsz)
- adios(NULL, "arguments too long");
+ die("arguments too long");
cp = buf + ln;
ln = strlen(*argp);
/* +1 for leading space */
if (ln + trailln + 1 > bufsz - (cp-buf))
- adios(NULL, "arguments too long");
+ die("arguments too long");
*cp++ = ' ';
memcpy(cp, *argp, ln+1);
cp += ln;
case AUTHSERVICESW:
#ifdef OAUTH_SUPPORT
if (!(auth_svc = *argp++) || *auth_svc == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
#else
NMH_UNUSED (user);
NMH_UNUSED (auth_svc);
- adios (NULL, "not built with OAuth support");
+ die("not built with OAuth support");
#endif
continue;
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file");
+ die("unable to create temporary file");
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
#ifdef OAUTH_SUPPORT
if (auth_svc == NULL) {
if (saslmech && ! strcasecmp(saslmech, "xoauth2")) {
- adios (NULL, "must specify -authservice with -saslmech xoauth2");
+ die("must specify -authservice with -saslmech xoauth2");
}
} else {
if (user == NULL) {
- adios (NULL, "must specify -user with -saslmech xoauth2");
+ die("must specify -user with -saslmech xoauth2");
}
}
#else
ambigsw (cp, switches);
done (1);
case UNKWNSW:
- adios (NULL, "-%s unknown", cp);
+ die("-%s unknown", cp);
case HELPSW:
snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name);
case DFOLDSW:
if (dfolder)
- adios (NULL, "only one draft folder at a time!");
+ die("only one draft folder at a time!");
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp,
*cp != '@' ? TFOLDER : TSUBCWF);
continue;
case DMSGSW:
if (dmsg)
- adios (NULL, "only one draft message at a time!");
+ die("only one draft message at a time!");
if (!(dmsg = *argp++) || *dmsg == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
continue;
case NDFLDSW:
dfolder = NULL;
case MTSSW:
vec[vecp++] = --cp;
if (!(cp = *argp++) || *cp == '-')
- adios (NULL, "missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
vec[vecp++] = cp;
continue;
}
}
if (msg)
- adios (NULL, "only one draft at a time!");
+ die("only one draft at a time!");
vec[vecp++] = msg = cp;
}