Changeset 5422:e2780a423d96
- Timestamp:
- 2008-06-25 22:43:32 (5 months ago)
- Author:
- Brendan Cully <brendan@…>
- Branch:
- HEAD
- Message:
-
Make mutt_copy_message distinguish between fatal and non-fatal errors.
Non-fatal errors should prevent moving messages, since they indicate
data loss. But mutt should still attempt to display them, since being
able to see some attachments is better than nothing.
Also stop printing out non-PGP material in application/pgp
attachments. Closes #2545, #2912.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5321
|
r5422
|
|
| 148 | 148 | res = mutt_copy_message (fpout, Context, cur, cmflags, |
| 149 | 149 | (option (OPTWEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM); |
| 150 | | if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res == -1) |
| | 150 | if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res < 0) |
| 151 | 151 | { |
| 152 | 152 | mutt_error (_("Could not copy message")); |
-
|
r5291
|
r5422
|
|
| 719 | 719 | } |
| 720 | 720 | |
| | 721 | /* should be made to return -1 on fatal errors, and 1 on non-fatal errors |
| | 722 | * like partial decode, where it is worth displaying as much as possible */ |
| 721 | 723 | int |
| 722 | 724 | mutt_copy_message (FILE *fpout, CONTEXT *src, HEADER *hdr, int flags, |
-
|
r5385
|
r5422
|
|
| 2097 | 2097 | |
| 2098 | 2098 | { |
| 2099 | | /* Check wether signatures have been verified. */ |
| | 2099 | /* Check whether signatures have been verified. */ |
| 2100 | 2100 | gpgme_verify_result_t verify_result; |
| 2101 | 2101 | |
| … |
… |
|
| 2200 | 2200 | } |
| 2201 | 2201 | } |
| | 2202 | #if 0 |
| 2202 | 2203 | else |
| 2203 | | { |
| 2204 | | /* XXX - we may wish to recode here */ |
| 2205 | | if (s->prefix) |
| 2206 | | state_puts (s->prefix, s); |
| 2207 | | state_puts (buf, s); |
| 2208 | | } |
| | 2204 | { |
| | 2205 | /* why would we want to display this at all? */ |
| | 2206 | /* XXX - we may wish to recode here */ |
| | 2207 | if (s->prefix) |
| | 2208 | state_puts (s->prefix, s); |
| | 2209 | state_puts (buf, s); |
| | 2210 | } |
| | 2211 | #endif |
| 2209 | 2212 | } |
| 2210 | 2213 | |
| … |
… |
|
| 2215 | 2218 | state_attach_puts (_("[-- Error: could not find beginning" |
| 2216 | 2219 | " of PGP message! --]\n\n"), s); |
| 2217 | | return -1; |
| | 2220 | return 1; |
| 2218 | 2221 | } |
| 2219 | 2222 | dprint (2, (debugfile, "Leaving pgp_application_pgp handler\n")); |
-
|
r5421
|
r5422
|
|
| 1212 | 1212 | a->encoding == ENCUUENCODED) |
| 1213 | 1213 | mutt_free_body (&b); |
| 1214 | | |
| | 1214 | |
| | 1215 | /* make failure of a single part non-fatal */ |
| | 1216 | if (rc < 0) |
| | 1217 | rc = 1; |
| 1215 | 1218 | return rc; |
| 1216 | 1219 | } |
-
|
r5397
|
r5422
|
|
| 834 | 834 | newOffset[i - first].hdr = ftello (fp) + offset; |
| 835 | 835 | |
| 836 | | if (mutt_copy_message (fp, ctx, ctx->hdrs[i], M_CM_UPDATE, CH_FROM | CH_UPDATE | CH_UPDATE_LEN) == -1) |
| | 836 | if (mutt_copy_message (fp, ctx, ctx->hdrs[i], M_CM_UPDATE, |
| | 837 | CH_FROM | CH_UPDATE | CH_UPDATE_LEN) != 0) |
| 837 | 838 | { |
| 838 | 839 | mutt_perror (tempfile); |
-
|
r5410
|
r5422
|
|
| 468 | 468 | } |
| 469 | 469 | } |
| | 470 | #if 0 |
| 470 | 471 | else |
| 471 | 472 | { |
| | 473 | /* why would we want to display this at all? */ |
| 472 | 474 | /* XXX - we may wish to recode here */ |
| 473 | 475 | if (s->prefix) |
| … |
… |
|
| 475 | 477 | state_puts (buf, s); |
| 476 | 478 | } |
| | 479 | #endif |
| 477 | 480 | } |
| 478 | 481 | |