res = mutt_copy_message (fpout, Context, cur, cmflags,
(option (OPTWEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM);
- if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res == -1)
+ if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res < 0)
{
mutt_error (_("Could not copy message"));
if (fpfilterout != NULL)
return rc;
}
+/* should be made to return -1 on fatal errors, and 1 on non-fatal errors
+ * like partial decode, where it is worth displaying as much as possible */
int
mutt_copy_message (FILE *fpout, CONTEXT *src, HEADER *hdr, int flags,
int chflags)
char *tmpfname;
{
- /* Check wether signatures have been verified. */
+ /* Check whether signatures have been verified. */
gpgme_verify_result_t verify_result;
verify_result = gpgme_op_verify_result (ctx);
safe_fclose (&pgpout);
}
}
+#if 0
else
- {
- /* XXX - we may wish to recode here */
- if (s->prefix)
- state_puts (s->prefix, s);
- state_puts (buf, s);
- }
+ {
+ /* why would we want to display this at all? */
+ /* XXX - we may wish to recode here */
+ if (s->prefix)
+ state_puts (s->prefix, s);
+ state_puts (buf, s);
+ }
+#endif
}
m->goodsig = (maybe_goodsig && have_any_sigs);
{
state_attach_puts (_("[-- Error: could not find beginning"
" of PGP message! --]\n\n"), s);
- return -1;
+ return 1;
}
dprint (2, (debugfile, "Leaving pgp_application_pgp handler\n"));
if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE ||
a->encoding == ENCUUENCODED)
mutt_free_body (&b);
-
+
+ /* make failure of a single part non-fatal */
+ if (rc < 0)
+ rc = 1;
return rc;
}
*/
newOffset[i - first].hdr = ftello (fp) + offset;
- if (mutt_copy_message (fp, ctx, ctx->hdrs[i], M_CM_UPDATE, CH_FROM | CH_UPDATE | CH_UPDATE_LEN) == -1)
+ if (mutt_copy_message (fp, ctx, ctx->hdrs[i], M_CM_UPDATE,
+ CH_FROM | CH_UPDATE | CH_UPDATE_LEN) != 0)
{
mutt_perror (tempfile);
mutt_sleep (5);
state_attach_puts (_("[-- END PGP SIGNED MESSAGE --]\n"), s);
}
}
+#if 0
else
{
+ /* why would we want to display this at all? */
/* XXX - we may wish to recode here */
if (s->prefix)
state_puts (s->prefix, s);
state_puts (buf, s);
}
+#endif
}
rc = 0;