static char fccs[BUFSIZ] = "";
struct mailname *bccs = NULL; /* list of the bcc recipients */
struct mailname *recipients = NULL; /* list of the recipients */
static char fccs[BUFSIZ] = "";
struct mailname *bccs = NULL; /* list of the bcc recipients */
struct mailname *recipients = NULL; /* list of the recipients */
char *cp, *msg = NULL, **argp, **arguments;
char *cp, *msg = NULL, **argp, **arguments;
- tmpfil = getcpy(m_mktemp2("/tmp/", invo_name, NULL, &out));
+ tmpfil = mh_xstrdup(m_mktemp2("/tmp/", invo_name, NULL, &out));
ap++) {
if ((state = alias(etcpath(*ap))) != AK_OK) {
adios(EX_IOERR, NULL, "aliasing error in file %s: %s",
ap++) {
if ((state = alias(etcpath(*ap))) != AK_OK) {
adios(EX_IOERR, NULL, "aliasing error in file %s: %s",
- for (compnum = 1, state = FLD;;) {
- switch (state = m_getfld(state, name, buf, sizeof(buf), in)) {
- case FLD:
- case FLDPLUS:
+ for (compnum = 1, state = FLD2;;) {
+ switch (state = m_getfld2(state, &f, in)) {
+ case FLD2:
- cp = getcpy(buf);
- while (state == FLDPLUS) {
- state = m_getfld(state, name, buf,
- sizeof(buf), in);
- cp = add(buf, cp);
- }
- putfmt(name, cp, out);
- free(cp);
+ putfmt(f.name, f.value, out);
- fprintf(out, "\n%s", buf);
- while (state == BODY) {
- state = m_getfld(state, name, buf,
- sizeof(buf), in);
- fputs(buf, out);
+ fprintf(out, "\n%s", f.value);
+ while ((state = m_getfld2(state, &f, in)) == BODY2) {
+ fputs(f.value, out);
adios(EX_DATAERR, NULL, "message format error in component #%d",
compnum);
adios(EX_DATAERR, NULL, "message format error in component #%d",
compnum);
if (recipients->m_host) {
cp = add("@", cp);
cp = add(recipients->m_host, cp);
if (recipients->m_host) {
cp = add("@", cp);
cp = add(recipients->m_host, cp);
fprintf(stderr, "Skipped %sFcc %s: unable to system().\n",
msgstate == resent ? "Resent-" : "", folders);
} else if (status != 0) {
fprintf(stderr, "Skipped %sFcc %s: unable to system().\n",
msgstate == resent ? "Resent-" : "", folders);
} else if (status != 0) {
- bccdraft = getcpy(m_mktemp2("/tmp/", invo_name, NULL, &out));
+ bccdraft = mh_xstrdup(m_mktemp2("/tmp/", invo_name, NULL, &out));
fprintf(out, "Subject: [BCC] %s", subject ? subject : "");
fprintf(out, "%s: %s\n", attach_hdr, origmsg);
fprintf(out, "------------\n");
fprintf(out, "Subject: [BCC] %s", subject ? subject : "");
fprintf(out, "%s: %s\n", attach_hdr, origmsg);
fprintf(out, "------------\n");